From ba8d2f5db428b57df2d7a2b1a471c21a2ba4af66 Mon Sep 17 00:00:00 2001 From: alessandro Date: Tue, 1 Jul 2025 17:18:48 +0200 Subject: [PATCH 1/5] Update the "Detector mode" drop-down menu (in the "Task" dialogs) to display the ROI modes defined on the server side, as configured in the beamline_config.yml or detector.yml files. Values defined in beamline_config.yml override those in detector.yml. --- demo/beamline_config.yml | 2 ++ demo/detector.xml | 1 + ui/src/components/Tasks/Characterisation.jsx | 14 ++++++++------ ui/src/components/Tasks/DataCollection.jsx | 18 ++++++++++-------- ui/src/components/Tasks/GenericTaskForm.jsx | 2 +- ui/src/components/Tasks/Helical.jsx | 14 ++++++++------ ui/src/components/Tasks/Mesh.jsx | 14 ++++++++------ 7 files changed, 38 insertions(+), 27 deletions(-) diff --git a/demo/beamline_config.yml b/demo/beamline_config.yml index 98cf242d2..2b31f4031 100644 --- a/demo/beamline_config.yml +++ b/demo/beamline_config.yml @@ -106,6 +106,7 @@ configuration: helical: # Defaults for helical scan. Missing values are taken from default number_of_images: 100 + detector_mode_list: ["0", "C18", "C2"] characterisation: # Defaults for characterisation. Missing values are taken from default @@ -123,6 +124,7 @@ configuration: cell_counting: zig-zag cell_spacing: vertical, horizontal mesh_center: top-left + detector_mode_list: ["0", "C18", "C2"] gphlworkflow: {} diff --git a/demo/detector.xml b/demo/detector.xml index 7c765e25c..e6a7e104d 100644 --- a/demo/detector.xml +++ b/demo/detector.xml @@ -13,6 +13,7 @@ 3269 True cbf + ["0", "C18", "C12", "C2"] diff --git a/ui/src/components/Tasks/Characterisation.jsx b/ui/src/components/Tasks/Characterisation.jsx index 32161ac99..ffdc21cc0 100644 --- a/ui/src/components/Tasks/Characterisation.jsx +++ b/ui/src/components/Tasks/Characterisation.jsx @@ -51,7 +51,7 @@ class Characterisation extends React.Component { const stringFields = [ 'centringMethod', - 'detector_mode', + 'detector_roi_mode', 'account_rad_damage', 'opt_sad', 'space_group', @@ -173,11 +173,13 @@ class Characterisation extends React.Component { - + {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + + ) : null} diff --git a/ui/src/components/Tasks/DataCollection.jsx b/ui/src/components/Tasks/DataCollection.jsx index be850f1aa..56a8cd701 100644 --- a/ui/src/components/Tasks/DataCollection.jsx +++ b/ui/src/components/Tasks/DataCollection.jsx @@ -57,7 +57,7 @@ class DataCollection extends React.Component { 'shutterless', 'inverse_beam', 'centringMethod', - 'detector_mode', + 'detector_roi_mode', 'space_group', 'prefix', 'subdir', @@ -283,13 +283,15 @@ class DataCollection extends React.Component { - - - + {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + + + + ) : null} diff --git a/ui/src/components/Tasks/GenericTaskForm.jsx b/ui/src/components/Tasks/GenericTaskForm.jsx index 86686b6e9..3ba4c21e3 100644 --- a/ui/src/components/Tasks/GenericTaskForm.jsx +++ b/ui/src/components/Tasks/GenericTaskForm.jsx @@ -72,7 +72,7 @@ class GenericTaskForm extends React.Component { 'shutterless', 'inverse_beam', 'centringMethod', - 'detector_mode', + 'detector_roi_mode', 'space_group', 'prefix', 'subdir', diff --git a/ui/src/components/Tasks/Helical.jsx b/ui/src/components/Tasks/Helical.jsx index 61c60f615..5059feb30 100644 --- a/ui/src/components/Tasks/Helical.jsx +++ b/ui/src/components/Tasks/Helical.jsx @@ -55,7 +55,7 @@ class Helical extends React.Component { 'shutterless', 'inverse_beam', 'centringMethod', - 'detector_mode', + 'detector_roi_mode', 'space_group', 'prefix', 'subdir', @@ -174,11 +174,13 @@ class Helical extends React.Component { label="Beam size" list={this.props.apertureList} /> - + {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + + ) : null} diff --git a/ui/src/components/Tasks/Mesh.jsx b/ui/src/components/Tasks/Mesh.jsx index 8091d92b0..83ba599e3 100644 --- a/ui/src/components/Tasks/Mesh.jsx +++ b/ui/src/components/Tasks/Mesh.jsx @@ -64,7 +64,7 @@ class Mesh extends React.Component { 'shutterless', 'inverse_beam', 'centringMethod', - 'detector_mode', + 'detector_roi_mode', 'space_group', 'prefix', 'subdir', @@ -184,11 +184,13 @@ class Mesh extends React.Component { label="Beam size" list={this.props.apertureList} /> - + {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + + ) : null} From 633acdae8bfb5fcb980a42c519934d21f877e4c8 Mon Sep 17 00:00:00 2001 From: alessandro Date: Thu, 17 Jul 2025 16:25:48 +0200 Subject: [PATCH 2/5] Bump mxcubecore version --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index c352890ef..fef48b01b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2025,14 +2025,14 @@ websockets = ">=12.0,<13.0" [[package]] name = "mxcubecore" -version = "1.339.0" +version = "1.342.0" description = "Core libraries for the MXCuBE application" optional = false python-versions = "<3.12,>=3.10" groups = ["main"] files = [ - {file = "mxcubecore-1.339.0-py3-none-any.whl", hash = "sha256:80a4929623ebc3e7e9709ac9e88a99cf9ec8889143e48e07669f176f8355741e"}, - {file = "mxcubecore-1.339.0.tar.gz", hash = "sha256:f8094e824b14ec8508af3eb261d9453c42eb4a3f7a657bc48894f05de5f3d0a6"}, + {file = "mxcubecore-1.342.0-py3-none-any.whl", hash = "sha256:a1ab230af771bfe4bfe42091dd385a8d31e0fbbf0d2ee661f679e117e228b2b3"}, + {file = "mxcubecore-1.342.0.tar.gz", hash = "sha256:2a3ba5f5d971bd750ef558c272dcb910284a80020858571db0cdcba85d170ac8"}, ] [package.dependencies] @@ -4075,4 +4075,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<3.12" -content-hash = "44e5f582871dedb0529c1aa0aab6c659f3f43bd9f279d66b13384a3e26aeba78" +content-hash = "58282465cafaf498ac1c0af4755982438a86b1687c4d953afcb5eed770621e18" diff --git a/pyproject.toml b/pyproject.toml index 715031e5e..af6fa50f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ pydantic = ">=2.8.2,<2.9.0" PyDispatcher = "^2.0.6" pytz = "^2022.6" tzlocal = "^4.2" -mxcubecore = ">=1.335.0" +mxcubecore = ">=1.342.0" bcrypt = "^4.0.1" authlib = "^1.3.0" flask-limiter = "^3.12" From 3984cbaaf42009688ebe84231a806bec61c82128 Mon Sep 17 00:00:00 2001 From: alessandro Date: Thu, 17 Jul 2025 17:15:43 +0200 Subject: [PATCH 3/5] Update tests (acq parameters) --- test/input_parameters.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/input_parameters.py b/test/input_parameters.py index 404506456..bd7143dc5 100644 --- a/test/input_parameters.py +++ b/test/input_parameters.py @@ -127,6 +127,7 @@ "comments": "", "detector_binning_mode": None, "detector_distance": 0.0, + "detector_mode_list": ["0", "C18", "C12", "C2"], "detector_roi_mode": 0, "disable_processing": False, "exp_time": 0.02, @@ -187,6 +188,7 @@ "comments": "", "detector_binning_mode": None, "detector_distance": 0.0, + "detector_mode_list": ["0", "C18", "C12", "C2"], "detector_roi_mode": 0, "determine_rad_params": False, "disable_processing": False, @@ -261,6 +263,7 @@ "comments": "", "detector_binning_mode": None, "detector_distance": 0.0, + "detector_mode_list": ["0", "C18", "C2"], "detector_roi_mode": 0, "disable_processing": False, "exp_time": 10, @@ -314,6 +317,7 @@ "comments": "", "detector_binning_mode": None, "detector_distance": 0.0, + "detector_mode_list": ["0", "C18", "C12", "C2"], "detector_roi_mode": 0, "disable_processing": False, "exp_time": 0.02, From 87c24a28d1e43035bf9c8ae3faaa843d06246a3b Mon Sep 17 00:00:00 2001 From: alessandro Date: Mon, 21 Jul 2025 14:55:13 +0200 Subject: [PATCH 4/5] Remove unnecessary optional chaining, "detector_mode_list" always exists --- ui/src/components/Tasks/Characterisation.jsx | 4 ++-- ui/src/components/Tasks/DataCollection.jsx | 4 ++-- ui/src/components/Tasks/Helical.jsx | 4 ++-- ui/src/components/Tasks/Mesh.jsx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/src/components/Tasks/Characterisation.jsx b/ui/src/components/Tasks/Characterisation.jsx index ffdc21cc0..97b1ae9c6 100644 --- a/ui/src/components/Tasks/Characterisation.jsx +++ b/ui/src/components/Tasks/Characterisation.jsx @@ -173,13 +173,13 @@ class Characterisation extends React.Component { - {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + {this.props.initialValues.detector_mode_list.length > 0 && ( - ) : null} + )} diff --git a/ui/src/components/Tasks/DataCollection.jsx b/ui/src/components/Tasks/DataCollection.jsx index 56a8cd701..0b785a388 100644 --- a/ui/src/components/Tasks/DataCollection.jsx +++ b/ui/src/components/Tasks/DataCollection.jsx @@ -283,7 +283,7 @@ class DataCollection extends React.Component { - {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + {this.props.initialValues.detector_mode_list.length > 0 && ( - ) : null} + )} diff --git a/ui/src/components/Tasks/Helical.jsx b/ui/src/components/Tasks/Helical.jsx index 5059feb30..b96ae07b5 100644 --- a/ui/src/components/Tasks/Helical.jsx +++ b/ui/src/components/Tasks/Helical.jsx @@ -174,13 +174,13 @@ class Helical extends React.Component { label="Beam size" list={this.props.apertureList} /> - {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + {this.props.initialValues.detector_mode_list.length > 0 && ( - ) : null} + )} diff --git a/ui/src/components/Tasks/Mesh.jsx b/ui/src/components/Tasks/Mesh.jsx index 83ba599e3..d82b5a250 100644 --- a/ui/src/components/Tasks/Mesh.jsx +++ b/ui/src/components/Tasks/Mesh.jsx @@ -184,13 +184,13 @@ class Mesh extends React.Component { label="Beam size" list={this.props.apertureList} /> - {this.props.initialValues?.detector_mode_list?.length !== 0 ? ( + {this.props.initialValues.detector_mode_list.length > 0 && ( - ) : null} + )} From 61d6d6609280fcdc63b35dec5bdbc695bd904777 Mon Sep 17 00:00:00 2001 From: alessandro Date: Mon, 21 Jul 2025 17:01:09 +0200 Subject: [PATCH 5/5] Add the "detector_mode_list" parameter to the demo.yaml configuration files too --- demo.yaml/beamline_config.yml | 2 ++ demo.yaml/detector.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/demo.yaml/beamline_config.yml b/demo.yaml/beamline_config.yml index 942887888..4e57e1203 100644 --- a/demo.yaml/beamline_config.yml +++ b/demo.yaml/beamline_config.yml @@ -102,6 +102,7 @@ configuration: helical: # Defaults for helical scan. Missing values are taken from default number_of_images: 100 + detector_mode_list: ["0", "C18", "C2"] characterisation: # Defaults for characterisation. Missing values are taken from default @@ -110,6 +111,7 @@ configuration: overlap: -89 num_images: 4 shutterless: false + detector_mode_list: ["0", "C18", "C2"] mesh: # Defaults for 'advanced' acquisition. Missing values are taken from default diff --git a/demo.yaml/detector.yaml b/demo.yaml/detector.yaml index 07dfae305..6513fe5cd 100644 --- a/demo.yaml/detector.yaml +++ b/demo.yaml/detector.yaml @@ -21,5 +21,6 @@ configuration: type: Eiger2 username: detector width: 3110 + roi_mode_list: '["0", "C18", "C12", "C2"]' objects: detector_distance: dtox.yaml