labfreed 0.2.5a13__tar.gz → 0.2.5a15__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 labfreed might be problematic. Click here for more details.
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/PKG-INFO +1 -1
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/__init__.py +1 -1
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/python_convenience/data_table.py +3 -3
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/python_convenience/quantity.py +19 -4
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/.github/workflows/pypi-publish.yml +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/.github/workflows/run-tests.yml +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/CHANGELOG.md +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/LICENSE +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/README.md +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/labfreed_infrastructure.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_cat/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_cat/category_base.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_cat/pac_cat.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_cat/predefined_categories.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/extension.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/id_segment.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/pac_id.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/url_parser.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id/url_serializer.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id_resolver/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id_resolver/cit_v1.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id_resolver/cit_v2.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id_resolver/resolver.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/pac_id_resolver/services.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/qr/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/qr/generate_qr.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/python_convenience/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/python_convenience/pyTREX.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/table_segment.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/trex.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/trex_base_models.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/trex/value_segments.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/utilities/base36.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_extensions/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_extensions/default_extension_interpreters.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_extensions/display_name_extension.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_extensions/trex_extension.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/gs1/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/gs1/gs1.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/labfreed/well_known_keys.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/unece/UneceUnits.json +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/unece/__init__.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/unece/unece_units.py +0 -0
- {labfreed-0.2.5a13 → labfreed-0.2.5a15}/pyproject.toml +0 -0
|
@@ -61,7 +61,7 @@ class DataTable(BaseModel):
|
|
|
61
61
|
|
|
62
62
|
def get_column(self, col:str|int) -> list:
|
|
63
63
|
if isinstance(col, str):
|
|
64
|
-
col_index = self.col_names.index()
|
|
64
|
+
col_index = self.col_names.index(col)
|
|
65
65
|
else:
|
|
66
66
|
col_index = col
|
|
67
67
|
col_data = [row[col_index] for row in self.data]
|
|
@@ -72,14 +72,14 @@ class DataTable(BaseModel):
|
|
|
72
72
|
return self.data[row_index]
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
def get_row_as_dict(self, row_index:int) ->
|
|
75
|
+
def get_row_as_dict(self, row_index:int) -> dict:
|
|
76
76
|
d = {k:v for k, v in zip(self.col_names, self.data[row_index])}
|
|
77
77
|
return d
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
def get_cell(self, row_index:int, col:str|int):
|
|
81
81
|
if isinstance(col, str):
|
|
82
|
-
col_index = self.col_names.index()
|
|
82
|
+
col_index = self.col_names.index(col)
|
|
83
83
|
else:
|
|
84
84
|
col_index = col
|
|
85
85
|
return self.data[row_index][col_index]
|
|
@@ -7,12 +7,27 @@ class Quantity(BaseModel):
|
|
|
7
7
|
value: float|int
|
|
8
8
|
unit: str | None
|
|
9
9
|
'''unit. Use SI symbols. Set to None of the Quantity is dimensionless'''
|
|
10
|
-
|
|
10
|
+
log_least_significant_digit: int|None = None
|
|
11
|
+
|
|
12
|
+
@model_validator(mode='before')
|
|
13
|
+
@classmethod
|
|
14
|
+
def decimals_to_log_significant_digits(cls, d:dict):
|
|
15
|
+
if decimals:= d.pop('decimals', None):
|
|
16
|
+
d['log_least_significant_digit'] = - decimals
|
|
17
|
+
return d
|
|
18
|
+
|
|
19
|
+
@model_validator(mode='before')
|
|
20
|
+
@classmethod
|
|
21
|
+
def dimensionless_unit(cls, d:dict):
|
|
22
|
+
unit= d.get('decimals', None)
|
|
23
|
+
if unit in ['1', '', 'dimensionless']:
|
|
24
|
+
d['unit'] = None
|
|
25
|
+
return d
|
|
11
26
|
|
|
12
27
|
@model_validator(mode='after')
|
|
13
28
|
def significat_digits_for_int(self):
|
|
14
29
|
if isinstance(self.value, int):
|
|
15
|
-
self.
|
|
30
|
+
self.log_least_significant_digit = 0
|
|
16
31
|
return self
|
|
17
32
|
|
|
18
33
|
@property
|
|
@@ -24,8 +39,8 @@ class Quantity(BaseModel):
|
|
|
24
39
|
unit_symbol = self.unit
|
|
25
40
|
if self.unit == "dimensionless" or not self.unit:
|
|
26
41
|
unit_symbol = ""
|
|
27
|
-
if self.
|
|
28
|
-
val = f"{self.value:.{self.
|
|
42
|
+
if self.log_least_significant_digit is not None:
|
|
43
|
+
val = f"{self.value:.{self.log_least_significant_digit}f}"
|
|
29
44
|
else:
|
|
30
45
|
val = str(self.value)
|
|
31
46
|
return f"{val} {unit_symbol}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_extensions/display_name_extension.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{labfreed-0.2.5a13 → labfreed-0.2.5a15}/labfreed/well_known_keys/labfreed/well_known_keys.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|