labfreed 0.2.6a4__tar.gz → 0.2.6a6__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.6a4 → labfreed-0.2.6a6}/PKG-INFO +1 -1
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/__init__.py +1 -1
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/cit_v1.py +3 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/cit_v2.py +8 -1
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/resolver.py +9 -5
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/.github/workflows/pypi-publish.yml +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/.github/workflows/run-tests.yml +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/CHANGELOG.md +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/LICENSE +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/README.md +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/labfreed_infrastructure.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_cat/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_cat/category_base.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_cat/pac_cat.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_cat/predefined_categories.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/extension.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/id_segment.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/pac_id.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/url_parser.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id/url_serializer.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/cit_common.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/pac_id_resolver/services.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/qr/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/qr/generate_qr.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/python_convenience/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/python_convenience/data_table.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/python_convenience/pyTREX.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/python_convenience/quantity.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/table_segment.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/trex.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/trex_base_models.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/trex/value_segments.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/utilities/base36.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_extensions/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_extensions/default_extension_interpreters.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_extensions/display_name_extension.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_extensions/trex_extension.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/gs1/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/gs1/gs1.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/gs1/gs1_ai_enum_sorted.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/labfreed/well_known_keys.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/unece/UneceUnits.json +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/unece/__init__.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/labfreed/well_known_keys/unece/unece_units.py +0 -0
- {labfreed-0.2.6a4 → labfreed-0.2.6a6}/pyproject.toml +0 -0
|
@@ -153,6 +153,9 @@ class CIT_v1(LabFREED_BaseModel):
|
|
|
153
153
|
raise ValueError('CIT v1 does only handle PAC-IDs. PAC-CAT it does not know what to do')
|
|
154
154
|
cit_evaluated = ServiceGroup(origin=self.origin)
|
|
155
155
|
for e in self.entries:
|
|
156
|
+
if e.errors():
|
|
157
|
+
continue #make this stable against errors in the cit
|
|
158
|
+
|
|
156
159
|
conditions = e.applicable_if.split(';')
|
|
157
160
|
conditions_evaluated = list()
|
|
158
161
|
for c in conditions:
|
|
@@ -130,7 +130,12 @@ class CIT_v2(LabFREED_BaseModel):
|
|
|
130
130
|
|
|
131
131
|
@classmethod
|
|
132
132
|
def from_yaml(cls, yml:str) -> Self:
|
|
133
|
-
|
|
133
|
+
try:
|
|
134
|
+
d = yaml.safe_load(yml)
|
|
135
|
+
except yaml.YAMLError as e:
|
|
136
|
+
# not a valid yaml
|
|
137
|
+
raise ValueError("This is not a valid yaml") from e
|
|
138
|
+
return cls.model_validate(d)
|
|
134
139
|
|
|
135
140
|
def __str__(self):
|
|
136
141
|
yml = yaml.dump(self.model_dump() )
|
|
@@ -145,6 +150,8 @@ class CIT_v2(LabFREED_BaseModel):
|
|
|
145
150
|
continue
|
|
146
151
|
|
|
147
152
|
for e in block.entries:
|
|
153
|
+
if e.errors():
|
|
154
|
+
continue #make this stable against errors in the cit
|
|
148
155
|
url = self._eval_url_template(pac_id_json, e.template_url)
|
|
149
156
|
cit_evaluated.services.append(Service(
|
|
150
157
|
service_name=e.service_name,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
from functools import lru_cache
|
|
1
2
|
import logging
|
|
3
|
+
import traceback
|
|
2
4
|
from typing import Self
|
|
3
5
|
import yaml
|
|
4
6
|
from requests import get
|
|
@@ -24,11 +26,11 @@ def load_cit(path):
|
|
|
24
26
|
|
|
25
27
|
def cit_from_str(s:str, origin:str='') -> CIT_v1|CIT_v2:
|
|
26
28
|
try:
|
|
27
|
-
|
|
28
|
-
cit2 = CIT_v2.from_yaml(cit_yml)
|
|
29
|
+
cit2 = CIT_v2.from_yaml(s)
|
|
29
30
|
cit_version = 'v2'
|
|
30
31
|
except Exception:
|
|
31
32
|
cit2 = None
|
|
33
|
+
traceback.print_exc()
|
|
32
34
|
try:
|
|
33
35
|
cit1 = CIT_v1.from_csv(s, origin)
|
|
34
36
|
cit_version = 'v1'
|
|
@@ -38,6 +40,7 @@ def cit_from_str(s:str, origin:str='') -> CIT_v1|CIT_v2:
|
|
|
38
40
|
cit = cit2 or cit1 or None
|
|
39
41
|
return cit
|
|
40
42
|
|
|
43
|
+
@lru_cache
|
|
41
44
|
def _get_issuer_cit(issuer:str):
|
|
42
45
|
'''Gets the issuer's cit.'''
|
|
43
46
|
url = 'HTTPS://PAC.' + issuer + '/coupling-information-table'
|
|
@@ -64,15 +67,16 @@ class PAC_ID_Resolver():
|
|
|
64
67
|
self._cits = cits
|
|
65
68
|
|
|
66
69
|
|
|
67
|
-
def resolve(self, pac_url:PAC_ID|str, check_service_status=True) -> list[ServiceGroup]:
|
|
70
|
+
def resolve(self, pac_url:PAC_ID|str, check_service_status=True, use_issuer_cit=True) -> list[ServiceGroup]:
|
|
68
71
|
'''Resolve a PAC-ID'''
|
|
69
72
|
if isinstance(pac_url, str):
|
|
70
73
|
pac_id = PAC_CAT.from_url(pac_url)
|
|
71
74
|
pac_id_catless = PAC_ID.from_url(pac_url, try_pac_cat=False)
|
|
72
75
|
|
|
73
76
|
cits = self._cits.copy()
|
|
74
|
-
if
|
|
75
|
-
|
|
77
|
+
if use_issuer_cit:
|
|
78
|
+
if issuer_cit := _get_issuer_cit(pac_id.issuer):
|
|
79
|
+
cits.append(issuer_cit)
|
|
76
80
|
|
|
77
81
|
matches = []
|
|
78
82
|
for cit in cits:
|
|
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.6a4 → labfreed-0.2.6a6}/labfreed/well_known_extensions/display_name_extension.py
RENAMED
|
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
|