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

Commit

Permalink
Remove ispyb params
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram committed Aug 13, 2024
1 parent 836e3d8 commit a596328
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from __future__ import annotations

from hyperion.external_interaction.ispyb.data_model import DataCollectionInfo
from hyperion.external_interaction.ispyb.ispyb_dataclass import (
IspybParams,
)
from hyperion.log import ISPYB_LOGGER
from hyperion.parameters.components import TemporaryIspybExtras
from hyperion.parameters.rotation import RotationScan


Expand All @@ -23,17 +21,19 @@ def populate_data_collection_info_for_rotation(params: RotationScan):
info.xtal_snapshot2,
info.xtal_snapshot3,
info.xtal_snapshot4,
) = get_xtal_snapshots(params.ispyb_params)
) = get_xtal_snapshots(params.ispyb_extras)
return info


def get_xtal_snapshots(ispyb_params: IspybParams):
if ispyb_params.xtal_snapshots_omega_start:
xtal_snapshots = ispyb_params.xtal_snapshots_omega_start[:4]
def get_xtal_snapshots(ispyb_extras: TemporaryIspybExtras | None):
if ispyb_extras and ispyb_extras.xtal_snapshots_omega_start:
xtal_snapshots = ispyb_extras.xtal_snapshots_omega_start[:4]
ISPYB_LOGGER.info(
f"Using rotation scan snapshots {xtal_snapshots} for ISPyB deposition"
)
else:
ISPYB_LOGGER.warning("No xtal snapshot paths sent to ISPyB!")
ISPYB_LOGGER.info(
"No xtal snapshot paths sent to ISPyB from GDA, will take own snapshots"
)
xtal_snapshots = []
return xtal_snapshots + [None] * (4 - len(xtal_snapshots))
10 changes: 1 addition & 9 deletions src/hyperion/parameters/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
from semver import Version

from hyperion.external_interaction.config_server import FeatureFlags
from hyperion.external_interaction.ispyb.ispyb_dataclass import (
IspybParams,
)
from hyperion.parameters.constants import CONST

T = TypeVar("T")
Expand All @@ -44,7 +41,7 @@ def __modify_schema__(cls, field_schema):
field_schema.update(examples=["1.0.2", "2.15.3-alpha", "21.3.15-beta+12345"])


PARAMETER_VERSION = ParameterVersion.parse("6.0.0")
PARAMETER_VERSION = ParameterVersion.parse("5.0.0")


class RotationAxis(StrEnum):
Expand Down Expand Up @@ -196,11 +193,6 @@ def num_images(self) -> int:
@abstractmethod
def detector_params(self) -> DetectorParams: ...

@property
@abstractmethod
def ispyb_params(self) -> IspybParams: # Soon to remove
...


class WithScan(BaseModel):
"""For experiments where the scan is known"""
Expand Down
7 changes: 0 additions & 7 deletions src/hyperion/parameters/gridscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
from scanspec.core import Path as ScanPath
from scanspec.specs import Line, Static

from hyperion.external_interaction.ispyb.ispyb_dataclass import (
GridscanIspybParams,
)
from hyperion.parameters.components import (
DiffractionExperimentWithSample,
IspybExperimentType,
Expand Down Expand Up @@ -49,10 +46,6 @@ class GridCommon(
default=AperturePositionGDANames.SMALL_APERTURE
)

@property
def ispyb_params(self):
return GridscanIspybParams()

@property
def detector_params(self):
self.det_dist_to_beam_converter_path = (
Expand Down
11 changes: 0 additions & 11 deletions src/hyperion/parameters/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from scanspec.core import Path as ScanPath
from scanspec.specs import Line

from hyperion.external_interaction.ispyb.ispyb_dataclass import RotationIspybParams
from hyperion.parameters.components import (
DiffractionExperimentWithSample,
IspybExperimentType,
Expand Down Expand Up @@ -75,16 +74,6 @@ def detector_params(self):
**optional_args,
)

@property
def ispyb_params(self): # pyright: ignore
return RotationIspybParams(
xtal_snapshots_omega_start=(
self.ispyb_extras.xtal_snapshots_omega_start
if self.ispyb_extras
else []
),
)

@property
def scan_points(self) -> AxesPoints:
scan_spec = Line(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ def scan_data_infos_for_update_3d(
dummy_params.detector_params
)

assert dummy_params.ispyb_params is not None
assert dummy_params is not None
data_collection_grid_info = DataCollectionGridInfo(
dx_in_mm=dummy_params.x_step_size_um,
Expand Down

This file was deleted.

0 comments on commit a596328

Please sign in to comment.