sapiopycommons 2025.6.16a562__py3-none-any.whl → 2025.6.18a563__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.

Files changed (54) hide show
  1. sapiopycommons/ai/__init__.py +0 -0
  2. sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.py +43 -0
  3. sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.pyi +31 -0
  4. sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2_grpc.py +24 -0
  5. sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2.py +123 -0
  6. sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2.pyi +598 -0
  7. sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2_grpc.py +24 -0
  8. sapiopycommons/ai/api/plan/proto/step_output_pb2.py +45 -0
  9. sapiopycommons/ai/api/plan/proto/step_output_pb2.pyi +42 -0
  10. sapiopycommons/ai/api/plan/proto/step_output_pb2_grpc.py +24 -0
  11. sapiopycommons/ai/api/plan/proto/step_pb2.py +43 -0
  12. sapiopycommons/ai/api/plan/proto/step_pb2.pyi +43 -0
  13. sapiopycommons/ai/api/plan/proto/step_pb2_grpc.py +24 -0
  14. sapiopycommons/ai/api/plan/script/proto/script_pb2.py +53 -0
  15. sapiopycommons/ai/api/plan/script/proto/script_pb2.pyi +99 -0
  16. sapiopycommons/ai/api/plan/script/proto/script_pb2_grpc.py +153 -0
  17. sapiopycommons/ai/api/plan/tool/proto/entry_pb2.py +57 -0
  18. sapiopycommons/ai/api/plan/tool/proto/entry_pb2.pyi +96 -0
  19. sapiopycommons/ai/api/plan/tool/proto/entry_pb2_grpc.py +24 -0
  20. sapiopycommons/ai/api/plan/tool/proto/tool_pb2.py +67 -0
  21. sapiopycommons/ai/api/plan/tool/proto/tool_pb2.pyi +220 -0
  22. sapiopycommons/ai/api/plan/tool/proto/tool_pb2_grpc.py +154 -0
  23. sapiopycommons/ai/api/session/proto/sapio_conn_info_pb2.py +39 -0
  24. sapiopycommons/ai/api/session/proto/sapio_conn_info_pb2.pyi +32 -0
  25. sapiopycommons/ai/api/session/proto/sapio_conn_info_pb2_grpc.py +24 -0
  26. sapiopycommons/ai/protobuf_utils.py +454 -0
  27. sapiopycommons/ai/tool_service_base.py +790 -0
  28. sapiopycommons/callbacks/callback_util.py +332 -665
  29. sapiopycommons/callbacks/field_builder.py +0 -2
  30. sapiopycommons/chem/IndigoMolecules.py +1 -29
  31. sapiopycommons/chem/Molecules.py +3 -3
  32. sapiopycommons/customreport/auto_pagers.py +1 -2
  33. sapiopycommons/customreport/term_builder.py +1 -1
  34. sapiopycommons/datatype/pseudo_data_types.py +326 -349
  35. sapiopycommons/eln/experiment_handler.py +719 -336
  36. sapiopycommons/eln/plate_designer.py +2 -7
  37. sapiopycommons/files/file_util.py +4 -4
  38. sapiopycommons/general/accession_service.py +2 -2
  39. sapiopycommons/general/aliases.py +1 -4
  40. sapiopycommons/processtracking/custom_workflow_handler.py +1 -2
  41. sapiopycommons/recordmodel/record_handler.py +317 -657
  42. sapiopycommons/rules/eln_rule_handler.py +1 -8
  43. sapiopycommons/rules/on_save_rule_handler.py +1 -8
  44. sapiopycommons/webhook/webhook_handlers.py +0 -3
  45. sapiopycommons/webhook/webservice_handlers.py +2 -2
  46. {sapiopycommons-2025.6.16a562.dist-info → sapiopycommons-2025.6.18a563.dist-info}/METADATA +2 -2
  47. sapiopycommons-2025.6.18a563.dist-info/RECORD +91 -0
  48. sapiopycommons/eln/experiment_cache.py +0 -188
  49. sapiopycommons/eln/experiment_step_factory.py +0 -476
  50. sapiopycommons/eln/step_creation.py +0 -236
  51. sapiopycommons/general/data_structure_util.py +0 -115
  52. sapiopycommons-2025.6.16a562.dist-info/RECORD +0 -68
  53. {sapiopycommons-2025.6.16a562.dist-info → sapiopycommons-2025.6.18a563.dist-info}/WHEEL +0 -0
  54. {sapiopycommons-2025.6.16a562.dist-info → sapiopycommons-2025.6.18a563.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.")
@@ -10,36 +10,9 @@ indigo.setOption("render-stereo-style", "ext")
10
10
  indigo.setOption("aromaticity-model", "generic")
11
11
  indigo.setOption("render-coloring", True)
12
12
  indigo.setOption("molfile-saving-mode", "3000")
13
- indigo.setOption("dearomatize-verification", False)
14
13
  indigo_inchi = IndigoInchi(indigo)
15
14
 
16
15
 
17
- def get_aromatic_dearomatic_forms(m: IndigoObject):
18
- """
19
- Get the aromatic and dearomatic forms of the molecule. Retain the original form if it's not inversible.
20
- Inversible: after aromatic-dearomatic-aromatic transformation, the molecule is the same as the first aromatic transformation.
21
- :param m: molecule from indigo.
22
- :return: pair of indigo objects, first is aromatic, second is dearomatic.
23
- """
24
- try:
25
- aromatic_reaction = m.clone()
26
- aromatic_reaction.aromatize()
27
- dearomatic_reaction = aromatic_reaction.clone()
28
- dearomatic_reaction.dearomatize()
29
- second_aromatic_reaction = dearomatic_reaction.clone()
30
- second_aromatic_reaction.aromatize()
31
- match = indigo.exactMatch(aromatic_reaction, second_aromatic_reaction)
32
- if match:
33
- return aromatic_reaction, dearomatic_reaction
34
- else:
35
- return m, dearomatic_reaction
36
- except (Exception):
37
- # If aromatization then following deromatization fails, we just skip it.
38
- dearomatic_reaction = m.clone()
39
- dearomatic_reaction.dearomatize()
40
- return m, dearomatic_reaction
41
-
42
-
43
16
  # Function to process dative bonds in a molecule
44
17
  # Returns True if at least one dative bond (_BOND_COORDINATION) was removed
45
18
  def remove_dative_bonds_in_mol(molecule: IndigoObject) -> bool:
@@ -78,8 +51,7 @@ def remove_dative_in_reaction(reaction: IndigoObject) -> bool:
78
51
  :param reaction: The reaction to remove dative bonds.
79
52
  :return: Whether there are any dative bonds in the reaction that were removed.
80
53
  """
81
- reactant_dative_removed: bool = any(
82
- remove_dative_bonds_in_mol(reactant) for reactant in reaction.iterateReactants())
54
+ reactant_dative_removed: bool = any(remove_dative_bonds_in_mol(reactant) for reactant in reaction.iterateReactants())
83
55
  product_dative_removed: bool = any(remove_dative_bonds_in_mol(product) for product in reaction.iterateProducts())
84
56
  return reactant_dative_removed or product_dative_removed
85
57
 
@@ -1,6 +1,6 @@
1
1
  # Author Yechen Qiao
2
2
  # Common Molecule Utilities for Molecule Transfers with Sapio
3
- from indigo import IndigoObject
3
+
4
4
  from rdkit import Chem
5
5
  from rdkit.Chem import Crippen, MolToInchi
6
6
  from rdkit.Chem import Descriptors
@@ -10,7 +10,7 @@ from rdkit.Chem.MolStandardize import rdMolStandardize
10
10
  from rdkit.Chem.SaltRemover import SaltRemover
11
11
  from rdkit.Chem.rdchem import Mol, RWMol, Bond
12
12
 
13
- from sapiopycommons.chem.IndigoMolecules import indigo, renderer, indigo_inchi, get_aromatic_dearomatic_forms
13
+ from sapiopycommons.chem.IndigoMolecules import indigo, renderer, indigo_inchi
14
14
 
15
15
  metal_disconnector = rdMolStandardize.MetalDisconnector()
16
16
  tautomer_params = Chem.MolStandardize.rdMolStandardize.CleanupParameters()
@@ -247,7 +247,7 @@ def mol_to_sapio_substance(mol: Mol, include_stereoisomers=False,
247
247
  molecule["image"] = None
248
248
  # We need to test the INCHI can be loaded back to indigo.
249
249
  indigo_mol = indigo.loadMolecule(molBlock)
250
- indigo_mol = get_aromatic_dearomatic_forms(indigo_mol)[0] # Get the aromatic form of the molecule.
250
+ indigo_mol.aromatize()
251
251
  if enhanced_stereo:
252
252
  # Remove enhanced stereo layer when generating InChI as the stereo hash is generated separately for reg.
253
253
  Chem.CanonicalizeEnhancedStereo(inchi_mol)
@@ -6,7 +6,6 @@ from sapiopylib.rest.CustomReportService import CustomReportManager
6
6
  from sapiopylib.rest.DataMgmtService import DataMgmtServer
7
7
  from sapiopylib.rest.pojo.CustomReport import CustomReportCriteria, CustomReport, RawReportTerm, ReportColumn
8
8
  from sapiopylib.rest.pojo.datatype.FieldDefinition import FieldType
9
- # noinspection PyProtectedMember
10
9
  from sapiopylib.rest.utils.autopaging import SapioPyAutoPager, PagerResultCriteriaType, _default_report_page_size, \
11
10
  _default_record_page_size
12
11
  from sapiopylib.rest.utils.recordmodel.PyRecordModel import PyRecordModel
@@ -154,7 +153,7 @@ class _RecordReportPagerBase(SapioPyAutoPager[CustomReportCriteria, WrappedType
154
153
  if id_index == -1:
155
154
  raise SapioException(f"This report does not contain a Record ID column for the given record model type "
156
155
  f"{self._data_type}.")
157
- ids: set[int] = {row[id_index] for row in report.result_table}
156
+ ids: list[int] = [row[id_index] for row in report.result_table]
158
157
  for row in self._rec_handler.query_models_by_id(self._query_type, ids, page_size=report.page_size):
159
158
  queue.put(row)
160
159
  if report.has_next_page:
@@ -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 XNOR operation).
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),