Rotation scan improvements from testing#915
Conversation
- move to the limit if normal nudge would take it over since into-view steps are large - update tests with limits
Codecov Report
@@ Coverage Diff @@
## main DiamondLightSource/hyperion#915 +/- ##
==========================================
+ Coverage 93.32% 93.55% +0.22%
==========================================
Files 53 54 +1
Lines 2562 2590 +28
==========================================
+ Hits 2391 2423 +32
+ Misses 171 167 -4
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
DominicOram
left a comment
There was a problem hiding this comment.
Thanks, some comments in code. But otherwise works well
| # TODO: Check topup gate | ||
| hyperion.log.LOGGER.info("Setting fgs params") | ||
| yield from set_flyscan_params(fgs_motors, parameters.experiment_params) | ||
| hyperion.log.LOGGER.info("Set params") |
There was a problem hiding this comment.
Should: I think this log is overkill
| def append_to_comment(self, comment: str): | ||
| self._append_to_comment(self.ispyb_ids[0], comment) | ||
|
|
||
| def start(self, doc: dict): |
There was a problem hiding this comment.
Should: I think a test on this would be good
| def start(self, doc: dict): | ||
| LOGGER.info("Zocalo handler received start document.") | ||
| if doc.get("subplan_name") == "rotation_scan_main": | ||
| if self.run_uid is None: |
There was a problem hiding this comment.
Must: This is all about making sure the isypb deposition happens before zocalo triggers, right? I think we need a very explicit test that confirms this, otherwise we'll end up accidentally hitting it again
| # All MX collection fields: | ||
| # [ | ||
| # "id", | ||
| # "parentid", | ||
| # "visitid", | ||
| # "sampleid", | ||
| # "detectorid", | ||
| # "positionid", | ||
| # "apertureid", | ||
| # "datacollectionnumber", | ||
| # "starttime", | ||
| # "endtime", | ||
| # "runstatus", | ||
| # "axisstart", | ||
| # "axisend", | ||
| # "axisrange", | ||
| # "overlap", | ||
| # "nimages", | ||
| # "startimagenumber", | ||
| # "npasses", | ||
| # "exptime", | ||
| # "imgdir", | ||
| # "imgprefix", | ||
| # "imgsuffix", | ||
| # "imgcontainersubpath", | ||
| # "filetemplate", | ||
| # "wavelength", | ||
| # "resolution", | ||
| # "detectordistance", | ||
| # "xbeam", | ||
| # "ybeam", | ||
| # "comments", | ||
| # "slitgapvertical", | ||
| # "slitgaphorizontal", | ||
| # "transmission", | ||
| # "synchrotronmode", | ||
| # "xtalsnapshot1", | ||
| # "xtalsnapshot2", | ||
| # "xtalsnapshot3", | ||
| # "xtalsnapshot4", | ||
| # "rotationaxis", | ||
| # "phistart", | ||
| # "kappastart", | ||
| # "omegastart", | ||
| # "resolutionatcorner", | ||
| # "detector2theta", | ||
| # "undulatorgap1", | ||
| # "undulatorgap2", | ||
| # "undulatorgap3", | ||
| # "beamsizeatsamplex", | ||
| # "beamsizeatsampley", | ||
| # "avgtemperature", | ||
| # "actualcenteringposition", | ||
| # "beamshape", | ||
| # "focalspotsizeatsamplex", | ||
| # "focalspotsizeatsampley", | ||
| # "polarisation", | ||
| # "flux", | ||
| # "processeddatafile", | ||
| # "datfile", | ||
| # "magnification", | ||
| # "totalabsorbeddose", | ||
| # "binning", | ||
| # "particlediameter", | ||
| # "boxsizectf", | ||
| # "minresolution", | ||
| # "mindefocus", | ||
| # "maxdefocus", | ||
| # "defocusstepsize", | ||
| # "amountastigmatism", | ||
| # "extractsize", | ||
| # "bgradius", | ||
| # "voltage", | ||
| # "objaperture", | ||
| # "c1aperture", | ||
| # "c2aperture", | ||
| # "c3aperture", | ||
| # "c1lens", | ||
| # "c2lens", | ||
| # "c3lens", | ||
| # ] | ||
| # |
There was a problem hiding this comment.
Must: Remove this please
| def test_ev_to_a_converter(): | ||
| for i in range(len(test_energies)): | ||
| assert convert_eV_to_angstrom(test_energies[i]) == pytest.approx( | ||
| test_wavelengths[i] | ||
| ) | ||
|
|
||
|
|
||
| def test_a_to_ev_converter(): | ||
| for i in range(len(test_wavelengths)): | ||
| assert convert_angstrom_to_eV(test_wavelengths[i]) == pytest.approx( | ||
| test_energies[i] | ||
| ) |
There was a problem hiding this comment.
Nit: It's nicer to use paramterize as it's more obvious which one has failed if only one has
Fixes #905 and fixes #851
Mostly changes made on the beamline as part of testing, of which most are ISPyB deposition fixes and one hack of OAV snapshot paths - issue to fix here (DiamondLightSource/mx-bluesky#328)
Also includes no longer adding wavelength as external parameter and instead calculating it from energy as I didn't want to find it in GDA to send...
To test: