industrial-model 0.1.7__tar.gz → 0.1.9__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.
- {industrial_model-0.1.7 → industrial_model-0.1.9}/PKG-INFO +1 -1
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/query_result_mapper.py +14 -13
- {industrial_model-0.1.7 → industrial_model-0.1.9}/pyproject.toml +1 -1
- {industrial_model-0.1.7 → industrial_model-0.1.9}/uv.lock +1 -1
- {industrial_model-0.1.7 → industrial_model-0.1.9}/.gitignore +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/.python-version +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/.vscode/settings.json +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/README.md +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/filter_mapper.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/optimizer.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/query_mapper.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/sort_mapper.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/utils.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/view_mapper.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/config.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/constants.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/engines/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/engines/async_engine.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/engines/engine.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/models/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/models/base.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/models/entities.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/models/schemas.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/py.typed +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/queries/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/queries/models.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/queries/params.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/statements/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/statements/expressions.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/utils.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/scripts/build.sh +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/scripts/format.sh +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/scripts/lint.sh +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/tests/__init__.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/tests/cognite-sdk-config.yaml +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/tests/hubs.py +0 -0
- {industrial_model-0.1.7 → industrial_model-0.1.9}/tests/tests_adapter.py +0 -0
|
@@ -70,13 +70,14 @@ class QueryResultMapper:
|
|
|
70
70
|
|
|
71
71
|
return entry.get("space", ""), entry.get("externalId", "")
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
(node.space, node.external_id): node
|
|
75
|
-
for node in query_result[key]
|
|
76
|
-
if isinstance(node, Node)
|
|
77
|
-
}
|
|
73
|
+
visited: set[tuple[str, str]] = set()
|
|
78
74
|
result: defaultdict[tuple[str, str], list[Node]] = defaultdict(list)
|
|
79
|
-
for node in
|
|
75
|
+
for node in query_result[key]:
|
|
76
|
+
identify = (node.space, node.external_id)
|
|
77
|
+
if not isinstance(node, Node) or identify in visited:
|
|
78
|
+
continue
|
|
79
|
+
|
|
80
|
+
visited.add(identify)
|
|
80
81
|
properties = node.properties.get(view_id, {})
|
|
81
82
|
node_id = get_node_id(node)
|
|
82
83
|
for mapping_key, (values, is_list) in mappings.items():
|
|
@@ -85,7 +86,7 @@ class QueryResultMapper:
|
|
|
85
86
|
element_key: tuple[str, str] = (
|
|
86
87
|
(element.get("space", ""), element.get("externalId", ""))
|
|
87
88
|
if isinstance(element, dict)
|
|
88
|
-
else
|
|
89
|
+
else (node.space, node.external_id)
|
|
89
90
|
)
|
|
90
91
|
|
|
91
92
|
entries = values.get(element_key)
|
|
@@ -178,14 +179,14 @@ class QueryResultMapper:
|
|
|
178
179
|
if not nodes:
|
|
179
180
|
return None
|
|
180
181
|
|
|
182
|
+
visited: set[tuple[str, str]] = set()
|
|
181
183
|
result: defaultdict[tuple[str, str], list[Node]] = defaultdict(list)
|
|
184
|
+
for edge in query_result[edge_key]:
|
|
185
|
+
identify = (edge.space, edge.external_id)
|
|
186
|
+
if not isinstance(edge, Edge) or identify in visited:
|
|
187
|
+
continue
|
|
182
188
|
|
|
183
|
-
|
|
184
|
-
(edge.space, edge.external_id): edge
|
|
185
|
-
for edge in query_result[edge_key]
|
|
186
|
-
if isinstance(edge, Edge)
|
|
187
|
-
}
|
|
188
|
-
for edge in edges.values():
|
|
189
|
+
visited.add(identify)
|
|
189
190
|
entry_key, node_key = (
|
|
190
191
|
(
|
|
191
192
|
edge.end_node.as_tuple(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/__init__.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/filter_mapper.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/optimizer.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/query_mapper.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/sort_mapper.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/utils.py
RENAMED
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/cognite_adapters/view_mapper.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{industrial_model-0.1.7 → industrial_model-0.1.9}/industrial_model/statements/expressions.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
|