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

MNT: BITS structure cleanup #47

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

Conversation

MDecarabas
Copy link
Collaborator

@MDecarabas MDecarabas commented Mar 6, 2025

Description

Addressing Switch cases. PR is also gonna be used to test Issues: #43

Type of change

  • Code maintenance/cleanup

@MDecarabas MDecarabas added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 6, 2025
@MDecarabas MDecarabas force-pushed the switch_case_organization branch from 446d73a to 01d880a Compare March 6, 2025 19:06
@MDecarabas MDecarabas self-assigned this Mar 6, 2025
@MDecarabas MDecarabas added the bug Something isn't working label Mar 6, 2025
@ravescovi
Copy link
Collaborator

@prjemian What is the advantage of having a factory for the sim_motor and sim_det? It looks like a convoluted way for something very simple. Is there a scenario where it will actually be used in the future?

@prjemian
Copy link
Collaborator

prjemian commented Mar 7, 2025

The ophyd simulators support the default three plans that test an initial installation works as expeceted. As described in previous issues (such as #32 and #40), the ophyd simulators were the last remaining objects that could not be described in devices.yml. The factory method makes that possible.

@ravescovi
Copy link
Collaborator

ravescovi commented Mar 7, 2025 via email

@prjemian
Copy link
Collaborator

prjemian commented Mar 7, 2025

factory implies the creation of many.

Indeed it does. See the source for the many possibilities. I did not see any compelling reason to limit this to only ophyd.sim.motor and ophyd.sim.noisy_det when other simulators may become useful.

@ravescovi
Copy link
Collaborator

ravescovi commented Mar 7, 2025 via email

@ravescovi ravescovi requested a review from prjemian March 8, 2025 00:50
@ravescovi ravescovi added this to the v1.0.0 release milestone Mar 8, 2025
@coveralls
Copy link

coveralls commented Mar 8, 2025

Pull Request Test Coverage Report for Build 13797639520

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 85.474%

Totals Coverage Status
Change from base Build 13774228748: 0.1%
Covered Lines: 712
Relevant Lines: 833

💛 - Coveralls

Copy link
Collaborator

@prjemian prjemian left a comment

Choose a reason for hiding this comment

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

Still in draft?

@ravescovi
Copy link
Collaborator

ravescovi commented Mar 8, 2025 via email

@ravescovi
Copy link
Collaborator

Probably useful for our isolation efforts to discuss core and utils in this PR.

@ravescovi
Copy link
Collaborator

Still not passing tests.

@ravescovi ravescovi requested a review from prjemian March 11, 2025 17:47
@MDecarabas MDecarabas removed the documentation Improvements or additions to documentation label Mar 11, 2025
@MDecarabas MDecarabas changed the title MNT: BITS structure & documentation cleanup MNT: BITS structure cleanup Mar 11, 2025
Comment on lines +63 to +65
version: str = iconfig.get(
"ICONFIG_VERSION", "0.0.0"
) # TODO: Will anyone ever have a wrong catalog version?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What are the odds the iconfig version is incorrect?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably around zero.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The idea of versioning this iconfig.yml is to define what keys are expected. Bump the version when the structure changes. This template will spawn living repositories, each with their own evolution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't this test that:

  • version exists
  • meets or exceeds some minimum

@MDecarabas
Copy link
Collaborator Author

# SCAN_ID_PV: f"{IOC}bluesky_scan_id"

This line in iconfig is never activated. Bin it?

@MDecarabas MDecarabas marked this pull request as ready for review March 11, 2025 19:37
@MDecarabas MDecarabas requested a review from ravescovi March 11, 2025 19:37
@prjemian
Copy link
Collaborator

@MDecarabas - You commented on:

# SCAN_ID_PV: f"{IOC}bluesky_scan_id"

Should keep as comment, but edit the comment which is invalid YAML synatx:

 # SCAN_ID_PV: "IOC:scan_id_pv"

The beamline that has a PV for this would uncomment this line and edit the PV value. For them, their scan_id value would come from EPICS. XPCS does this now. So does my local system.

@@ -63,8 +67,8 @@ APS_DEVICES_FILE: devices_aps_only.yml
OPHYD:
### Control layer for ophyd to communicate with EPICS.
### Default: PyEpics
### Choices: "PyEpics" or "caproto"
# CONTROL_LAYER: caproto
### Choices: "PyEpics" or "caproto" # caproto is not yet supported
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? We need to keep the ability to make a field replacement. Two times in the past five years at APS.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this might say

Suggested change
### Choices: "PyEpics" or "caproto" # caproto is not yet supported
### Choices: "PyEpics" or "caproto" # caproto is not yet tested with this package

@@ -50,6 +50,7 @@ dependencies = [
"pyRestTable",
"pysumreg",
"qtpy",
"caproto",
Copy link
Collaborator

Choose a reason for hiding this comment

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

sort

@@ -76,6 +76,7 @@ def test_StoredDict(md_file):
# Add another key.
sdict["bee"] = "bumble"
sdict.flush()
print(f"\n\nthis is the md_file: {md_file}\n\n")
Copy link
Collaborator

Choose a reason for hiding this comment

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

pytest usually swallows stdout. Can this be removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Core dump from make_devices() Mapping of "switch" cases
4 participants