labfreed 0.2.5a0__py3-none-any.whl → 0.2.5a2__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 labfreed might be problematic. Click here for more details.

labfreed/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  Python implementation of LabFREED building blocks
3
3
  '''
4
4
 
5
- __version__ = "0.2.5a0"
5
+ __version__ = "0.2.5a2"
6
6
 
7
7
  from labfreed.pac_id import * # noqa: F403
8
8
  from labfreed.pac_cat import * # noqa: F403
@@ -11,7 +11,7 @@ from labfreed.trex.python_convenience.quantity import Quantity
11
11
  class DataTable(BaseModel):
12
12
  _row_template:list[str, Quantity | datetime | time | date | bool | str | base36] = PrivateAttr(default_factory=list)
13
13
  col_names: list[str] = Field(default_factory=list)
14
- data:list[list[Union[Quantity, datetime, time, date, bool, str, base36]]] = Field(default_factory=list)
14
+ data:list[list[Union[Quantity, datetime, time, date, bool, str, base36, None]]] = Field(default_factory=list)
15
15
 
16
16
  @property
17
17
  def row_template(self):
@@ -12,7 +12,7 @@ from labfreed.trex.python_convenience.quantity import Quantity, unece_unit_code_
12
12
  from labfreed.trex.table_segment import ColumnHeader, TableSegment
13
13
  from labfreed.trex.trex import TREX
14
14
  from labfreed.trex.trex_base_models import AlphanumericValue, BinaryValue, BoolValue, DateValue, ErrorValue, NumericValue, TextValue
15
- from labfreed.trex.value_segments import BoolSegment, TextSegment, NumericSegment, AlphanumericSegment, DateSegment, ValueSegment
15
+ from labfreed.trex.value_segments import BoolSegment, ErrorSegment, TextSegment, NumericSegment, AlphanumericSegment, DateSegment, ValueSegment
16
16
 
17
17
 
18
18
  class pyTREX(RootModel[dict[str, Quantity | datetime | time | date | bool | str | base36 | DataTable]]):
@@ -33,7 +33,10 @@ class pyTREX(RootModel[dict[str, Quantity | datetime | time | date | bool | str
33
33
  '''Creates a TREX'''
34
34
  segments = list()
35
35
  for k, v in self.root.items():
36
- if isinstance(v, bool):
36
+ if v is None:
37
+ value = _error_value_from_python_type(v)
38
+ segments.append(ErrorSegment(key=k, value=value.value))
39
+ elif isinstance(v, bool):
37
40
  value = _bool_value_from_python_type(v)
38
41
  segments.append(BoolSegment(key=k, value=value.value))
39
42
  elif isinstance(v, Quantity):
@@ -83,7 +86,9 @@ class pyTREX(RootModel[dict[str, Quantity | datetime | time | date | bool | str
83
86
  for row in v.data:
84
87
  r = []
85
88
  for e in row:
86
- if isinstance(e, bool): # must come first otherwise int matches the bool
89
+ if e is None:
90
+ r.append(_error_value_from_python_type(e))
91
+ elif isinstance(e, bool): # must come first otherwise int matches the bool
87
92
  r.append(_bool_value_from_python_type(e))
88
93
  elif isinstance(e, Quantity):
89
94
  r.append(_numeric_value_from_python_type(e.value))
@@ -165,6 +170,8 @@ def _binary_value_from_python_type(v:base36|str):
165
170
 
166
171
 
167
172
  def _error_value_from_python_type(v:str):
173
+ if v in None:
174
+ v = '-'
168
175
  return ErrorValue(value = v)
169
176
 
170
177
 
@@ -146,6 +146,7 @@ class TableSegment(TREX_Segment):
146
146
  highlight_sub=[c for c in e.value]
147
147
  )
148
148
  i += 1
149
+ return self
149
150
 
150
151
 
151
152
  def _get_col_index(self, col:str|int):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: labfreed
3
- Version: 0.2.5a0
3
+ Version: 0.2.5a2
4
4
  Summary: Python implementation of LabFREED building blocks
5
5
  Author-email: Reto Thürer <thuerer.r@buchi.com>
6
6
  Requires-Python: >=3.11
@@ -1,4 +1,4 @@
1
- labfreed/__init__.py,sha256=riVWLa5laYxsK3qAh69PlVZgdMm2ent1IxOpLxhJehA,338
1
+ labfreed/__init__.py,sha256=aEYEgLY66YSy0dew1X3NN1XK4O01jhkkVdA7RHBkbX4,338
2
2
  labfreed/labfreed_infrastructure.py,sha256=yxZkI0mPrHyeZGWKtgFIV9R54edSUcww-w1ExHt8F-o,9990
3
3
  labfreed/pac_cat/__init__.py,sha256=S4T-QgzcEDjup44WvHCY3_K30B6_e8ducR--DxBb_DM,554
4
4
  labfreed/pac_cat/category_base.py,sha256=lFQNiTUukyhWdaSCAI7CZxLtj6kNtnBCE4UsePwsGqE,1801
@@ -18,13 +18,13 @@ labfreed/pac_id_resolver/services.py,sha256=TPoH6YlSwa0hmawHpOiMwIpBAinhoRhMSoex
18
18
  labfreed/qr/__init__.py,sha256=fdKwP6W2Js--yMbBUdn-g_2uq2VqPpfQJeDLHsMDO-Y,61
19
19
  labfreed/qr/generate_qr.py,sha256=mSt-U872O3ReHB_UdS-MzYu0wRgdlKcAOEfTxg5CLRk,16616
20
20
  labfreed/trex/__init__.py,sha256=r0MYrGk_XxsqSKo9c2i9jRXApTDeTZD8QRXcRpkOVXY,428
21
- labfreed/trex/table_segment.py,sha256=VZRciE329lmnwfnaykVBaNlrkG80UrDVrjUgQMVREHM,9133
21
+ labfreed/trex/table_segment.py,sha256=qlItBK1x3Qr7KUSM_L6dcmv3Y2fNhiqTaiXbXm5BKs0,9154
22
22
  labfreed/trex/trex.py,sha256=WDoPvuhiilLtRSIkntCmDGkFBnD6oRZg0E6hhoV-I2g,2400
23
23
  labfreed/trex/trex_base_models.py,sha256=3twGEZLYEznUyJ_ctcTcPYsy1qOciMRqLcslE9dxEqw,7567
24
24
  labfreed/trex/value_segments.py,sha256=mmjyEKWLlDIoiFlk2wKELOfWn2_0xwreNEBTs8RgjOY,3774
25
25
  labfreed/trex/python_convenience/__init__.py,sha256=dyAQG7t-uYN6VfGXbWIq2bHxGcGI63l7FS2-VPYs2RQ,137
26
- labfreed/trex/python_convenience/data_table.py,sha256=x0DRKEI6Sv1T5p5kUlQ_UcP-wH7haBVrQgTXHlF_ZSw,1758
27
- labfreed/trex/python_convenience/pyTREX.py,sha256=qiOJ6PGAfsbnfpQBI_G2_C-3DaKqTfIW5xdZReQVxI8,9824
26
+ labfreed/trex/python_convenience/data_table.py,sha256=PRV9mTvH3KgbiernbvqWNaCYLOqhpPX6fnazw4sndOM,1764
27
+ labfreed/trex/python_convenience/pyTREX.py,sha256=K0TgCy9H5J3l2wiIWtUEpjm0E8BkN7zXiyBWBPeziR0,10147
28
28
  labfreed/trex/python_convenience/quantity.py,sha256=d3w-ThY4Cp7n3fde8pct-X5kHc7vbVe1xsJQKROnLks,1470
29
29
  labfreed/utilities/base36.py,sha256=_yX8aQ1OwrK5tnJU1NUEzQSFGr9xAVnNvPObpNzCPYs,2895
30
30
  labfreed/well_known_extensions/__init__.py,sha256=CjZTjx8Cn8763Hhnv_--Wj1LcFpFs2cyQwWrrzOS4xM,246
@@ -38,7 +38,7 @@ labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=nqk66kHdSwJTJfMKlP-x
38
38
  labfreed/well_known_keys/unece/UneceUnits.json,sha256=kwfQSp_nTuWbADfBBgqTWrvPl6XtM5SedEVLbMJrM7M,898953
39
39
  labfreed/well_known_keys/unece/__init__.py,sha256=MSP9lmjg9_D9iqG9Yq2_ajYfQSNS9wIT7FXA1c--59M,122
40
40
  labfreed/well_known_keys/unece/unece_units.py,sha256=gNDQk6KGl-nGMf9Ycq_fQ8P2xxKITgLkcQWPd4H49gI,1630
41
- labfreed-0.2.5a0.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
42
- labfreed-0.2.5a0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
43
- labfreed-0.2.5a0.dist-info/METADATA,sha256=BirqG3bjdOqZ8ps6qvZQnwtTY_kJHN4ODVq1GDPkmf4,18092
44
- labfreed-0.2.5a0.dist-info/RECORD,,
41
+ labfreed-0.2.5a2.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
42
+ labfreed-0.2.5a2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
43
+ labfreed-0.2.5a2.dist-info/METADATA,sha256=VIRc-Ih4-YA47CkkLQtXE8Lf_JVaiVQmZN8mJbGiqZw,18092
44
+ labfreed-0.2.5a2.dist-info/RECORD,,