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

I24 serial: beamline test fixes #774

Merged
merged 16 commits into from
Feb 14, 2025
Merged

I24 serial: beamline test fixes #774

merged 16 commits into from
Feb 14, 2025

Conversation

noemifrisina
Copy link
Contributor

Testing version 1.4.4

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.

Great, thanks. Couple of comments that mostly boil down to tidying up and adding tests

pyproject.toml Outdated
@@ -46,7 +46,7 @@ dependencies = [
"ophyd == 1.9.0",
"ophyd-async >= 0.8a5",
"bluesky >= 1.13",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@cb12746cb3f658a6d4571a0cd870133a17980bb7",
"dls-dodal == 1.39.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: Better not to have the pin in that I did for the release i.e. not to include that commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sigh, I didn't even notice this had made it into the PR. Good spot, thanks!

@@ -626,6 +629,8 @@ def kickoff_and_complete_collection(pmac: PMAC, parameters: FixedTargetParameter
pmac.collection_time, total_collection_time, group="setup_pmac"
)
yield from bps.wait(group="setup_pmac") # Make sure the soft signals are set
_sig = yield from bps.rd(pmac.collection_time)
SSX_LOGGER.warning(f"This was set for collection time {_sig}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: I suspect this may have been left in after debugging? In theory it should just be the same as what's set and logged above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it was just to check that it had been correctly set

Comment on lines 56 to 57
filename_prefix = parameters.filename
filename_prefix = cagetstring(Eiger.pv.filenameRBV)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: We should remove the first set of filename_prefix if we're immediately going to overwrite it

Copy link
Contributor

Choose a reason for hiding this comment

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

Could: A test for this would be nice

Copy link
Contributor Author

@noemifrisina noemifrisina Jan 30, 2025

Choose a reason for hiding this comment

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

Facepalm, I though I had removed it, thanks. I'm actually wondering if it would be better to pass as an argument since we have to do the same cagetstring before starting dcid in the collection plan...

Comment on lines +216 to +218
"group": {
"experimentType": self.parameters.ispyb_experiment_type.value
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: We should add a test that would have caught this. There are already tests that patch out the request.post below but they just assert it's called, we should assert it's called with reasonable values

@@ -707,7 +712,7 @@ def run_fixed_target_plan(
parameters.collection_directory.mkdir(parents=True, exist_ok=True)

if parameters.chip_map:
upload_chip_map_to_geobrick(pmac, parameters.chip_map)
yield from upload_chip_map_to_geobrick(pmac, parameters.chip_map)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: We should have a test that would have caught this

@@ -433,7 +435,8 @@ def start_i24(

# DCID process depends on detector PVs being set up already
SSX_LOGGER.debug("Start DCID process")
filetemplate = f"{parameters.filename}.nxs"
complete_filename = cagetstring(pv.eiger_ODfilenameRBV)
filetemplate = f"{complete_filename}.nxs"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: A test for this would be nice

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.38%. Comparing base (dbeab37) to head (c1640b8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #774      +/-   ##
==========================================
+ Coverage   86.94%   87.38%   +0.44%     
==========================================
  Files         102      102              
  Lines        6969     6970       +1     
==========================================
+ Hits         6059     6091      +32     
+ Misses        910      879      -31     
Components Coverage Δ
i24 SSX 73.95% <100.00%> (+1.11%) ⬆️
hyperion 96.32% <ø> (ø)
other 96.62% <ø> (ø)

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.

Great, thanks. Just one minor comment

@patch(
"mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.PARAM_FILE_PATH_FT"
)
def test_fiducial(fake_param_path, patch_read, patch_mtr, pmac, RE):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: This isn't a great test name. Test fiducial does what?

@noemifrisina noemifrisina merged commit b7856b2 into main Feb 14, 2025
22 checks passed
@noemifrisina noemifrisina deleted the beamline_test_280125 branch February 14, 2025 17:09
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.

2 participants