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

Adjust to new DirectoryProvider structure #376

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Conversation

DiamondJoseph
Copy link
Collaborator

@DiamondJoseph DiamondJoseph commented Feb 21, 2024

  • Backs off Directory that is provided, allows a hardcoded root to get back to where it was
    Allows us to unpin our dependency on dodal (through it, ophyd-async)

@DiamondJoseph
Copy link
Collaborator Author

Requires bluesky/ophyd-async#86 and a release of ophyd-async

@callumforrester
Copy link
Collaborator

Noting that this will need to be moved: #353

Copy link
Collaborator

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

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

Build not passing

src/blueapi/config.py Outdated Show resolved Hide resolved
)
directory_info: DirectoryInfo = provider()
yield from bpp.inject_md_wrapper(plan, md={DATA_SESSION: directory_info.prefix})
provider.clear()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't this mean that detectors subsequently calling provider() will try to write to None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I think the issue is actually that update() should always fetch a new instance rather than only the first time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It was intended to be a caching thing, where update() would generate a brand new scan number and save location, so you would end up with this:

image

If it fetches a new instance every time, wouldn't the detectors each write to a different scan number, which would be different in turn from the resource doc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you're right (and update() doesn't hold onto the previous one as I thought it did in the previous comment), I was confused by the change to no longer swallow the Exception in update() [as required merge into Bluesky had occured], which previously made sure the prior collection was None but no longer does! ⚡

@DiamondJoseph DiamondJoseph force-pushed the directoryInfo branch 2 times, most recently from 429df84 to 5ce6ac2 Compare March 6, 2024 12:26
@DiamondJoseph DiamondJoseph mentioned this pull request Mar 18, 2024
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.16%. Comparing base (c3d1ccd) to head (931395b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
+ Coverage   89.96%   90.16%   +0.19%     
==========================================
  Files          43       41       -2     
  Lines        1814     1708     -106     
==========================================
- Hits         1632     1540      -92     
+ Misses        182      168      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DiamondJoseph
Copy link
Collaborator Author

IMPORTANT: Must also now unpin dependency on dodal

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

As it is this is fine, all the code seems to be replaced in DiamondLightSource/dodal#445. Except there are tests in this PR that have no correspondent in dodal. Could you make a PR on dodal that moves the appropriate tests over?

@DiamondJoseph
Copy link
Collaborator Author

As it is this is fine, all the code seems to be replaced in DiamondLightSource/dodal#445. Except there are tests in this PR that have no correspondent in dodal. Could you make a PR on dodal that moves the appropriate tests over?

I've been working on it today: the FakeDetector structure wasn't correct for how a StandardDetector actually uses a DirectoryProvider

@DiamondJoseph DiamondJoseph dismissed DominicOram’s stale review April 29, 2024 14:59

Tests have been merged in dodal now

@DiamondJoseph DiamondJoseph merged commit 0a634dc into main Apr 29, 2024
24 checks passed
@DiamondJoseph DiamondJoseph deleted the directoryInfo branch April 29, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants