Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

1303 read smargon position in ispyb for rotation scans from hardware not GDA #1411

Merged
merged 3 commits into from
May 30, 2024

Conversation

rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented May 24, 2024

Fixes #1303

Link to dodal PR (if required): #N/A
(remember to update setup.cfg with the dodal commit tag if you need it for tests to pass!)

To test:

  1. the DataCollection Position should now be populated by reading the smargon position instead of GDA
  2. ispyb_extras no longer has the position attribute
  3. Tests pass

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

I know this changed happened a while ago, but why is DataCollectionPositionInfo distinct from DataCollectionInfo?

@@ -202,6 +208,7 @@ def _handle_ispyb_transmission_flux_read(self, doc) -> Sequence[ScanDataInfo]:
def populate_info_for_update(
self,
event_sourced_data_collection_info: DataCollectionInfo,
event_sourced_position_info: Optional[DataCollectionPositionInfo],
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to my earlier comment, if the position info was part of the collection info, we wouldn't need an extra parameter in this base callback. Seems weird to add it to the base callback when only rotations are using it

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Some questions in the comments, but the change and tests look good.

@@ -845,7 +845,7 @@ def test_ispyb_deposition_in_rotation_plan(
position_id = fetch_datacollection_attribute(
dcid, DATA_COLLECTION_COLUMN_MAP["positionid"]
)
expected_values = {"posX": 10.0, "posY": 20.0, "posZ": 30.0}
expected_values = {"posX": 1.0, "posY": 2.0, "posZ": 3.0}
Copy link
Contributor

Choose a reason for hiding this comment

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

How come this has changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we are now getting the info from the hardware, the expected values now come from the smargon fixture which had those xyz values which are coincidentally a factor of 10x smaller

@olliesilvester
Copy link
Contributor

Also, we need to remember to do the associated GDA change when merging this

@rtuck99
Copy link
Contributor Author

rtuck99 commented May 30, 2024

I know this changed happened a while ago, but why is DataCollectionPositionInfo distinct from DataCollectionInfo?

It's a separate sproc that you have to call to do the update, there is a special Position table which is referenced by a foreign-key in DataCollection

@rtuck99 rtuck99 merged commit f7c652e into main May 30, 2024
20 checks passed
@rtuck99 rtuck99 deleted the 1303_read_position_for_rotation_scans_in_ispyb branch May 30, 2024 14:33
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…not GDA (DiamondLightSource/hyperion#1411)

* (DiamondLightSource/hyperion#1303) read position for rotation scans in ispyb, remove position from ispyb_params

* Make pyright happy

* Make ruff happy
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read position for rotation scans in ispyb
2 participants