sapiopycommons 2025.2.6a419__py3-none-any.whl → 2025.2.6a420__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/elain/tool_of_tools.py +13 -4
- {sapiopycommons-2025.2.6a419.dist-info → sapiopycommons-2025.2.6a420.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.2.6a419.dist-info → sapiopycommons-2025.2.6a420.dist-info}/RECORD +5 -5
- {sapiopycommons-2025.2.6a419.dist-info → sapiopycommons-2025.2.6a420.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.2.6a419.dist-info → sapiopycommons-2025.2.6a420.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,7 +9,7 @@ from sapiopylib.rest.pojo.DataRecord import DataRecord
|
|
|
9
9
|
from sapiopylib.rest.pojo.chartdata.DashboardDefinition import GaugeChartDefinition
|
|
10
10
|
from sapiopylib.rest.pojo.chartdata.DashboardEnums import ChartGroupingType, ChartOperationType, ChartType
|
|
11
11
|
from sapiopylib.rest.pojo.chartdata.DashboardSeries import GaugeChartSeries
|
|
12
|
-
from sapiopylib.rest.pojo.datatype.FieldDefinition import AbstractVeloxFieldDefinition
|
|
12
|
+
from sapiopylib.rest.pojo.datatype.FieldDefinition import AbstractVeloxFieldDefinition, FieldType
|
|
13
13
|
from sapiopylib.rest.pojo.eln.ElnExperiment import ElnExperiment
|
|
14
14
|
from sapiopylib.rest.pojo.eln.ExperimentEntry import ExperimentEntry
|
|
15
15
|
from sapiopylib.rest.pojo.eln.ExperimentEntryCriteria import ElnEntryCriteria, ElnFormEntryUpdateCriteria, \
|
|
@@ -124,16 +124,21 @@ def create_experiment_details_from_json(user: SapioUser,
|
|
|
124
124
|
# Determine which fields in the JSON can be used to create field definitions.
|
|
125
125
|
fb = FieldBuilder()
|
|
126
126
|
fields: list[AbstractVeloxFieldDefinition] = []
|
|
127
|
+
fields_by_name: dict[str, AbstractVeloxFieldDefinition] = {}
|
|
127
128
|
valid_keys: list[str] = []
|
|
128
129
|
display_to_field_name: dict[str, str] = {}
|
|
129
130
|
for key, value in json_list[0].items():
|
|
130
131
|
field_name: str = key.replace(" ", "_")
|
|
131
132
|
display_to_field_name[key] = field_name
|
|
132
133
|
if isinstance(value, str):
|
|
133
|
-
|
|
134
|
+
field = fb.string_field(field_name, display_name=key)
|
|
135
|
+
fields.append(field)
|
|
136
|
+
fields_by_name[field_name] = field
|
|
134
137
|
valid_keys.append(key)
|
|
135
138
|
elif isinstance(value, (int, float)):
|
|
136
|
-
|
|
139
|
+
field = fb.double_field(field_name, display_name=key, precision=3)
|
|
140
|
+
fields.append(field)
|
|
141
|
+
fields_by_name[field_name] = field
|
|
137
142
|
valid_keys.append(key)
|
|
138
143
|
|
|
139
144
|
# Extract the valid field values from the JSON.
|
|
@@ -141,7 +146,11 @@ def create_experiment_details_from_json(user: SapioUser,
|
|
|
141
146
|
for json_dict in json_list:
|
|
142
147
|
field_map: dict[str, Any] = {}
|
|
143
148
|
for key in valid_keys:
|
|
144
|
-
|
|
149
|
+
# Watch out for NaN values or other special values.
|
|
150
|
+
val: Any = json_dict.get(key)
|
|
151
|
+
if fields_by_name[key].data_field_type == FieldType.DOUBLE and not isinstance(val, (int, float)):
|
|
152
|
+
val = None
|
|
153
|
+
field_map[display_to_field_name[key]] = val
|
|
145
154
|
field_maps.append(field_map)
|
|
146
155
|
|
|
147
156
|
detail_entry = ElnEntryCriteria(ElnEntryType.Table, entry_name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.2.
|
|
3
|
+
Version: 2025.2.6a420
|
|
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>
|
|
@@ -15,7 +15,7 @@ sapiopycommons/datatype/attachment_util.py,sha256=_l2swuP8noIGAl4bwzBUEhr6YlN_OV
|
|
|
15
15
|
sapiopycommons/datatype/data_fields.py,sha256=C6HpqtEuF0KsxhlBUprfyv1XguaXql3EYWVbh8y-IFU,4064
|
|
16
16
|
sapiopycommons/datatype/pseudo_data_types.py,sha256=6TG7aJxgmUZ8FQkWBcgmbK5oy7AFFNtKOPpi1w1OOYA,27657
|
|
17
17
|
sapiopycommons/elain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
sapiopycommons/elain/tool_of_tools.py,sha256=
|
|
18
|
+
sapiopycommons/elain/tool_of_tools.py,sha256=r_7o0eRFMEYmiqnvsApRkLtRH-98qxRRbtcCFlgu_a0,25153
|
|
19
19
|
sapiopycommons/eln/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
sapiopycommons/eln/experiment_handler.py,sha256=8hmR7sawDo9K6iBwB44QSoxlH1M91inor7dfuXQ4LKs,69323
|
|
21
21
|
sapiopycommons/eln/experiment_report_util.py,sha256=EA2Iq8gW17bSEI6lPoHYQQ-fDvG4O28RWOoTPXpOlUw,36640
|
|
@@ -57,7 +57,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
57
57
|
sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
|
|
58
58
|
sapiopycommons/webhook/webhook_handlers.py,sha256=M5PMt-j7PpnzUQMUQDTvqwJUyJNxuFtC9wdnk5VRNpI,39703
|
|
59
59
|
sapiopycommons/webhook/webservice_handlers.py,sha256=Y5dHx_UFWFuSqaoPL6Re-fsKYRuxvCWZ8bj6KSZ3jfM,14285
|
|
60
|
-
sapiopycommons-2025.2.
|
|
61
|
-
sapiopycommons-2025.2.
|
|
62
|
-
sapiopycommons-2025.2.
|
|
63
|
-
sapiopycommons-2025.2.
|
|
60
|
+
sapiopycommons-2025.2.6a420.dist-info/METADATA,sha256=d1aGkNRwr445U_QRg7QIS0S6sihlHnsErZnCLrdVS-A,3142
|
|
61
|
+
sapiopycommons-2025.2.6a420.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
62
|
+
sapiopycommons-2025.2.6a420.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
63
|
+
sapiopycommons-2025.2.6a420.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.2.6a419.dist-info → sapiopycommons-2025.2.6a420.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|