-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs; started on new tutorial * docs; finished shell of tutorial * refactor: started on prepare methods * refactor: fix extension method * fix: handle property ID * refactor: implementd to excel * fix: maximum column width * refactor; remove cognite prefix * refactor: added new prefix * refactor: added view reduction * fix: drop 3D property * refactor; neat session use in memory by default * refactor: setup dms analysis * refactor: expose new analysis * refactor: fix include all properties * docs: finished doc tutorial * docs; clear hidden output * refactor: review feedback * Cleanup dependencies (#674) * build: moved around dependencies * style: happy mypy * build: pin python-multipart * docs; document
- Loading branch information
Showing
21 changed files
with
1,838 additions
and
1,209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from ._asset import AssetAnalysis | ||
from ._information import ( | ||
InformationAnalysis, | ||
) | ||
from ._dms import DMSAnalysis | ||
from ._information import InformationAnalysis | ||
|
||
__all__ = ["InformationAnalysis", "AssetAnalysis"] | ||
__all__ = ["InformationAnalysis", "AssetAnalysis", "DMSAnalysis"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from cognite.neat._constants import DMS_LISTABLE_PROPERTY_LIMIT | ||
from cognite.neat._rules.models.dms import DMSProperty, DMSRules, DMSView | ||
from cognite.neat._rules.models.entities import ReferenceEntity, ViewEntity | ||
|
||
from ._base import BaseAnalysis | ||
|
||
|
||
class DMSAnalysis(BaseAnalysis[DMSRules, DMSView, DMSProperty, ViewEntity, str]): | ||
"""Assumes analysis over only the complete schema""" | ||
|
||
def _get_classes(self) -> list[DMSView]: | ||
return list(self.rules.views) | ||
|
||
def _get_properties(self) -> list[DMSProperty]: | ||
return list(self.rules.properties) | ||
|
||
def _get_reference(self, class_or_property: DMSView | DMSProperty) -> ReferenceEntity | None: | ||
return class_or_property.reference if isinstance(class_or_property.reference, ReferenceEntity) else None | ||
|
||
def _get_cls_entity(self, class_: DMSView | DMSProperty) -> ViewEntity: | ||
return class_.view | ||
|
||
def _get_prop_entity(self, property_: DMSProperty) -> str: | ||
return property_.property_ | ||
|
||
def _get_cls_parents(self, class_: DMSView) -> list[ViewEntity] | None: | ||
return list(class_.implements) if class_.implements else None | ||
|
||
def _get_reference_rules(self) -> DMSRules | None: | ||
return self.rules.reference | ||
|
||
@classmethod | ||
def _set_cls_entity(cls, property_: DMSProperty, class_: ViewEntity) -> None: | ||
property_.view = class_ | ||
|
||
def _get_object(self, property_: DMSProperty) -> ViewEntity | None: | ||
return property_.value_type if isinstance(property_.value_type, ViewEntity) else None | ||
|
||
def _get_max_occurrence(self, property_: DMSProperty) -> int | float | None: | ||
return DMS_LISTABLE_PROPERTY_LIMIT if property_.is_list else 1 | ||
|
||
def subset_rules(self, desired_classes: set[ViewEntity]) -> DMSRules: | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.