DiamondLightSource / mx-bluesky

Bluesky plans, plan stubs, and utilities for MX beamlines
https://diamondlightsource.github.io/mx-bluesky/
Apache License 2.0
0 stars 2 forks source link

Reduce filesystem access when validating parameters #643

Closed rtuck99 closed 3 days ago

rtuck99 commented 1 week ago

This moves the check/creation of the storage_directory folder from property access to DiffractionExperiment model validation.

This doesn't completely remove duplicated calls to os.makedirs but it does reduce it from ~22 to a hopefully more sane number. But there will still be some duplications as we construct various intermediate parameter instances, all of which have the storage_directory parameter.

Fixes #527

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.25%. Comparing base (4928709) to head (e1fda2d). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #643 +/- ## ======================================= Coverage 85.25% 85.25% ======================================= Files 100 100 Lines 6695 6695 ======================================= Hits 5708 5708 Misses 987 987 ``` | [Components](https://app.codecov.io/gh/DiamondLightSource/mx-bluesky/pull/643/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DiamondLightSource) | Coverage Δ | | |---|---|---| | [i24 SSX](https://app.codecov.io/gh/DiamondLightSource/mx-bluesky/pull/643/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DiamondLightSource) | `69.57% <ø> (ø)` | | | [hyperion](https://app.codecov.io/gh/DiamondLightSource/mx-bluesky/pull/643/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DiamondLightSource) | `96.77% <ø> (-0.01%)` | :arrow_down: | | [other](https://app.codecov.io/gh/DiamondLightSource/mx-bluesky/pull/643/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DiamondLightSource) | `95.12% <100.00%> (+0.01%)` | :arrow_up: |

🚨 Try these New Features: