Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo instrument separation for Sync template #58

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

ravescovi
Copy link
Collaborator

Description

Separates demo_instrument from the rest of bits core

Fixes #56

Type of change

Choose which options apply, and delete the ones which do not apply.

  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code maintenance/cleanup

@ravescovi ravescovi changed the title Demo instrument Demo instrument separation for Sync template Mar 10, 2025
@coveralls
Copy link

coveralls commented Mar 10, 2025

Pull Request Test Coverage Report for Build 13796866742

Details

  • 61 of 62 (98.39%) changed or added relevant lines in 15 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 85.492%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/bits/demo_instrument/startup.py 16 17 94.12%
Totals Coverage Status
Change from base Build 13774228748: 0.1%
Covered Lines: 713
Relevant Lines: 834

💛 - Coveralls

@ravescovi ravescovi requested a review from prjemian March 10, 2025 23:45
@@ -17,8 +17,8 @@
import apstools.callbacks
import apstools.utils

from ..core.run_engine_init import RE
from ..utils.config_loaders import iconfig
from bits.core.run_engine_init import RE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for similar enable check, as in nexus above.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think an enable belongs here. The run engine should always be enabled.

@@ -10,7 +10,7 @@

import databroker

from ..utils.config_loaders import iconfig
from bits.utils.config_loaders import iconfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting puzzled here. If this part is in bits (and not instrument), then keep the relative path.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment applies below, too

@@ -64,7 +67,7 @@ OPHYD:
### Control layer for ophyd to communicate with EPICS.
### Default: PyEpics
Copy link
Collaborator

@prjemian prjemian Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to describe the default if value is always provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we remove from the iconfig

@prjemian
Copy link
Collaborator

Taking a bit of time to understand until reading this:

Script to create a new instrument based on the 'src/bits/demo_instrument' template
folder.
This script copies the template instrument folder into a new directory with the
provided instrument name (which must be a valid Python package name) and updates
the pyproject.toml file with an entry under [tool.instruments] reflecting the
new instrument's relative path.

Probably need to try out the full process to evaluate. How to use this branch as a template for a new repo?

ravescovi and others added 2 commits March 10, 2025 22:53
@ravescovi
Copy link
Collaborator Author

I think a lot of the comments are derived from #47 (which was used as base for this commit here). I will wait for that one to be merged before fixing the comments above.

@ravescovi
Copy link
Collaborator Author

Taking a bit of time to understand until reading this:

Script to create a new instrument based on the 'src/bits/demo_instrument' template
folder.
This script copies the template instrument folder into a new directory with the
provided instrument name (which must be a valid Python package name) and updates
the pyproject.toml file with an entry under [tool.instruments] reflecting the
new instrument's relative path.

Probably need to try out the full process to evaluate. How to use this branch as a template for a new repo?

This is not working yet. It is just a place holder for now.

@ravescovi
Copy link
Collaborator Author

I suggest we stop this PR here and open a new one for the init / sync functionality.

@prjemian
Copy link
Collaborator

I believe the only we can test this as a template is to merge this PR. The page to create a new repo from this template doesn't show an option for a different branch. Either default or all:
image

Any additional work will go into a new issue.

@ravescovi ravescovi marked this pull request as ready for review March 11, 2025 21:29
@ravescovi
Copy link
Collaborator Author

ravescovi commented Mar 11, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor instrument directory
4 participants