mxcubecore 1.378.0__py3-none-any.whl → 1.380.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mxcubecore might be problematic. Click here for more details.
- mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py +36 -43
- mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py +6 -14
- {mxcubecore-1.378.0.dist-info → mxcubecore-1.380.0.dist-info}/METADATA +1 -1
- {mxcubecore-1.378.0.dist-info → mxcubecore-1.380.0.dist-info}/RECORD +7 -7
- {mxcubecore-1.378.0.dist-info → mxcubecore-1.380.0.dist-info}/COPYING +0 -0
- {mxcubecore-1.378.0.dist-info → mxcubecore-1.380.0.dist-info}/COPYING.LESSER +0 -0
- {mxcubecore-1.378.0.dist-info → mxcubecore-1.380.0.dist-info}/WHEEL +0 -0
|
@@ -41,7 +41,6 @@ from py4j import (
|
|
|
41
41
|
clientserver,
|
|
42
42
|
java_gateway,
|
|
43
43
|
)
|
|
44
|
-
from py4j.protocol import Py4JJavaError
|
|
45
44
|
|
|
46
45
|
from mxcubecore import HardwareRepository as HWR
|
|
47
46
|
from mxcubecore.BaseHardwareObjects import (
|
|
@@ -96,7 +95,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
96
95
|
super().__init__(name)
|
|
97
96
|
# Py4J gateway to external workflow program
|
|
98
97
|
self._gateway = None
|
|
99
|
-
self.
|
|
98
|
+
self.jvm_imports_checked = False
|
|
100
99
|
|
|
101
100
|
# ID for current workflow calculation
|
|
102
101
|
self._enactment_id = None
|
|
@@ -221,7 +220,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
221
220
|
# so we are never in state 'ON'/STANDBY
|
|
222
221
|
raise RuntimeError("Workflow is already running, cannot be started")
|
|
223
222
|
|
|
224
|
-
self.
|
|
223
|
+
self.jvm_imports_checked = False
|
|
225
224
|
|
|
226
225
|
# Cannot be done in init, where the api.sessions link is not yet ready
|
|
227
226
|
self.config.software_paths["GPHL_WDIR"] = os.path.join(
|
|
@@ -479,30 +478,36 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
479
478
|
if self.get_state() is self.STATES.OFF:
|
|
480
479
|
return None
|
|
481
480
|
|
|
482
|
-
if not self.
|
|
483
|
-
#
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
481
|
+
if not self.jvm_imports_checked:
|
|
482
|
+
# We need to use dir to check for the presence or absence of an imported
|
|
483
|
+
# class. hasattr/getattr don't do what is needed here, because if the
|
|
484
|
+
# attribute name is not present java_gateway receives proto.SUCCESS_PACKAGE
|
|
485
|
+
# from the Java side and instantiates a JavaPackage with the name, even
|
|
486
|
+
# though no such package exists in the JVM. See:
|
|
487
|
+
# https://github.com/py4j/py4j/blob/cb9e392d8fc5bec6b99a612e2911017900061628/py4j-python/src/py4j/java_gateway.py#L1748
|
|
488
|
+
# This looks like a py4j bug on the Java side but needs more investigation.
|
|
489
|
+
|
|
490
|
+
# The Py4jMessage class is used as the indicator class here: we assume that
|
|
491
|
+
# if it has been imported, all other unqualified Java classnames used via
|
|
492
|
+
# the default JVM view have been imported, otherwise none of them have been
|
|
493
|
+
# imported and we need to do it here.
|
|
494
|
+
if "Py4jMessage" not in dir(self._gateway.jvm):
|
|
495
|
+
for qualified_class_name in (
|
|
496
|
+
"co.gphl.sdcp.astra.service.py4j.Py4jMessage",
|
|
497
|
+
"co.gphl.beamline.v2_unstable.instrumentation.CentringStatus",
|
|
498
|
+
"co.gphl.beamline.v2_unstable.domain_types.CrystalClass",
|
|
499
|
+
"co.gphl.beamline.v2_unstable.domain_types.ChemicalElement",
|
|
500
|
+
"co.gphl.beamline.v2_unstable.domain_types.AbsorptionEdge",
|
|
501
|
+
):
|
|
502
|
+
java_gateway.java_import(self._gateway.jvm, qualified_class_name)
|
|
503
|
+
logging.getLogger("HWR").warning(
|
|
504
|
+
"Importing required unqualified class names from the JVM explicitly"
|
|
489
505
|
)
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
)
|
|
493
|
-
except Py4JJavaError:
|
|
494
|
-
msg_class = (
|
|
495
|
-
self._gateway.jvm.py4j.reflection.ReflectionUtil.classForName(
|
|
496
|
-
"co.gphl.sdcp.py4j.Py4jMessage"
|
|
497
|
-
)
|
|
506
|
+
logging.getLogger("HWR").warning(
|
|
507
|
+
"Please consider upgrading the GPhL workflow application"
|
|
498
508
|
)
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
)
|
|
502
|
-
logging.getLogger("HWR").debug(
|
|
503
|
-
"GΦL workflow Py4jMessage class is: %s" % msg_class
|
|
504
|
-
)
|
|
505
|
-
self.msg_class_imported = True
|
|
509
|
+
|
|
510
|
+
self.jvm_imports_checked = True
|
|
506
511
|
|
|
507
512
|
xx0 = self._decode_py4j_message(py4j_message)
|
|
508
513
|
message_type = xx0.message_type
|
|
@@ -923,9 +928,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
923
928
|
py4j_payload = self._payload_to_java(payload)
|
|
924
929
|
|
|
925
930
|
try:
|
|
926
|
-
response = self._gateway.jvm.
|
|
927
|
-
py4j_payload, correlation_id
|
|
928
|
-
)
|
|
931
|
+
response = self._gateway.jvm.Py4jMessage(py4j_payload, correlation_id)
|
|
929
932
|
except:
|
|
930
933
|
self.abort_workflow(
|
|
931
934
|
message="Error creating Java message (%s) to send to workflow"
|
|
@@ -938,9 +941,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
938
941
|
def _CentringDone_to_java(self, centringDone):
|
|
939
942
|
jvm = self._gateway.jvm
|
|
940
943
|
return jvm.astra.messagebus.messages.information.CentringDoneImpl(
|
|
941
|
-
jvm.
|
|
942
|
-
centringDone.status
|
|
943
|
-
),
|
|
944
|
+
jvm.CentringStatus.valueOf(centringDone.status),
|
|
944
945
|
self.to_java_time(centringDone.timestamp),
|
|
945
946
|
self._GoniostatTranslation_to_java(centringDone.goniostatTranslation),
|
|
946
947
|
)
|
|
@@ -1042,9 +1043,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
1042
1043
|
crystal_classes = selectedLattice.userCrystalClasses
|
|
1043
1044
|
if crystal_classes:
|
|
1044
1045
|
ccset = set(
|
|
1045
|
-
jvm.
|
|
1046
|
-
self.toJStringArray(crystal_classes)
|
|
1047
|
-
)
|
|
1046
|
+
jvm.CrystalClass.fromStringList(self.toJStringArray(crystal_classes))
|
|
1048
1047
|
)
|
|
1049
1048
|
builder = builder.userCrystalClasses(ccset)
|
|
1050
1049
|
urlstrings = selectedLattice.referenceReflectionFiles
|
|
@@ -1093,9 +1092,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
1093
1092
|
crystal_classes = userProvidedInfo.crystalClasses
|
|
1094
1093
|
if crystal_classes:
|
|
1095
1094
|
ccset = set(
|
|
1096
|
-
jvm.
|
|
1097
|
-
self.toJStringArray(crystal_classes)
|
|
1098
|
-
)
|
|
1095
|
+
jvm.CrystalClass.fromStringList(self.toJStringArray(crystal_classes))
|
|
1099
1096
|
)
|
|
1100
1097
|
builder = builder.crystalClasses(ccset)
|
|
1101
1098
|
xx0 = userProvidedInfo.spaceGroup
|
|
@@ -1122,12 +1119,8 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
1122
1119
|
if anomalousScatterer is None:
|
|
1123
1120
|
return None
|
|
1124
1121
|
|
|
1125
|
-
element = jvm.
|
|
1126
|
-
|
|
1127
|
-
)
|
|
1128
|
-
edge = jvm.co.gphl.beamline.v2_unstable.domain_types.AbsorptionEdge.valueOf(
|
|
1129
|
-
anomalousScatterer.edge
|
|
1130
|
-
)
|
|
1122
|
+
element = jvm.ChemicalElement.valueOf(anomalousScatterer.element)
|
|
1123
|
+
edge = jvm.AbsorptionEdge.valueOf(anomalousScatterer.edge)
|
|
1131
1124
|
return jvm.astra.messagebus.messages.domain_types.AnomalousScattererImpl(
|
|
1132
1125
|
element, edge
|
|
1133
1126
|
)
|
|
@@ -816,22 +816,14 @@ class SampleChanger(Container, HardwareObject):
|
|
|
816
816
|
self._trigger_loaded_sample_changed_event(None)
|
|
817
817
|
|
|
818
818
|
def _set_loaded_sample(self, sample):
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
if smp.is_loaded():
|
|
823
|
-
previous_loaded = smp
|
|
824
|
-
break
|
|
825
|
-
|
|
826
|
-
for smp in self.get_sample_list():
|
|
827
|
-
if smp != sample:
|
|
828
|
-
smp._set_loaded(False)
|
|
819
|
+
for s in self.get_sample_list():
|
|
820
|
+
if s != sample:
|
|
821
|
+
s._set_loaded(False)
|
|
829
822
|
else:
|
|
830
|
-
if self.get_loaded_sample()
|
|
831
|
-
|
|
823
|
+
if self.get_loaded_sample() != s:
|
|
824
|
+
s._set_loaded(True)
|
|
832
825
|
|
|
833
|
-
|
|
834
|
-
self._trigger_loaded_sample_changed_event(sample)
|
|
826
|
+
self._trigger_loaded_sample_changed_event(sample)
|
|
835
827
|
|
|
836
828
|
def _set_selected_sample(self, sample):
|
|
837
829
|
cur = self.get_selected_sample()
|
|
@@ -187,7 +187,7 @@ mxcubecore/HardwareObjects/Gphl/CollectEmulator.py,sha256=iiH6EblDwEMdxl44BswHJE
|
|
|
187
187
|
mxcubecore/HardwareObjects/Gphl/GphlMessages.py,sha256=3WSBmUGLka4gilfwpqXyc4SJMlOt9y2sRNrOiE0-DaM,35759
|
|
188
188
|
mxcubecore/HardwareObjects/Gphl/GphlQueueEntry.py,sha256=Rwu6YL8U4knibWI9yOXBoUVuayL6O0rHQWQuEP2Hu_g,2309
|
|
189
189
|
mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py,sha256=vlNhXkP2Ob-bvOuRY5rYVTSgZ8ZULrSQYYhtSS9V4fA,132177
|
|
190
|
-
mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py,sha256=
|
|
190
|
+
mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py,sha256=s6B8BdgU6IYeGxi69QqJiM-ZUu34c-ZlaX3S5yRl4wo,50316
|
|
191
191
|
mxcubecore/HardwareObjects/Gphl/Transcal2MiniKappa.py,sha256=Dzf05WSRC5vtOOluZ69f5xZrr6BmT7ITu-OfrKMqemc,9777
|
|
192
192
|
mxcubecore/HardwareObjects/Gphl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
193
193
|
mxcubecore/HardwareObjects/Gphl/run_mxcube_test.csh,sha256=IvrrFiuRS7c6kYD_FflVc0WINr7oOCBEryAOtMk5zqQ,1233
|
|
@@ -361,7 +361,7 @@ mxcubecore/HardwareObjects/abstract/AbstractNState.py,sha256=JZvD_ZpQu5U8ycaWFii
|
|
|
361
361
|
mxcubecore/HardwareObjects/abstract/AbstractOnlineProcessing.py,sha256=vs_fJsDDLwivu1kYHA7RKJXj1aTH5V6G2tEy7MYGw4c,34104
|
|
362
362
|
mxcubecore/HardwareObjects/abstract/AbstractProcedure.py,sha256=kW2SzN5kYYCeOS2IzpzQ9VAjYAoRU7ZtyDxqrOb8Pbg,7849
|
|
363
363
|
mxcubecore/HardwareObjects/abstract/AbstractResolution.py,sha256=eLoymf-i637FbwfZwOtTmKOeSqCQjE2OnpSMdl8oIEg,8524
|
|
364
|
-
mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py,sha256=
|
|
364
|
+
mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py,sha256=h9j7XF8KrRtVQpthF_424fsEIR2LqsEZLNPrLaQB4TI,26718
|
|
365
365
|
mxcubecore/HardwareObjects/abstract/AbstractSampleView.py,sha256=-E9cTMW-gw2vY91OeL2V5wg1icduLeYFOX50vo2_NEA,7774
|
|
366
366
|
mxcubecore/HardwareObjects/abstract/AbstractShutter.py,sha256=OeHSr3N9x-a9QmGdQEu3usN23TYspJGDnZjAkShqk3w,2798
|
|
367
367
|
mxcubecore/HardwareObjects/abstract/AbstractSlits.py,sha256=1fymQFlxJ9naOVT9A8THszEkHm7VxQSGJJWPQV0v3Hs,3839
|
|
@@ -469,8 +469,8 @@ mxcubecore/utils/conversion.py,sha256=G1bk2Mi2ZwGbZa5pEeiFaKWxhSVXVGqu1L9_SioyUO
|
|
|
469
469
|
mxcubecore/utils/qt_import.py,sha256=0lPmqok_oYQZ059kJCq7RWdg490T8YKyRvoZGyWDy4M,14486
|
|
470
470
|
mxcubecore/utils/tango.py,sha256=vwEVrIrWKEFaeaJUz3xbaC7XWHY8ZeJ-pfcSrTfZPIE,2114
|
|
471
471
|
mxcubecore/utils/units.py,sha256=Gh7ovTUN00XBMUoyDG5W7akCx1pROL-M6pK2z1ouemg,1361
|
|
472
|
-
mxcubecore-1.
|
|
473
|
-
mxcubecore-1.
|
|
474
|
-
mxcubecore-1.
|
|
475
|
-
mxcubecore-1.
|
|
476
|
-
mxcubecore-1.
|
|
472
|
+
mxcubecore-1.380.0.dist-info/COPYING,sha256=u-Mc8zCecwyo4YoP8UulmzCiZZ_MmCLROd_NBtOcRj0,35148
|
|
473
|
+
mxcubecore-1.380.0.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
474
|
+
mxcubecore-1.380.0.dist-info/METADATA,sha256=6B_PPOklkVJy1qOYcNv3IOP6-2vET86xyiVn87VENqk,4259
|
|
475
|
+
mxcubecore-1.380.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
476
|
+
mxcubecore-1.380.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|