sapiopycommons 2024.12.5a376__tar.gz → 2024.12.9a378__tar.gz

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 (77) hide show
  1. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/PKG-INFO +1 -1
  2. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/pyproject.toml +1 -1
  3. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/customreport/custom_report_builder.py +7 -0
  4. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/customreport/term_builder.py +44 -28
  5. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/eln/experiment_report_util.py +85 -89
  6. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/audit_log.py +3 -6
  7. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/processtracking/custom_workflow_handler.py +35 -35
  8. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/.gitignore +0 -0
  9. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/LICENSE +0 -0
  10. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/README.md +0 -0
  11. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/__init__.py +0 -0
  12. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/callbacks/__init__.py +0 -0
  13. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/callbacks/callback_util.py +0 -0
  14. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/callbacks/field_builder.py +0 -0
  15. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/chem/IndigoMolecules.py +0 -0
  16. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/chem/Molecules.py +0 -0
  17. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/chem/__init__.py +0 -0
  18. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/customreport/__init__.py +0 -0
  19. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/customreport/column_builder.py +0 -0
  20. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/datatype/__init__.py +0 -0
  21. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/datatype/attachment_util.py +0 -0
  22. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/datatype/data_fields.py +0 -0
  23. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/datatype/pseudo_data_types.py +0 -0
  24. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/eln/__init__.py +0 -0
  25. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/eln/experiment_handler.py +0 -0
  26. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/eln/plate_designer.py +0 -0
  27. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/__init__.py +0 -0
  28. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/complex_data_loader.py +0 -0
  29. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_bridge.py +0 -0
  30. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_bridge_handler.py +0 -0
  31. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_data_handler.py +0 -0
  32. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_util.py +0 -0
  33. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_validator.py +0 -0
  34. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/files/file_writer.py +0 -0
  35. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/flowcyto/flow_cyto.py +0 -0
  36. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/flowcyto/flowcyto_data.py +0 -0
  37. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/__init__.py +0 -0
  38. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/accession_service.py +0 -0
  39. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/aliases.py +0 -0
  40. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/custom_report_util.py +0 -0
  41. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/exceptions.py +0 -0
  42. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/popup_util.py +0 -0
  43. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/sapio_links.py +0 -0
  44. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/storage_util.py +0 -0
  45. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/general/time_util.py +0 -0
  46. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/multimodal/multimodal.py +0 -0
  47. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/multimodal/multimodal_data.py +0 -0
  48. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/processtracking/__init__.py +0 -0
  49. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/processtracking/endpoints.py +0 -0
  50. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/recordmodel/__init__.py +0 -0
  51. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/recordmodel/record_handler.py +0 -0
  52. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/rules/__init__.py +0 -0
  53. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/rules/eln_rule_handler.py +0 -0
  54. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/rules/on_save_rule_handler.py +0 -0
  55. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/sftpconnect/__init__.py +0 -0
  56. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/sftpconnect/sftp_builder.py +0 -0
  57. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/webhook/__init__.py +0 -0
  58. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/webhook/webhook_context.py +0 -0
  59. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/webhook/webhook_handlers.py +0 -0
  60. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/src/sapiopycommons/webhook/webservice_handlers.py +0 -0
  61. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/AF-A0A009IHW8-F1-model_v4.cif +0 -0
  62. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/_do_not_add_init_py_here +0 -0
  63. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/accession_test.py +0 -0
  64. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/bio_reg_test.py +0 -0
  65. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/chem_test.py +0 -0
  66. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/chem_test_curation_queue.py +0 -0
  67. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/curation_queue_test.sdf +0 -0
  68. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/data_type_models.py +0 -0
  69. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto/101_DEN084Y5_15_E01_008_clean.fcs +0 -0
  70. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto/101_DEN084Y5_15_E03_009_clean.fcs +0 -0
  71. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto/101_DEN084Y5_15_E05_010_clean.fcs +0 -0
  72. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto/8_color_ICS.wsp +0 -0
  73. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto/COVID19_W_001_O.fcs +0 -0
  74. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/flowcyto_test.py +0 -0
  75. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/kappa.chains.fasta +0 -0
  76. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/mafft_test.py +0 -0
  77. {sapiopycommons-2024.12.5a376 → sapiopycommons-2024.12.9a378}/tests/test.gb +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sapiopycommons
3
- Version: 2024.12.5a376
3
+ Version: 2024.12.9a378
4
4
  Summary: Official Sapio Python API Utilities Package
5
5
  Project-URL: Homepage, https://github.com/sapiosciences
6
6
  Author-email: Jonathan Steck <jsteck@sapiosciences.com>, Yechen Qiao <yqiao@sapiosciences.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sapiopycommons"
7
- version='2024.12.05a376'
7
+ version='2024.12.09a378'
8
8
  authors = [
9
9
  { name="Jonathan Steck", email="jsteck@sapiosciences.com" },
10
10
  { name="Yechen Qiao", email="yqiao@sapiosciences.com" },
@@ -3,6 +3,7 @@ from sapiopylib.rest.pojo.CustomReport import ReportColumn, CustomReportCriteria
3
3
  from sapiopylib.rest.pojo.datatype.FieldDefinition import FieldType
4
4
 
5
5
  from sapiopycommons.customreport.column_builder import ColumnBuilder
6
+ from sapiopycommons.customreport.term_builder import TermBuilder
6
7
  from sapiopycommons.general.aliases import DataTypeIdentifier, FieldIdentifier, AliasUtil, SapioRecord
7
8
  from sapiopycommons.general.exceptions import SapioException
8
9
 
@@ -31,6 +32,12 @@ class CustomReportBuilder:
31
32
  self.column_list = []
32
33
  self.join_list = []
33
34
 
35
+ def get_term_builder(self) -> TermBuilder:
36
+ """
37
+ :return: A TermBuilder with a data type matching this report builder's root data type.
38
+ """
39
+ return TermBuilder(self.root_data_type)
40
+
34
41
  def has_root_term(self) -> bool:
35
42
  """
36
43
  :return: Whether this report builder has had its root term set.
@@ -25,103 +25,119 @@ class TermBuilder:
25
25
  """
26
26
  A class that allows for the easier constructions of custom report terms.
27
27
  """
28
- @staticmethod
29
- def all_records_term(data_type: DataTypeIdentifier) -> RawReportTerm:
28
+ data_type: str
29
+
30
+ def __init__(self, data_type: DataTypeIdentifier):
31
+ """
32
+ :param data_type: An object that can be used to identify a data type name. Used as the default data type name
33
+ of the terms created from this TermBuilder.
34
+ """
35
+ self.data_type = AliasUtil.to_data_type_name(data_type)
36
+
37
+ def all_records_term(self, *, data_type: DataTypeIdentifier | None = None) -> RawReportTerm:
30
38
  """
31
39
  Create a raw report term that captures all records of the given data type.
32
40
 
33
- :param data_type: The data type of this term.
41
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
42
+ builder was instantiated with is used.
34
43
  :return: A raw report term for "data_type.RecordId >= 0".
35
44
  """
36
- return RawReportTerm(AliasUtil.to_data_type_name(data_type), "RecordId", GTE, TermBuilder.to_term_val(0))
45
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
46
+ return RawReportTerm(data_type, "RecordId", GTE, TermBuilder.to_term_val(0))
37
47
 
38
- @staticmethod
39
- def is_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
40
- *, trim: bool = False) -> RawReportTerm:
48
+ def is_term(self, field: FieldIdentifier, value: TermValue,
49
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
41
50
  """
42
51
  Create a raw report term for comparing a field value with an equals operation.
43
52
 
44
- :param data_type: The data type of this term.
45
53
  :param field: The data field of this term.
46
54
  :param value: The value to compare for this term.
55
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
56
+ builder was instantiated with is used.
47
57
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
48
58
  :return: A raw report term for "data_type.field = value".
49
59
  """
60
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
50
61
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), EQ,
51
62
  TermBuilder.to_term_val(value), trim)
52
63
 
53
- @staticmethod
54
- def not_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
55
- *, trim: bool = False) -> RawReportTerm:
64
+ def not_term(self, field: FieldIdentifier, value: TermValue,
65
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
56
66
  """
57
67
  Create a raw report term for comparing a field value with a not equals operation.
58
68
 
59
- :param data_type: The data type of this term.
60
69
  :param field: The data field of this term.
61
70
  :param value: The value to compare for this term.
71
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
72
+ builder was instantiated with is used.
62
73
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
63
74
  :return: A raw report term for "data_type.field != value".
64
75
  """
76
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
65
77
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), NEQ,
66
78
  TermBuilder.to_term_val(value), trim)
67
79
 
68
- @staticmethod
69
- def lt_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
70
- *, trim: bool = False) -> RawReportTerm:
80
+ def lt_term(self, field: FieldIdentifier, value: TermValue,
81
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
71
82
  """
72
83
  Create a raw report term for comparing a field value with a less than operation.
73
84
 
74
- :param data_type: The data type of this term.
75
85
  :param field: The data field of this term.
76
86
  :param value: The value to compare for this term.
87
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
88
+ builder was instantiated with is used.
77
89
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
78
90
  :return: A raw report term for "data_type.field < value".
79
91
  """
92
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
80
93
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), LT,
81
94
  TermBuilder.to_term_val(value), trim)
82
95
 
83
- @staticmethod
84
- def lte_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
85
- *, trim: bool = False) -> RawReportTerm:
96
+ def lte_term(self, field: FieldIdentifier, value: TermValue,
97
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
86
98
  """
87
99
  Create a raw report term for comparing a field value with a less than or equal to operation.
88
100
 
89
- :param data_type: The data type of this term.
90
101
  :param field: The data field of this term.
91
102
  :param value: The value to compare for this term.
103
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
104
+ builder was instantiated with is used.
92
105
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
93
106
  :return: A raw report term for "data_type.field <= value".
94
107
  """
108
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
95
109
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), LTE,
96
110
  TermBuilder.to_term_val(value), trim)
97
111
 
98
- @staticmethod
99
- def gt_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
100
- *, trim: bool = False) -> RawReportTerm:
112
+ def gt_term(self, field: FieldIdentifier, value: TermValue,
113
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
101
114
  """
102
115
  Create a raw report term for comparing a field value with a greater than operation.
103
116
 
104
- :param data_type: The data type of this term.
105
117
  :param field: The data field of this term.
106
118
  :param value: The value to compare for this term.
119
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
120
+ builder was instantiated with is used.
107
121
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
108
122
  :return: A raw report term for "data_type.field > value".
109
123
  """
124
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
110
125
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), GT,
111
126
  TermBuilder.to_term_val(value), trim)
112
127
 
113
- @staticmethod
114
- def gte_term(data_type: DataTypeIdentifier, field: FieldIdentifier, value: TermValue,
115
- *, trim: bool = False) -> RawReportTerm:
128
+ def gte_term(self, field: FieldIdentifier, value: TermValue,
129
+ *, data_type: DataTypeIdentifier | None = None, trim: bool = False) -> RawReportTerm:
116
130
  """
117
131
  Create a raw report term for comparing a field value with a greater than or equal to operation.
118
132
 
119
- :param data_type: The data type of this term.
120
133
  :param field: The data field of this term.
121
134
  :param value: The value to compare for this term.
135
+ :param data_type: If provided, the data type of this term. If not provided, then the data type that this term
136
+ builder was instantiated with is used.
122
137
  :param trim: Whether the string of the given value should be trimmed of trailing and leading whitespace.
123
138
  :return: A raw report term for "data_type.field >= value".
124
139
  """
140
+ data_type: str = AliasUtil.to_data_type_name(data_type) if data_type else self.data_type
125
141
  return RawReportTerm(AliasUtil.to_data_type_name(data_type), AliasUtil.to_data_field_name(field), GTE,
126
142
  TermBuilder.to_term_val(value), trim)
127
143
 
@@ -194,11 +194,10 @@ class ExperimentReportUtil:
194
194
  dt_to_record.setdefault(AliasUtil.to_data_type_name(record, False), []).append(record)
195
195
 
196
196
  report_builder = CustomReportBuilder(EnbEntryPseudoDef.DATA_TYPE_NAME)
197
+ tb = report_builder.get_term_builder()
197
198
  report_builder.add_column(EnbEntryPseudoDef.DATA_TYPE_NAME__FIELD_NAME)
198
199
  report_builder.add_column(EnbEntryPseudoDef.EXPERIMENT_ID__FIELD_NAME)
199
- report_builder.set_root_term(TermBuilder.is_term(EnbEntryPseudoDef.DATA_TYPE_NAME,
200
- EnbEntryPseudoDef.DATA_TYPE_NAME__FIELD_NAME,
201
- data_types))
200
+ report_builder.set_root_term(tb.is_term(EnbEntryPseudoDef.DATA_TYPE_NAME__FIELD_NAME, data_types))
202
201
  criteria = report_builder.build_report_criteria()
203
202
 
204
203
  ret_val: dict[SapioRecord, int] = {}
@@ -259,9 +258,8 @@ class ExperimentReportUtil:
259
258
  exp_ids: list[int] = AliasUtil.to_notebook_ids(experiments)
260
259
 
261
260
  report_builder = CustomReportBuilder(NotebookExperimentOptionPseudoDef.DATA_TYPE_NAME)
262
- root = TermBuilder.is_term(NotebookExperimentOptionPseudoDef.DATA_TYPE_NAME,
263
- NotebookExperimentOptionPseudoDef.EXPERIMENT_ID__FIELD_NAME,
264
- exp_ids)
261
+ tb = report_builder.get_term_builder()
262
+ root = tb.is_term(NotebookExperimentOptionPseudoDef.EXPERIMENT_ID__FIELD_NAME, exp_ids)
265
263
  report_builder.set_root_term(root)
266
264
  report_builder.add_column(NotebookExperimentOptionPseudoDef.EXPERIMENT_ID__FIELD_NAME)
267
265
  report_builder.add_column(NotebookExperimentOptionPseudoDef.OPTION_KEY__FIELD_NAME)
@@ -291,9 +289,8 @@ class ExperimentReportUtil:
291
289
  """
292
290
  entries: list[int] = AliasUtil.to_entry_ids(entries)
293
291
  report_builder = CustomReportBuilder(EnbEntryOptionsPseudoDef.DATA_TYPE_NAME)
294
- root = TermBuilder.is_term(EnbEntryOptionsPseudoDef.DATA_TYPE_NAME,
295
- EnbEntryOptionsPseudoDef.ENTRY_ID__FIELD_NAME,
296
- entries)
292
+ tb = report_builder.get_term_builder()
293
+ root = tb.is_term(EnbEntryOptionsPseudoDef.ENTRY_ID__FIELD_NAME, entries)
297
294
  report_builder.set_root_term(root)
298
295
  report_builder.add_column(EnbEntryOptionsPseudoDef.ENTRY_ID__FIELD_NAME)
299
296
  report_builder.add_column(EnbEntryOptionsPseudoDef.ENTRY_OPTION_KEY__FIELD_NAME)
@@ -323,13 +320,12 @@ class ExperimentReportUtil:
323
320
  exp_ids: list[int] = AliasUtil.to_notebook_ids(experiments)
324
321
 
325
322
  report_builder = CustomReportBuilder(NotebookExperimentPseudoDef.DATA_TYPE_NAME)
326
- root = TermBuilder.is_term(NotebookExperimentPseudoDef.DATA_TYPE_NAME,
327
- NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
328
- exp_ids)
329
- report_builder.add_join(TermBuilder.compare_is_term("ELNExperiment",
330
- "RecordId",
331
- NotebookExperimentPseudoDef.DATA_TYPE_NAME,
332
- NotebookExperimentPseudoDef.EXPERIMENT_RECORD_ID__FIELD_NAME))
323
+ tb = report_builder.get_term_builder()
324
+ root = tb.is_term(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, exp_ids)
325
+ report_builder.add_join(tb.compare_is_term("ELNExperiment",
326
+ "RecordId",
327
+ NotebookExperimentPseudoDef.DATA_TYPE_NAME,
328
+ NotebookExperimentPseudoDef.EXPERIMENT_RECORD_ID__FIELD_NAME))
333
329
  report_builder.set_root_term(root)
334
330
  report_builder.add_column(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME)
335
331
  report_builder.add_column("TemplateExperimentName", FieldType.STRING, data_type="ELNExperiment")
@@ -474,100 +470,101 @@ class ExperimentReportUtil:
474
470
  """
475
471
  dt: str = NotebookExperimentPseudoDef.DATA_TYPE_NAME
476
472
  report_builder = CustomReportBuilder(dt)
473
+ tb = report_builder.get_term_builder()
477
474
  report_builder.add_column(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME)
478
475
 
479
476
  root: AbstractReportTerm | None = None
480
477
  if criteria.notebook_ids is not None:
481
- root = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, criteria.notebook_ids)
478
+ root = tb.is_term(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, criteria.notebook_ids)
482
479
  if criteria.not_notebook_ids is not None:
483
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, criteria.not_notebook_ids)
480
+ term = tb.not_term(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, criteria.not_notebook_ids)
484
481
  if root is not None:
485
- root = TermBuilder.and_terms(root, term)
482
+ root = tb.and_terms(root, term)
486
483
  if root is None:
487
484
  root = ExperimentReportUtil.all_notebook_experiments_term()
488
485
 
489
486
  if criteria.names is not None:
490
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_NAME__FIELD_NAME, criteria.names)
491
- root = TermBuilder.and_terms(root, term)
487
+ term = tb.is_term(NotebookExperimentPseudoDef.EXPERIMENT_NAME__FIELD_NAME, criteria.names)
488
+ root = tb.and_terms(root, term)
492
489
  if criteria.not_names is not None:
493
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_NAME__FIELD_NAME, criteria.not_names)
494
- root = TermBuilder.and_terms(root, term)
490
+ term = tb.not_term(NotebookExperimentPseudoDef.EXPERIMENT_NAME__FIELD_NAME, criteria.not_names)
491
+ root = tb.and_terms(root, term)
495
492
 
496
493
  if criteria.created_by is not None:
497
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.CREATED_BY__FIELD_NAME, criteria.created_by)
498
- root = TermBuilder.and_terms(root, term)
494
+ term = tb.is_term(NotebookExperimentPseudoDef.CREATED_BY__FIELD_NAME, criteria.created_by)
495
+ root = tb.and_terms(root, term)
499
496
  if criteria.not_created_by is not None:
500
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.CREATED_BY__FIELD_NAME, criteria.not_created_by)
501
- root = TermBuilder.and_terms(root, term)
497
+ term = tb.not_term(NotebookExperimentPseudoDef.CREATED_BY__FIELD_NAME, criteria.not_created_by)
498
+ root = tb.and_terms(root, term)
502
499
 
503
500
  if criteria.last_modified_by is not None:
504
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.LAST_MODIFIED_BY__FIELD_NAME, criteria.last_modified_by)
505
- root = TermBuilder.and_terms(root, term)
501
+ term = tb.is_term(NotebookExperimentPseudoDef.LAST_MODIFIED_BY__FIELD_NAME, criteria.last_modified_by)
502
+ root = tb.and_terms(root, term)
506
503
  if criteria.not_last_modified_by is not None:
507
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.LAST_MODIFIED_BY__FIELD_NAME, criteria.not_last_modified_by)
508
- root = TermBuilder.and_terms(root, term)
504
+ term = tb.not_term(NotebookExperimentPseudoDef.LAST_MODIFIED_BY__FIELD_NAME, criteria.not_last_modified_by)
505
+ root = tb.and_terms(root, term)
509
506
 
510
507
  if criteria.owners is not None:
511
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_OWNER__FIELD_NAME, criteria.owners)
512
- root = TermBuilder.and_terms(root, term)
508
+ term = tb.is_term(NotebookExperimentPseudoDef.EXPERIMENT_OWNER__FIELD_NAME, criteria.owners)
509
+ root = tb.and_terms(root, term)
513
510
  if criteria.not_owners is not None:
514
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.EXPERIMENT_OWNER__FIELD_NAME, criteria.not_owners)
515
- root = TermBuilder.and_terms(root, term)
511
+ term = tb.not_term(NotebookExperimentPseudoDef.EXPERIMENT_OWNER__FIELD_NAME, criteria.not_owners)
512
+ root = tb.and_terms(root, term)
516
513
 
517
514
  if criteria.statuses is not None:
518
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.STATUS__FIELD_NAME, criteria.statuses)
519
- root = TermBuilder.and_terms(root, term)
515
+ term = tb.is_term(NotebookExperimentPseudoDef.STATUS__FIELD_NAME, criteria.statuses)
516
+ root = tb.and_terms(root, term)
520
517
  if criteria.not_statuses is not None:
521
- term = TermBuilder.not_term(dt, NotebookExperimentPseudoDef.STATUS__FIELD_NAME, criteria.not_statuses)
522
- root = TermBuilder.and_terms(root, term)
518
+ term = tb.not_term(NotebookExperimentPseudoDef.STATUS__FIELD_NAME, criteria.not_statuses)
519
+ root = tb.and_terms(root, term)
523
520
 
524
521
  # For the template name term, we need to join on the experiment record.
525
522
  if criteria.templates is not None or criteria.not_templates is not None:
526
- join = TermBuilder.compare_is_term("ELNExperiment",
527
- "RecordId",
528
- NotebookExperimentPseudoDef.DATA_TYPE_NAME,
529
- NotebookExperimentPseudoDef.EXPERIMENT_RECORD_ID__FIELD_NAME)
523
+ join = tb.compare_is_term("ELNExperiment",
524
+ "RecordId",
525
+ NotebookExperimentPseudoDef.DATA_TYPE_NAME,
526
+ NotebookExperimentPseudoDef.EXPERIMENT_RECORD_ID__FIELD_NAME)
530
527
  report_builder.add_join(join)
531
528
  if criteria.templates is not None:
532
- term = TermBuilder.is_term("ELNExperiment", "TemplateExperimentName", criteria.templates)
533
- root = TermBuilder.and_terms(root, term)
529
+ term = tb.is_term("TemplateExperimentName", criteria.templates, data_type="ELNExperiment")
530
+ root = tb.and_terms(root, term)
534
531
  if criteria.not_templates is not None:
535
- term = TermBuilder.not_term("ELNExperiment", "TemplateExperimentName", criteria.not_templates)
536
- root = TermBuilder.and_terms(root, term)
532
+ term = tb.not_term("TemplateExperimentName", criteria.not_templates, data_type="ELNExperiment")
533
+ root = tb.and_terms(root, term)
537
534
 
538
535
  if criteria.is_from_template is not None:
539
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.IS_TEMPLATE__FIELD_NAME, criteria.is_from_template)
540
- root = TermBuilder.and_terms(root, term)
536
+ term = tb.is_term(NotebookExperimentPseudoDef.IS_TEMPLATE__FIELD_NAME, criteria.is_from_template)
537
+ root = tb.and_terms(root, term)
541
538
  if criteria.is_from_protocol_template is not None:
542
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.IS_PROTOCOL_TEMPLATE__FIELD_NAME, criteria.is_from_protocol_template)
543
- root = TermBuilder.and_terms(root, term)
539
+ term = tb.is_term(NotebookExperimentPseudoDef.IS_PROTOCOL_TEMPLATE__FIELD_NAME, criteria.is_from_protocol_template)
540
+ root = tb.and_terms(root, term)
544
541
  if criteria.is_modifiable is not None:
545
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.IS_MODIFIABLE__FIELD_NAME, criteria.is_modifiable)
546
- root = TermBuilder.and_terms(root, term)
542
+ term = tb.is_term(NotebookExperimentPseudoDef.IS_MODIFIABLE__FIELD_NAME, criteria.is_modifiable)
543
+ root = tb.and_terms(root, term)
547
544
  if criteria.is_active is not None:
548
- term = TermBuilder.is_term(dt, NotebookExperimentPseudoDef.IS_ACTIVE__FIELD_NAME, criteria.is_active)
549
- root = TermBuilder.and_terms(root, term)
545
+ term = tb.is_term(NotebookExperimentPseudoDef.IS_ACTIVE__FIELD_NAME, criteria.is_active)
546
+ root = tb.and_terms(root, term)
550
547
 
551
548
  if criteria.created_after is not None:
552
- term = TermBuilder.gte_term(dt, NotebookExperimentPseudoDef.DATE_CREATED__FIELD_NAME, criteria.created_after)
553
- root = TermBuilder.and_terms(root, term)
549
+ term = tb.gte_term(NotebookExperimentPseudoDef.DATE_CREATED__FIELD_NAME, criteria.created_after)
550
+ root = tb.and_terms(root, term)
554
551
  if criteria.created_before is not None:
555
- term = TermBuilder.lte_term(dt, NotebookExperimentPseudoDef.DATE_CREATED__FIELD_NAME, criteria.created_before)
556
- root = TermBuilder.and_terms(root, term)
552
+ term = tb.lte_term(NotebookExperimentPseudoDef.DATE_CREATED__FIELD_NAME, criteria.created_before)
553
+ root = tb.and_terms(root, term)
557
554
 
558
555
  if criteria.last_modified_after is not None:
559
- term = TermBuilder.gte_term(dt, NotebookExperimentPseudoDef.LAST_MODIFIED_DATE__FIELD_NAME, criteria.last_modified_after)
560
- root = TermBuilder.and_terms(root, term)
556
+ term = tb.gte_term(NotebookExperimentPseudoDef.LAST_MODIFIED_DATE__FIELD_NAME, criteria.last_modified_after)
557
+ root = tb.and_terms(root, term)
561
558
  if criteria.last_modified_before is not None:
562
- term = TermBuilder.lte_term(dt, NotebookExperimentPseudoDef.LAST_MODIFIED_DATE__FIELD_NAME, criteria.last_modified_before)
563
- root = TermBuilder.and_terms(root, term)
559
+ term = tb.lte_term(NotebookExperimentPseudoDef.LAST_MODIFIED_DATE__FIELD_NAME, criteria.last_modified_before)
560
+ root = tb.and_terms(root, term)
564
561
 
565
562
  if criteria.due_after is not None:
566
- term = TermBuilder.gte_term(dt, NotebookExperimentPseudoDef.APPROVAL_DUE_DATE__FIELD_NAME, criteria.due_after)
567
- root = TermBuilder.and_terms(root, term)
563
+ term = tb.gte_term(NotebookExperimentPseudoDef.APPROVAL_DUE_DATE__FIELD_NAME, criteria.due_after)
564
+ root = tb.and_terms(root, term)
568
565
  if criteria.due_before is not None:
569
- term = TermBuilder.lte_term(dt, NotebookExperimentPseudoDef.APPROVAL_DUE_DATE__FIELD_NAME, criteria.due_before)
570
- root = TermBuilder.and_terms(root, term)
566
+ term = tb.lte_term(NotebookExperimentPseudoDef.APPROVAL_DUE_DATE__FIELD_NAME, criteria.due_before)
567
+ root = tb.and_terms(root, term)
571
568
 
572
569
  report_builder.set_root_term(root)
573
570
  return report_builder.build_report_criteria()
@@ -597,9 +594,8 @@ class ExperimentReportUtil:
597
594
  """
598
595
  :return: A report term searching for all notebook experiments.
599
596
  """
600
- return TermBuilder.gte_term(NotebookExperimentPseudoDef.DATA_TYPE_NAME,
601
- NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
602
- 0)
597
+ tb = TermBuilder(NotebookExperimentPseudoDef.DATA_TYPE_NAME)
598
+ return tb.gte_term(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, 0)
603
599
 
604
600
  @staticmethod
605
601
  def __get_record_experiment_relation_rows(user: SapioUser, data_type_name: str, record_ids: list[int] | None = None,
@@ -610,39 +606,39 @@ class ExperimentReportUtil:
610
606
  """
611
607
  assert (record_ids or exp_ids)
612
608
 
609
+ report_builder = CustomReportBuilder(data_type_name)
610
+ tb = report_builder.get_term_builder()
613
611
  if record_ids:
614
- records_term = TermBuilder.is_term(data_type_name, "RecordId", record_ids)
612
+ records_term = tb.is_term("RecordId", record_ids)
615
613
  else:
616
614
  # Get all records of the given type
617
- records_term = TermBuilder.all_records_term(data_type_name)
615
+ records_term = tb.all_records_term()
618
616
 
619
617
  if exp_ids:
620
- exp_term = TermBuilder.is_term(NotebookExperimentPseudoDef.DATA_TYPE_NAME,
621
- NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
622
- exp_ids)
618
+ exp_term = tb.is_term(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME, exp_ids,
619
+ data_type=NotebookExperimentPseudoDef.DATA_TYPE_NAME)
623
620
  else:
624
621
  # Get all experiments
625
622
  exp_term = ExperimentReportUtil.all_notebook_experiments_term()
626
623
 
627
- root_term = TermBuilder.and_terms(records_term, exp_term)
624
+ root_term = tb.and_terms(records_term, exp_term)
628
625
 
629
626
  # Join records on the experiment entry records that correspond to them.
630
- records_entry_join = TermBuilder.compare_is_term(data_type_name,
631
- "RecordId",
632
- ExperimentEntryRecordPseudoDef.DATA_TYPE_NAME,
633
- ExperimentEntryRecordPseudoDef.RECORD_ID__FIELD_NAME)
627
+ records_entry_join = tb.compare_is_term(data_type_name,
628
+ "RecordId",
629
+ ExperimentEntryRecordPseudoDef.DATA_TYPE_NAME,
630
+ ExperimentEntryRecordPseudoDef.RECORD_ID__FIELD_NAME)
634
631
  # Join entry records on the experiment entries they are in.
635
- experiment_entry_enb_entry_join = TermBuilder.compare_is_term(EnbEntryPseudoDef.DATA_TYPE_NAME,
636
- EnbEntryPseudoDef.ENTRY_ID__FIELD_NAME,
637
- ExperimentEntryRecordPseudoDef.DATA_TYPE_NAME,
638
- ExperimentEntryRecordPseudoDef.ENTRY_ID__FIELD_NAME)
632
+ experiment_entry_enb_entry_join = tb.compare_is_term(EnbEntryPseudoDef.DATA_TYPE_NAME,
633
+ EnbEntryPseudoDef.ENTRY_ID__FIELD_NAME,
634
+ ExperimentEntryRecordPseudoDef.DATA_TYPE_NAME,
635
+ ExperimentEntryRecordPseudoDef.ENTRY_ID__FIELD_NAME)
639
636
  # Join entries on the experiments they are in.
640
- enb_entry_experiment_join = TermBuilder.compare_is_term(NotebookExperimentPseudoDef.DATA_TYPE_NAME,
641
- NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
642
- EnbEntryPseudoDef.DATA_TYPE_NAME,
643
- EnbEntryPseudoDef.EXPERIMENT_ID__FIELD_NAME)
637
+ enb_entry_experiment_join = tb.compare_is_term(NotebookExperimentPseudoDef.DATA_TYPE_NAME,
638
+ NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
639
+ EnbEntryPseudoDef.DATA_TYPE_NAME,
640
+ EnbEntryPseudoDef.EXPERIMENT_ID__FIELD_NAME)
644
641
 
645
- report_builder = CustomReportBuilder(data_type_name)
646
642
  report_builder.set_root_term(root_term)
647
643
  report_builder.add_column("RecordId", FieldType.LONG)
648
644
  report_builder.add_column(NotebookExperimentPseudoDef.EXPERIMENT_ID__FIELD_NAME,
@@ -137,16 +137,13 @@ class AuditLogUtil:
137
137
  # Build the raw report term querying for any entry with a matching record ID value to the record ID's
138
138
  # passed in.
139
139
  record_ids = AliasUtil.to_record_ids(records)
140
- root_term = TermBuilder.is_term(AuditLogPseudoDef.DATA_TYPE_NAME,
141
- AuditLogPseudoDef.RECORD_ID__FIELD_NAME,
142
- record_ids)
140
+ tb = TermBuilder(AuditLogPseudoDef.DATA_TYPE_NAME)
141
+ root_term = tb.is_term(AuditLogPseudoDef.RECORD_ID__FIELD_NAME, record_ids)
143
142
 
144
143
  # If the user passed in any specific fields, then we should limit the query to those fields.
145
144
  if fields:
146
145
  fields: list[str] = AliasUtil.to_data_field_names(fields)
147
- field_term = TermBuilder.is_term(AuditLogPseudoDef.DATA_TYPE_NAME,
148
- AuditLogPseudoDef.DATA_FIELD_NAME__FIELD_NAME,
149
- fields)
146
+ field_term = tb.is_term(AuditLogPseudoDef.DATA_FIELD_NAME__FIELD_NAME, fields)
150
147
  root_term = TermBuilder.and_terms(root_term, field_term)
151
148
 
152
149
  return CustomReportCriteria(AuditLogUtil.report_columns(), root_term)
@@ -6,7 +6,6 @@ from sapiopylib.rest.pojo.webhook.WebhookContext import SapioWebhookContext
6
6
  from sapiopylib.rest.utils.recordmodel.RecordModelWrapper import WrappedType
7
7
 
8
8
  from sapiopycommons.customreport.custom_report_builder import CustomReportBuilder
9
- from sapiopycommons.customreport.term_builder import TermBuilder
10
9
  from sapiopycommons.datatype.data_fields import ProcessQueueItemFields, SystemFields, ProcessWorkflowTrackingFields
11
10
  from sapiopycommons.general.aliases import UserIdentifier, AliasUtil, SapioRecord
12
11
  from sapiopycommons.general.custom_report_util import CustomReportUtil
@@ -338,69 +337,70 @@ class QueueItemHandler:
338
337
  """
339
338
  dt: str = ProcessQueueItemFields.DATA_TYPE_NAME
340
339
  report_builder = CustomReportBuilder(dt)
340
+ tb = report_builder.get_term_builder()
341
341
  report_builder.add_column(SystemFields.RECORD_ID__FIELD)
342
342
  report_builder.add_column(ProcessQueueItemFields.DATA_RECORD_ID__FIELD)
343
343
 
344
- root = TermBuilder.all_records_term(dt)
344
+ root = tb.all_records_term()
345
345
 
346
346
  if criteria.process_names is not None:
347
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.PROCESS_HEADER_NAME__FIELD, criteria.process_names)
348
- root = TermBuilder.and_terms(root, term)
347
+ term = tb.is_term(ProcessQueueItemFields.PROCESS_HEADER_NAME__FIELD, criteria.process_names)
348
+ root = tb.and_terms(root, term)
349
349
  if criteria.not_process_names is not None:
350
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.PROCESS_HEADER_NAME__FIELD, criteria.not_process_names)
351
- root = TermBuilder.and_terms(root, term)
350
+ term = tb.not_term(ProcessQueueItemFields.PROCESS_HEADER_NAME__FIELD, criteria.not_process_names)
351
+ root = tb.and_terms(root, term)
352
352
 
353
353
  if criteria.step_names is not None:
354
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.WORKFLOW_HEADER_NAME__FIELD, criteria.step_names)
355
- root = TermBuilder.and_terms(root, term)
354
+ term = tb.is_term(ProcessQueueItemFields.WORKFLOW_HEADER_NAME__FIELD, criteria.step_names)
355
+ root = tb.and_terms(root, term)
356
356
  if criteria.not_step_names is not None:
357
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.WORKFLOW_HEADER_NAME__FIELD, criteria.not_step_names)
358
- root = TermBuilder.and_terms(root, term)
357
+ term = tb.not_term(ProcessQueueItemFields.WORKFLOW_HEADER_NAME__FIELD, criteria.not_step_names)
358
+ root = tb.and_terms(root, term)
359
359
 
360
360
  if criteria.data_type_names is not None:
361
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.DATA_TYPE_NAME__FIELD, criteria.data_type_names)
362
- root = TermBuilder.and_terms(root, term)
361
+ term = tb.is_term(ProcessQueueItemFields.DATA_TYPE_NAME__FIELD, criteria.data_type_names)
362
+ root = tb.and_terms(root, term)
363
363
  if criteria.not_data_type_names is not None:
364
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.DATA_TYPE_NAME__FIELD, criteria.not_data_type_names)
365
- root = TermBuilder.and_terms(root, term)
364
+ term = tb.not_term(ProcessQueueItemFields.DATA_TYPE_NAME__FIELD, criteria.not_data_type_names)
365
+ root = tb.and_terms(root, term)
366
366
 
367
367
  if criteria.data_record_ids is not None:
368
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.DATA_RECORD_ID__FIELD, criteria.data_record_ids)
369
- root = TermBuilder.and_terms(root, term)
368
+ term = tb.is_term(ProcessQueueItemFields.DATA_RECORD_ID__FIELD, criteria.data_record_ids)
369
+ root = tb.and_terms(root, term)
370
370
  if criteria.not_data_record_ids is not None:
371
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.DATA_RECORD_ID__FIELD, criteria.not_data_record_ids)
372
- root = TermBuilder.and_terms(root, term)
371
+ term = tb.not_term(ProcessQueueItemFields.DATA_RECORD_ID__FIELD, criteria.not_data_record_ids)
372
+ root = tb.and_terms(root, term)
373
373
 
374
374
  if criteria.assigned_to is not None:
375
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.ASSIGNED_TO__FIELD, criteria.assigned_to)
376
- root = TermBuilder.and_terms(root, term)
375
+ term = tb.is_term(ProcessQueueItemFields.ASSIGNED_TO__FIELD, criteria.assigned_to)
376
+ root = tb.and_terms(root, term)
377
377
  if criteria.not_assigned_to is not None:
378
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.ASSIGNED_TO__FIELD, criteria.not_assigned_to)
379
- root = TermBuilder.and_terms(root, term)
378
+ term = tb.not_term(ProcessQueueItemFields.ASSIGNED_TO__FIELD, criteria.not_assigned_to)
379
+ root = tb.and_terms(root, term)
380
380
 
381
381
  if criteria.launched_after is not None:
382
- term = TermBuilder.gte_term(dt, ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.launched_after)
383
- root = TermBuilder.and_terms(root, term)
382
+ term = tb.gte_term(ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.launched_after)
383
+ root = tb.and_terms(root, term)
384
384
  if criteria.launched_before is not None:
385
- term = TermBuilder.lte_term(dt, ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.launched_before)
386
- root = TermBuilder.and_terms(root, term)
385
+ term = tb.lte_term(ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.launched_before)
386
+ root = tb.and_terms(root, term)
387
387
 
388
388
  if criteria.scheduled_after is not None:
389
- term = TermBuilder.gte_term(dt, ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.scheduled_after)
390
- root = TermBuilder.and_terms(root, term)
389
+ term = tb.gte_term(ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.scheduled_after)
390
+ root = tb.and_terms(root, term)
391
391
  if criteria.scheduled_before is not None:
392
- term = TermBuilder.lte_term(dt, ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.scheduled_before)
393
- root = TermBuilder.and_terms(root, term)
392
+ term = tb.lte_term(ProcessQueueItemFields.LAUNCHED_DATE__FIELD, criteria.scheduled_before)
393
+ root = tb.and_terms(root, term)
394
394
 
395
395
  if criteria.shown_in_queue is not None:
396
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.SHOW_IN_QUEUE__FIELD, criteria.shown_in_queue)
397
- root = TermBuilder.and_terms(root, term)
396
+ term = tb.is_term(ProcessQueueItemFields.SHOW_IN_QUEUE__FIELD, criteria.shown_in_queue)
397
+ root = tb.and_terms(root, term)
398
398
  if criteria.has_experiment is not None:
399
399
  if criteria.has_experiment:
400
- term = TermBuilder.not_term(dt, ProcessQueueItemFields.EXPERIMENT__FIELD, None)
400
+ term = tb.not_term(ProcessQueueItemFields.EXPERIMENT__FIELD, None)
401
401
  else:
402
- term = TermBuilder.is_term(dt, ProcessQueueItemFields.EXPERIMENT__FIELD, None)
403
- root = TermBuilder.and_terms(root, term)
402
+ term = tb.is_term(ProcessQueueItemFields.EXPERIMENT__FIELD, None)
403
+ root = tb.and_terms(root, term)
404
404
 
405
405
  report_builder.set_root_term(root)
406
406
  return report_builder.build_report_criteria()