Skip to content

Update SIM processing workflow - #855

Open
tieneupin wants to merge 8 commits into
mainfrom
trigger-sim-processing
Open

Update SIM processing workflow#855
tieneupin wants to merge 8 commits into
mainfrom
trigger-sim-processing

Conversation

@tieneupin

@tieneupin tieneupin commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Having fleshed out the PySIMRecon service in cryoem-services (see DiamondLightSource/cryoem-services#286 and DiamondLightSource/cryoem-services#291), this PR updates the request_sim_processing endpoint so that it includes the correct parameters in the outbound message.

  • Renamed request_sim_processing API endpoint to request_sim_reconstruction
  • Updated the SIMContext logic so that only SIM files ending with "_FL" are processed; raw data files without "_FL" will be transferred but skipped
  • Updated parameters in the outbound message
  • Updated tests

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.65%. Comparing base (1b858e4) to head (e2c2640).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
+ Coverage   54.51%   54.65%   +0.13%     
==========================================
  Files         104      104              
  Lines       11131    11160      +29     
  Branches     1474     1475       +1     
==========================================
+ Hits         6068     6099      +31     
+ Misses       4742     4741       -1     
+ Partials      321      320       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tieneupin tieneupin changed the title Update SIM processing Update SIM processing workflow Aug 5, 2026
@tieneupin
tieneupin requested a review from stephen-riggs August 5, 2026 08:14
@tieneupin
tieneupin marked this pull request as ready for review August 5, 2026 08:15
@tieneupin tieneupin self-assigned this Aug 5, 2026
@tieneupin tieneupin added enhancement New feature or request server Relates to the server component client Relates to the client component cryo-sim Part of the cryo-SIM pipeline extension labels Aug 5, 2026
Comment thread src/murfey/server/api/workflow_sim.py Outdated
machine_config.calibrations.get("pysimrecon_config")
)
if not pysimrecon_config:
logger.error(f"No PySIMRecon configuration found for {instrument_name}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If there aren't parameters, do you need to reject the processing or can you just let the service use defaults?

@tieneupin tieneupin Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. I could provide the latest wavelength values we currently have as the default values, and the ones read from the MachineConfig could be updated as and when the instrument's calibrations are changed.

Comment thread src/murfey/server/api/workflow_sim.py Outdated
# Construct the output directory for the PySIMRecon outputs to be saved to
try:
visit_idx = sim_data.file.parent.parts.index(visit_name)
raw_dir = sim_data.file.parents[-(visit_idx + 2)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The -(visit_idx + 2) is correct, but confused me a lot initially

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can appreciate that. Path().parents arranges the parent paths in descending order (immediate parent to root), so finding the parent based on index will have to start from the end of the list.

try:
visit_idx = sim_data.file.parent.parts.index(visit_name)
raw_dir = sim_data.file.parents[-(visit_idx + 2)]
output_dir = (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's probably as easier way to do this - I think it's just a substitution of processed for raw*?

@tieneupin tieneupin Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that would be the most direct way. I have probably overengineered it slightly, but this method would allow for the code to still work if we decide to use a directory name other than "raw" in the future.

@tieneupin
tieneupin force-pushed the trigger-sim-processing branch from 3b94457 to f193c3c Compare August 7, 2026 02:05
@tieneupin
tieneupin force-pushed the trigger-sim-processing branch from 3583032 to 99a2622 Compare August 7, 2026 09:21
@tieneupin
tieneupin force-pushed the trigger-sim-processing branch from 99a2622 to e2c2640 Compare August 7, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Relates to the client component cryo-sim Part of the cryo-SIM pipeline extension enhancement New feature or request server Relates to the server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants