labfreed 0.2.5a7__py3-none-any.whl → 0.2.5a9__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.5a7"
5
+ __version__ = "0.2.5a9"
6
6
 
7
7
  from labfreed.pac_id import * # noqa: F403
8
8
  from labfreed.pac_cat import * # noqa: F403
@@ -51,7 +51,24 @@ class DataTable(BaseModel):
51
51
  if not len(item) == len(self._row_template):
52
52
  raise ValueError('row is not of same length as the row template.')
53
53
  self.data.append(item)
54
-
54
+
55
+ def get_column(self, col:str|int) -> list:
56
+ if isinstance(col, str):
57
+ col_index = self.col_names.index()
58
+ else:
59
+ col_index = col
60
+ col_data = [row[col_index] for row in self.data]
61
+ return col_data
62
+
63
+ def get_row(self, row_index:int) -> list:
64
+ return self.data[row_index]
65
+
66
+ def get_cell(self, row_index:int, col:str|int):
67
+ if isinstance(col, str):
68
+ col_index = self.col_names.index()
69
+ else:
70
+ col_index = col
71
+ return self.data[row_index][col_index]
55
72
 
56
73
 
57
74
 
@@ -24,12 +24,12 @@ class pyTREX(RootModel[dict[str, Quantity | datetime | time | date | bool | str
24
24
 
25
25
 
26
26
  @classmethod
27
- def from_trex(cls, trex:TREX):
27
+ def from_trex(cls, trex:TREX) -> pyTREX:
28
28
  '''Creates a pyTREX from a TREX'''
29
29
  return {seg.key: _trex_segment_to_python_type(seg) for seg in trex.segments}
30
30
 
31
31
 
32
- def to_trex(self):
32
+ def to_trex(self) -> TREX:
33
33
  '''Creates a TREX'''
34
34
  segments = list()
35
35
  for k, v in self.root.items():
@@ -76,7 +76,6 @@ class pyTREX(RootModel[dict[str, Quantity | datetime | time | date | bool | str
76
76
  if re.fullmatch(r'[A-Z0-9\-\.]*', rt):
77
77
  t = 'T.A'
78
78
  else:
79
- v = to_base36(rt)
80
79
  t = 'T.X'
81
80
  elif isinstance(rt, base36):
82
81
  t = 'T.X'
@@ -38,7 +38,7 @@ class Quantity(BaseModel):
38
38
 
39
39
  def unece_unit_code_from_quantity(q:Quantity):
40
40
  if not q.unit:
41
- return 'C63' # dimensionless
41
+ return 'C62' # dimensionless
42
42
  by_name = [ u['commonCode'] for u in unece_units() if u.get('name','') == q.unit]
43
43
  by_symbol = [ u['commonCode'] for u in unece_units() if u.get('symbol','') == q.unit]
44
44
  by_code = [ u['commonCode'] for u in unece_units() if u.get('commonCode','') == q.unit]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: labfreed
3
- Version: 0.2.5a7
3
+ Version: 0.2.5a9
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=TkoJKnHrT7gKiqc6QyDOcZFaDZSyQg9fJElU9o0YjZ8,338
1
+ labfreed/__init__.py,sha256=W5Cuc_Sp9nhGCaHH0DoZcL3DBukyFGybdKposDlqBPo,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
@@ -23,9 +23,9 @@ 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=zUPD9lDzF6eeiys3YYf16M3g8wPYE2kBLAk1l8zZ6Do,2157
27
- labfreed/trex/python_convenience/pyTREX.py,sha256=7L1K1sLajl8yE-i1NIjVGnxx1SZJDNDM4pvK9fXK4iQ,10147
28
- labfreed/trex/python_convenience/quantity.py,sha256=j-E5rioQKs6COPMtn5J8bZmbwEF0RBkFxYmHJZaT2Q0,1729
26
+ labfreed/trex/python_convenience/data_table.py,sha256=O5J8Mxt_idztsqg6fMLZ3tCtBcezoZI5P0rTpNrftsA,2741
27
+ labfreed/trex/python_convenience/pyTREX.py,sha256=4x7QzgFFVRyNnrJa9pJTOQGY8OjoJwiiwGUbnuoM-3g,10118
28
+ labfreed/trex/python_convenience/quantity.py,sha256=NlbKsXmr-nvN42gLw1gGn7GVRTdaIuYZky7SLekdhI8,1729
29
29
  labfreed/utilities/base36.py,sha256=_yX8aQ1OwrK5tnJU1NUEzQSFGr9xAVnNvPObpNzCPYs,2895
30
30
  labfreed/well_known_extensions/__init__.py,sha256=CjZTjx8Cn8763Hhnv_--Wj1LcFpFs2cyQwWrrzOS4xM,246
31
31
  labfreed/well_known_extensions/default_extension_interpreters.py,sha256=3-BkJrAyBa99NN5Q2QPAm59CcWmPket-rvLzgltp8KY,201
@@ -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.5a7.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
42
- labfreed-0.2.5a7.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
43
- labfreed-0.2.5a7.dist-info/METADATA,sha256=nUK-qzSAxAYxwXKjk0Ypqa9sN1d32Ql-EJyKUg-xzyA,18092
44
- labfreed-0.2.5a7.dist-info/RECORD,,
41
+ labfreed-0.2.5a9.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
42
+ labfreed-0.2.5a9.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
43
+ labfreed-0.2.5a9.dist-info/METADATA,sha256=TR6dQNdmS8x064xHsniIMdzPc7vaT7t72p5P9JTNNIc,18092
44
+ labfreed-0.2.5a9.dist-info/RECORD,,