sapiopycommons 2025.4.8a473__py3-none-any.whl → 2025.4.9a150__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 sapiopycommons might be problematic. Click here for more details.
- sapiopycommons/callbacks/callback_util.py +392 -1262
- sapiopycommons/callbacks/field_builder.py +0 -2
- sapiopycommons/chem/Molecules.py +2 -0
- sapiopycommons/customreport/term_builder.py +1 -1
- sapiopycommons/datatype/attachment_util.py +2 -4
- sapiopycommons/datatype/data_fields.py +1 -23
- sapiopycommons/eln/experiment_handler.py +279 -933
- sapiopycommons/eln/experiment_report_util.py +10 -15
- sapiopycommons/eln/plate_designer.py +59 -159
- sapiopycommons/files/file_bridge.py +0 -76
- sapiopycommons/files/file_bridge_handler.py +110 -325
- sapiopycommons/files/file_data_handler.py +2 -2
- sapiopycommons/files/file_util.py +15 -40
- sapiopycommons/files/file_validator.py +5 -6
- sapiopycommons/files/file_writer.py +1 -1
- sapiopycommons/flowcyto/flow_cyto.py +1 -1
- sapiopycommons/general/accession_service.py +3 -3
- sapiopycommons/general/aliases.py +28 -51
- sapiopycommons/general/audit_log.py +2 -2
- sapiopycommons/general/custom_report_util.py +1 -24
- sapiopycommons/general/exceptions.py +2 -41
- sapiopycommons/general/popup_util.py +2 -2
- sapiopycommons/multimodal/multimodal.py +0 -1
- sapiopycommons/processtracking/custom_workflow_handler.py +30 -46
- sapiopycommons/recordmodel/record_handler.py +159 -547
- sapiopycommons/rules/eln_rule_handler.py +30 -41
- sapiopycommons/rules/on_save_rule_handler.py +30 -41
- sapiopycommons/webhook/webhook_handlers.py +55 -448
- sapiopycommons/webhook/webservice_handlers.py +2 -2
- {sapiopycommons-2025.4.8a473.dist-info → sapiopycommons-2025.4.9a150.dist-info}/METADATA +1 -1
- sapiopycommons-2025.4.9a150.dist-info/RECORD +59 -0
- sapiopycommons/customreport/auto_pagers.py +0 -281
- sapiopycommons/eln/experiment_cache.py +0 -173
- sapiopycommons/eln/experiment_step_factory.py +0 -474
- sapiopycommons/eln/experiment_tags.py +0 -7
- sapiopycommons/eln/step_creation.py +0 -235
- sapiopycommons/general/data_structure_util.py +0 -115
- sapiopycommons/general/directive_util.py +0 -86
- sapiopycommons/samples/aliquot.py +0 -48
- sapiopycommons-2025.4.8a473.dist-info/RECORD +0 -67
- {sapiopycommons-2025.4.8a473.dist-info → sapiopycommons-2025.4.9a150.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.4.8a473.dist-info → sapiopycommons-2025.4.9a150.dist-info}/licenses/LICENSE +0 -0
|
@@ -443,8 +443,6 @@ class FieldBuilder:
|
|
|
443
443
|
raise SapioException("Unable to set multiple list modes at once for a selection list.")
|
|
444
444
|
# Static values don't have a list mode. Evaluate this last so that the multiple list modes check doesn't
|
|
445
445
|
# need to be more complex.
|
|
446
|
-
# PR-47531: Even though static values don't use an existing list mode, a list mode must still be set.
|
|
447
|
-
list_mode = ListMode.USER
|
|
448
446
|
|
|
449
447
|
if not list_mode and static_values is None:
|
|
450
448
|
raise SapioException("A list mode must be chosen for selection list fields.")
|
sapiopycommons/chem/Molecules.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Author Yechen Qiao
|
|
2
2
|
# Common Molecule Utilities for Molecule Transfers with Sapio
|
|
3
|
+
from typing import cast
|
|
3
4
|
|
|
4
5
|
from rdkit import Chem
|
|
5
6
|
from rdkit.Chem import Crippen, MolToInchi
|
|
@@ -8,6 +9,7 @@ from rdkit.Chem import rdMolDescriptors
|
|
|
8
9
|
from rdkit.Chem.EnumerateStereoisomers import StereoEnumerationOptions, EnumerateStereoisomers
|
|
9
10
|
from rdkit.Chem.MolStandardize import rdMolStandardize
|
|
10
11
|
from rdkit.Chem.SaltRemover import SaltRemover
|
|
12
|
+
from rdkit.Chem.rdChemReactions import ChemicalReaction
|
|
11
13
|
from rdkit.Chem.rdchem import Mol, RWMol, Bond
|
|
12
14
|
|
|
13
15
|
from sapiopycommons.chem.IndigoMolecules import indigo, renderer, indigo_inchi
|
|
@@ -279,7 +279,7 @@ class TermBuilder:
|
|
|
279
279
|
|
|
280
280
|
:param a: The first term in the operation.
|
|
281
281
|
:param b: The second term in the operation.
|
|
282
|
-
:param is_negated: Whether the returned term should be negated (i.e. turn this into an
|
|
282
|
+
:param is_negated: Whether the returned term should be negated (i.e. turn this into an xnor operation).
|
|
283
283
|
:return: A composite report term for "A xor B".
|
|
284
284
|
"""
|
|
285
285
|
return TermBuilder.and_terms(TermBuilder.or_terms(a, b),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import io
|
|
2
2
|
|
|
3
3
|
from sapiopylib.rest.DataMgmtService import DataMgmtServer
|
|
4
|
-
from sapiopylib.rest.utils.recordmodel.PyRecordModel import PyRecordModel
|
|
5
4
|
from sapiopylib.rest.utils.recordmodel.RecordModelWrapper import WrappedType
|
|
6
5
|
|
|
7
6
|
from sapiopycommons.general.aliases import AliasUtil, SapioRecord, UserIdentifier
|
|
@@ -50,10 +49,9 @@ class AttachmentUtil:
|
|
|
50
49
|
with io.BytesIO(file_bytes) as stream:
|
|
51
50
|
dr_man.set_attachment_data(attachment, file_name, stream)
|
|
52
51
|
|
|
53
|
-
# CR-47491: Support providing a data type name string to receive PyRecordModels instead of requiring a WrapperType.
|
|
54
52
|
@staticmethod
|
|
55
53
|
def create_attachment(context: UserIdentifier, file_name: str, file_bytes: bytes,
|
|
56
|
-
wrapper_type: type[WrappedType]
|
|
54
|
+
wrapper_type: type[WrappedType]) -> WrappedType:
|
|
57
55
|
"""
|
|
58
56
|
Create an attachment data type and initialize its attachment bytes at the same time.
|
|
59
57
|
Makes a webservice call to create the attachment record and a second to set its bytes.
|
|
@@ -64,6 +62,6 @@ class AttachmentUtil:
|
|
|
64
62
|
:param wrapper_type: The attachment type to create.
|
|
65
63
|
:return: A record model for the newly created attachment.
|
|
66
64
|
"""
|
|
67
|
-
attachment: WrappedType
|
|
65
|
+
attachment: WrappedType = RecordHandler(context).create_models(wrapper_type, 1)[0]
|
|
68
66
|
AttachmentUtil.set_attachment_bytes(context, attachment, file_name, file_bytes)
|
|
69
67
|
return attachment
|
|
@@ -58,26 +58,4 @@ class ProcessWorkflowTrackingFields:
|
|
|
58
58
|
WORKFLOW_PROCESS_TAT__FIELD = WrapperField("WorkflowProcessTAT", FieldType.DOUBLE)
|
|
59
59
|
WORKFLOW_START_USER_ID__FIELD = WrapperField("WorkflowStartUserId", FieldType.STRING)
|
|
60
60
|
WORKFLOW_TAT__FIELD = WrapperField("WorkflowTAT", FieldType.DOUBLE)
|
|
61
|
-
WORKFLOW_VERSION__FIELD = WrapperField("WorkflowVersion", FieldType.LONG)
|
|
62
|
-
|
|
63
|
-
class PlateDesignerWellElementFields:
|
|
64
|
-
DATA_TYPE_NAME = 'PlateDesignerWellElement'
|
|
65
|
-
ACTUAL_VOLUME_REMOVED__FIELD = WrapperField("ActualVolumeRemoved", FieldType.DOUBLE)
|
|
66
|
-
ALIQUOT_SAMPLE_RECORD_ID__FIELD = WrapperField("AliquotSampleRecordId", FieldType.LONG)
|
|
67
|
-
COL_POSITION__FIELD = WrapperField("ColPosition", FieldType.SELECTION)
|
|
68
|
-
CONCENTRATION__FIELD = WrapperField("Concentration", FieldType.DOUBLE)
|
|
69
|
-
CONCENTRATION_UNITS__FIELD = WrapperField("ConcentrationUnits", FieldType.STRING)
|
|
70
|
-
CONTROL_TYPE__FIELD = WrapperField("ControlType", FieldType.STRING)
|
|
71
|
-
DILUTION_SCHEME__FIELD = WrapperField("DilutionScheme", FieldType.DOUBLE)
|
|
72
|
-
IS_CONTROL__FIELD = WrapperField("IsControl", FieldType.BOOLEAN)
|
|
73
|
-
LAYER__FIELD = WrapperField("Layer", FieldType.INTEGER)
|
|
74
|
-
PLATE_RECORD_ID__FIELD = WrapperField("PlateRecordId", FieldType.LONG)
|
|
75
|
-
ROW_POSITION__FIELD = WrapperField("RowPosition", FieldType.SELECTION)
|
|
76
|
-
SOURCE_DATA_TYPE_NAME__FIELD = WrapperField("SourceDataTypeName", FieldType.STRING)
|
|
77
|
-
SOURCE_RECORD_ID__FIELD = WrapperField("SourceRecordId", FieldType.LONG)
|
|
78
|
-
SOURCE_SAMPLE_CONCENTRATION__FIELD = WrapperField("SourceSampleConcentration", FieldType.DOUBLE)
|
|
79
|
-
SOURCE_SAMPLE_MASS__FIELD = WrapperField("SourceSampleMass", FieldType.DOUBLE)
|
|
80
|
-
SOURCE_SAMPLE_VOLUME__FIELD = WrapperField("SourceSampleVolume", FieldType.DOUBLE)
|
|
81
|
-
SOURCE_VOLUME_TO_REMOVE__FIELD = WrapperField("SourceVolumeToRemove", FieldType.DOUBLE)
|
|
82
|
-
TARGET_MASS__FIELD = WrapperField("TargetMass", FieldType.DOUBLE)
|
|
83
|
-
VOLUME__FIELD = WrapperField("Volume", FieldType.DOUBLE)
|
|
61
|
+
WORKFLOW_VERSION__FIELD = WrapperField("WorkflowVersion", FieldType.LONG)
|