cognite-neat 0.96.2__tar.gz → 0.96.3__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 cognite-neat might be problematic. Click here for more details.
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/PKG-INFO +1 -1
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/loaders/_base.py +2 -2
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/loaders/_rdf2asset.py +5 -5
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/loaders/_rdf2dms.py +1 -1
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/__init__.py +11 -1
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/_base.py +21 -2
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_verification.py +4 -9
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_base.py +1 -0
- cognite_neat-0.96.3/cognite/neat/_session/_inspect.py +177 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_state.py +10 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_to.py +18 -2
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/upload.py +19 -8
- cognite_neat-0.96.3/cognite/neat/_version.py +1 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/pyproject.toml +1 -1
- cognite_neat-0.96.2/cognite/neat/_session/_inspect.py +0 -89
- cognite_neat-0.96.2/cognite/neat/_version.py +0 -1
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/LICENSE +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/README.md +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/asgi/metrics.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/configuration.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/context_manager/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/context_manager/manager.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/data_classes/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/data_classes/rest.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/explorer.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/routers/configuration.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/routers/crud.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/routers/metrics.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/routers/workflows.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/utils/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/utils/data_mapping.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/utils/logging.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/utils/query_templates.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/main.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/monitoring/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/monitoring/metrics.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/index.html +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/.gitignore +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/README.md +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/asset-manifest.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/favicon.ico +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/img/architect-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/img/developer-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/img/sme-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/index.html +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/logo192.png +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/manifest.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/robots.txt +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/css/main.72e3d92e.css.map +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.LICENSE.txt +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/js/main.5a52cf09.js.map +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/build/static/media/logo.8093b84df9ed36a174c629d6fe0b730d.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/package-lock.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/package.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/favicon.ico +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/img/architect-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/img/developer-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/img/sme-icon.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/index.html +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/logo192.png +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/manifest.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/public/robots.txt +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/App.css +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/App.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/App.test.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/MainContainer.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/JsonViewer.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/LocalUploader.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/OverviewComponentEditorDialog.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/StepEditorDialog.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/TabPanel.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/Utils.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/WorkflowDeleteDialog.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/WorkflowExecutionReport.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/WorkflowImportExportDialog.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/components/WorkflowMetadataDialog.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/index.css +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/index.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/logo.svg +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/reportWebVitals.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/setupTests.js +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/types/WorkflowTypes.ts +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/views/AboutView.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/views/ConfigView.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/views/GlobalConfigView.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/src/views/WorkflowView.tsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/ui/neat-app/tsconfig.json +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_config.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_constants.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/_shared.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/_tracking/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/_tracking/base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/_tracking/log.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/examples/Knowledge-Graph-Nordic44.xml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/examples/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_assets.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_classic.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_data_sets.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_events.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_files.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_labels.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_relationships.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_sequences.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_classic_cdf/_timeseries.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_dexpi.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_dms.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_iodd.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_mock_graph_generator.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/extractors/_rdf_file.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/loaders/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/models.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/queries/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/queries/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/queries/_construct.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/queries/_shared.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_classic_cdf.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_iodd.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_prune_graph.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_rdfpath.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_graph/transformers/_value_type.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/_external.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/_general.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/_properties.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/_resources.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/errors/_workflow.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/formatters.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/_external.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/_general.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/_models.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/_properties.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/_resources.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_issues/warnings/user_modeling.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/_constants.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/_shared.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/analysis/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/analysis/_asset.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/analysis/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/analysis/_dms.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/analysis/_information.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/catalog/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/catalog/info-rules-imf.xlsx +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_rules2dms.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_rules2excel.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_rules2instance_template.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_rules2ontology.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_rules2yaml.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/exporters/_validation.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dms2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dtdl2rules/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dtdl2rules/_unit_lookup.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_converter.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dtdl2rules/dtdl_importer.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_dtdl2rules/spec.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_imf2rules/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2classes.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2metadata.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2properties.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_imf2rules/_imf2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_inference2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_owl2rules/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2classes.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2metadata.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2properties.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_owl2rules/_owl2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_rdf/_shared.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_spreadsheet2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/importers/_yaml2rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/_base_input.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/_base_rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/_rdfpath.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/_types.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/asset/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/asset/_rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/asset/_rules_input.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/asset/_validation.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/data_types.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/_exporter.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/_rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/_rules_input.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/_schema.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/dms/_validation.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/domain.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_constants.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_loaders.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_multi_value.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_single_value.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_types.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/entities/_wrapped.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/information/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/information/_rules.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/information/_rules_input.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/information/_validation.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/mapping/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/mapping/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/models/mapping/_classic2core.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_converters.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_mapping.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_pipelines.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_prepare.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_read.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_set.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_show.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/_wizard.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_session/exceptions.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_shared.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_store/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_store/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_store/_provenance.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/auth.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/auxiliary.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/data_classes.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/loaders/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/loaders/_base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/loaders/_data_modeling.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/cdf/loaders/_ingestion.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/collection_.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/rdf_.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/spreadsheet.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/text.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/time_.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_utils/xml_.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/base.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/cdf_store.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/examples/Export_DMS/workflow.yaml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/examples/Export_Semantic_Data_Model/workflow.yaml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/examples/Import_DMS/workflow.yaml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/examples/Validate_Rules/workflow.yaml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/examples/Validate_Solution_Model/workflow.yaml +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/manager.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/model.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/data_contracts.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/graph_extractor.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/graph_loader.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/graph_store.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/rules_exporter.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/rules_importer.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/current/rules_validator.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/io/__init__.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/lib/io/io_steps.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps/step_model.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/steps_registry.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/tasks.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/triggers.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_workflows/utils.py +0 -0
- {cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/py.typed +0 -0
|
@@ -6,7 +6,7 @@ from typing import ClassVar, Generic, TypeVar
|
|
|
6
6
|
from cognite.client import CogniteClient
|
|
7
7
|
from cognite.client.data_classes.capabilities import Capability
|
|
8
8
|
|
|
9
|
-
from cognite.neat._issues import IssueList, NeatIssue
|
|
9
|
+
from cognite.neat._issues import IssueList, NeatIssue
|
|
10
10
|
from cognite.neat._issues.errors import AuthorizationError
|
|
11
11
|
from cognite.neat._store import NeatGraphStore
|
|
12
12
|
from cognite.neat._utils.auxiliary import class_html_doc
|
|
@@ -94,6 +94,6 @@ class CDFLoader(BaseLoader[T_Output]):
|
|
|
94
94
|
client: CogniteClient,
|
|
95
95
|
items: list[T_Output],
|
|
96
96
|
dry_run: bool,
|
|
97
|
-
read_issues:
|
|
97
|
+
read_issues: IssueList,
|
|
98
98
|
) -> Iterable[UploadResult]:
|
|
99
99
|
raise NotImplementedError
|
|
@@ -19,7 +19,7 @@ from cognite.client.exceptions import CogniteAPIError, CogniteDuplicatedError
|
|
|
19
19
|
|
|
20
20
|
from cognite.neat._graph._tracking.base import Tracker
|
|
21
21
|
from cognite.neat._graph._tracking.log import LogTracker
|
|
22
|
-
from cognite.neat._issues import IssueList, NeatError, NeatIssue
|
|
22
|
+
from cognite.neat._issues import IssueList, NeatError, NeatIssue
|
|
23
23
|
from cognite.neat._issues.errors import ResourceCreationError, ResourceNotFoundError
|
|
24
24
|
from cognite.neat._rules._constants import EntityTypes
|
|
25
25
|
from cognite.neat._rules.analysis._asset import AssetAnalysis
|
|
@@ -283,7 +283,7 @@ class AssetLoader(CDFLoader[AssetWrite]):
|
|
|
283
283
|
client: CogniteClient,
|
|
284
284
|
items: list[AssetWrite] | list[RelationshipWrite] | list[LabelDefinitionWrite],
|
|
285
285
|
dry_run: bool,
|
|
286
|
-
read_issues:
|
|
286
|
+
read_issues: IssueList,
|
|
287
287
|
) -> Iterable[UploadResult]:
|
|
288
288
|
if isinstance(items[0], AssetWrite) and all(isinstance(item, AssetWrite) for item in items):
|
|
289
289
|
yield from self._upload_assets_to_cdf(client, cast(list[AssetWrite], items), dry_run, read_issues)
|
|
@@ -303,7 +303,7 @@ class AssetLoader(CDFLoader[AssetWrite]):
|
|
|
303
303
|
client: CogniteClient,
|
|
304
304
|
items: list[LabelDefinitionWrite],
|
|
305
305
|
dry_run: bool,
|
|
306
|
-
read_issues:
|
|
306
|
+
read_issues: IssueList,
|
|
307
307
|
) -> Iterable[UploadResult]:
|
|
308
308
|
try:
|
|
309
309
|
created = client.labels.create(items)
|
|
@@ -324,7 +324,7 @@ class AssetLoader(CDFLoader[AssetWrite]):
|
|
|
324
324
|
client: CogniteClient,
|
|
325
325
|
items: list[AssetWrite],
|
|
326
326
|
dry_run: bool,
|
|
327
|
-
read_issues:
|
|
327
|
+
read_issues: IssueList,
|
|
328
328
|
) -> Iterable[UploadResult]:
|
|
329
329
|
try:
|
|
330
330
|
upserted = client.assets.upsert(items, mode="replace")
|
|
@@ -345,7 +345,7 @@ class AssetLoader(CDFLoader[AssetWrite]):
|
|
|
345
345
|
client: CogniteClient,
|
|
346
346
|
items: list[RelationshipWrite],
|
|
347
347
|
dry_run: bool,
|
|
348
|
-
read_issues:
|
|
348
|
+
read_issues: IssueList,
|
|
349
349
|
) -> Iterable[UploadResult]:
|
|
350
350
|
try:
|
|
351
351
|
upserted = client.relationships.upsert(items, mode="replace")
|
|
@@ -293,7 +293,7 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
293
293
|
client: CogniteClient,
|
|
294
294
|
items: list[dm.InstanceApply],
|
|
295
295
|
dry_run: bool,
|
|
296
|
-
read_issues:
|
|
296
|
+
read_issues: IssueList,
|
|
297
297
|
) -> Iterable[UploadResult]:
|
|
298
298
|
try:
|
|
299
299
|
nodes = [item for item in items if isinstance(item, dm.NodeApply)]
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
"""This is module contains all the Neat Exceptions (Errors) and Warnings as well
|
|
2
2
|
as some helper classes to handle them like NeatIssueList"""
|
|
3
3
|
|
|
4
|
-
from ._base import
|
|
4
|
+
from ._base import (
|
|
5
|
+
DefaultWarning,
|
|
6
|
+
IssueList,
|
|
7
|
+
MultiValueError,
|
|
8
|
+
NeatError,
|
|
9
|
+
NeatIssue,
|
|
10
|
+
NeatIssueList,
|
|
11
|
+
NeatWarning,
|
|
12
|
+
catch_warnings,
|
|
13
|
+
)
|
|
5
14
|
|
|
6
15
|
__all__ = [
|
|
7
16
|
"NeatIssue",
|
|
@@ -11,4 +20,5 @@ __all__ = [
|
|
|
11
20
|
"NeatIssueList",
|
|
12
21
|
"IssueList",
|
|
13
22
|
"MultiValueError",
|
|
23
|
+
"catch_warnings",
|
|
14
24
|
]
|
|
@@ -2,7 +2,8 @@ import inspect
|
|
|
2
2
|
import sys
|
|
3
3
|
import warnings
|
|
4
4
|
from abc import ABC
|
|
5
|
-
from collections.abc import Collection, Hashable, Iterable, Sequence
|
|
5
|
+
from collections.abc import Collection, Hashable, Iterable, Iterator, Sequence
|
|
6
|
+
from contextlib import contextmanager
|
|
6
7
|
from dataclasses import dataclass, fields
|
|
7
8
|
from functools import total_ordering
|
|
8
9
|
from pathlib import Path
|
|
@@ -371,9 +372,12 @@ T_NeatIssue = TypeVar("T_NeatIssue", bound=NeatIssue)
|
|
|
371
372
|
class NeatIssueList(list, Sequence[T_NeatIssue], ABC):
|
|
372
373
|
"""This is a generic list of NeatIssues."""
|
|
373
374
|
|
|
374
|
-
def __init__(
|
|
375
|
+
def __init__(
|
|
376
|
+
self, issues: Sequence[T_NeatIssue] | None = None, title: str | None = None, action: str | None = None
|
|
377
|
+
):
|
|
375
378
|
super().__init__(issues or [])
|
|
376
379
|
self.title = title
|
|
380
|
+
self.action = action
|
|
377
381
|
|
|
378
382
|
@property
|
|
379
383
|
def errors(self) -> Self:
|
|
@@ -450,3 +454,18 @@ def _get_subclasses(cls_: type[T_Cls], include_base: bool = False) -> Iterable[t
|
|
|
450
454
|
for s in cls_.__subclasses__():
|
|
451
455
|
yield s
|
|
452
456
|
yield from _get_subclasses(s, False)
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
@contextmanager
|
|
460
|
+
def catch_warnings(
|
|
461
|
+
issues: IssueList | None = None,
|
|
462
|
+
warning_cls: type[NeatWarning] = DefaultWarning,
|
|
463
|
+
) -> Iterator[None]:
|
|
464
|
+
"""Catch warnings and append them to the issues list."""
|
|
465
|
+
with warnings.catch_warnings(record=True) as warning_logger:
|
|
466
|
+
warnings.simplefilter("always")
|
|
467
|
+
try:
|
|
468
|
+
yield None
|
|
469
|
+
finally:
|
|
470
|
+
if warning_logger and issues is not None:
|
|
471
|
+
issues.extend([warning_cls.from_warning(warning) for warning in warning_logger]) # type: ignore[misc]
|
{cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_rules/transformers/_verification.py
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import warnings
|
|
2
1
|
from abc import ABC
|
|
3
2
|
from collections.abc import Iterator
|
|
4
3
|
from contextlib import contextmanager
|
|
@@ -6,7 +5,7 @@ from typing import Any, Literal
|
|
|
6
5
|
|
|
7
6
|
from pydantic import ValidationError
|
|
8
7
|
|
|
9
|
-
from cognite.neat._issues import IssueList, MultiValueError, NeatError, NeatWarning
|
|
8
|
+
from cognite.neat._issues import IssueList, MultiValueError, NeatError, NeatWarning, catch_warnings
|
|
10
9
|
from cognite.neat._issues.errors import NeatTypeError
|
|
11
10
|
from cognite.neat._rules._shared import (
|
|
12
11
|
InputRules,
|
|
@@ -46,7 +45,7 @@ class VerificationTransformer(RulesTransformer[T_InputRules, T_VerifiedRules], A
|
|
|
46
45
|
if isinstance(rules, ReadRules):
|
|
47
46
|
error_args = rules.read_context
|
|
48
47
|
verified_rules: T_VerifiedRules | None = None
|
|
49
|
-
with
|
|
48
|
+
with _catch_issues(issues, NeatError, NeatWarning, error_args) as future:
|
|
50
49
|
rules_cls = self._get_rules_cls(in_)
|
|
51
50
|
verified_rules = rules_cls.model_validate(in_.dump()) # type: ignore[assignment]
|
|
52
51
|
|
|
@@ -105,7 +104,7 @@ class _FutureResult:
|
|
|
105
104
|
|
|
106
105
|
|
|
107
106
|
@contextmanager
|
|
108
|
-
def
|
|
107
|
+
def _catch_issues(
|
|
109
108
|
issues: IssueList,
|
|
110
109
|
error_cls: type[NeatError] = NeatError,
|
|
111
110
|
warning_cls: type[NeatWarning] = NeatWarning,
|
|
@@ -121,8 +120,7 @@ def _handle_issues(
|
|
|
121
120
|
Returns:
|
|
122
121
|
FutureResult: A future result object that can be used to check the result of the context manager.
|
|
123
122
|
"""
|
|
124
|
-
with
|
|
125
|
-
warnings.simplefilter("always")
|
|
123
|
+
with catch_warnings(issues, warning_cls):
|
|
126
124
|
future_result = _FutureResult()
|
|
127
125
|
try:
|
|
128
126
|
yield future_result
|
|
@@ -137,6 +135,3 @@ def _handle_issues(
|
|
|
137
135
|
future_result._result = "failure"
|
|
138
136
|
else:
|
|
139
137
|
future_result._result = "success"
|
|
140
|
-
finally:
|
|
141
|
-
if warning_logger:
|
|
142
|
-
issues.extend([warning_cls.from_warning(warning) for warning in warning_logger]) # type: ignore[misc]
|
|
@@ -53,6 +53,7 @@ class NeatSession:
|
|
|
53
53
|
self._state.verified_rules.append(output.rules)
|
|
54
54
|
if isinstance(output.rules, InformationRules):
|
|
55
55
|
self._state.store.add_rules(output.rules)
|
|
56
|
+
output.issues.action = "verify"
|
|
56
57
|
self._state.issue_lists.append(output.issues)
|
|
57
58
|
if output.issues:
|
|
58
59
|
print("You can inspect the issues with the .inspect.issues(...) method.")
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import difflib
|
|
2
|
+
from typing import Literal, overload
|
|
3
|
+
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from cognite.neat._constants import IN_NOTEBOOK
|
|
7
|
+
from cognite.neat._issues import IssueList
|
|
8
|
+
from cognite.neat._utils.upload import UploadResult, UploadResultCore, UploadResultList
|
|
9
|
+
|
|
10
|
+
from ._state import SessionState
|
|
11
|
+
from .exceptions import intercept_session_exceptions
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@intercept_session_exceptions
|
|
15
|
+
class InspectAPI:
|
|
16
|
+
def __init__(self, state: SessionState) -> None:
|
|
17
|
+
self._state = state
|
|
18
|
+
self.issues = InspectIssues(state)
|
|
19
|
+
self.outcome = InspectOutcome(state)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def properties(self) -> pd.DataFrame:
|
|
23
|
+
"""Returns the properties of the current data model."""
|
|
24
|
+
return self._state.last_verified_rule.properties.to_pandas()
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@intercept_session_exceptions
|
|
28
|
+
class InspectIssues:
|
|
29
|
+
"""Inspect issues of the current data model."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, state: SessionState) -> None:
|
|
32
|
+
self._state = state
|
|
33
|
+
|
|
34
|
+
@overload
|
|
35
|
+
def __call__(
|
|
36
|
+
self,
|
|
37
|
+
search: str | None = None,
|
|
38
|
+
return_dataframe: Literal[True] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
39
|
+
) -> pd.DataFrame: ...
|
|
40
|
+
|
|
41
|
+
@overload
|
|
42
|
+
def __call__(
|
|
43
|
+
self,
|
|
44
|
+
search: str | None = None,
|
|
45
|
+
return_dataframe: Literal[False] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
46
|
+
) -> None: ...
|
|
47
|
+
|
|
48
|
+
def __call__(
|
|
49
|
+
self,
|
|
50
|
+
search: str | None = None,
|
|
51
|
+
return_dataframe: bool = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
52
|
+
) -> pd.DataFrame | None:
|
|
53
|
+
"""Returns the issues of the current data model."""
|
|
54
|
+
issues = self._state.last_issues
|
|
55
|
+
if not issues:
|
|
56
|
+
self._print("No issues found.")
|
|
57
|
+
|
|
58
|
+
if issues and search is not None:
|
|
59
|
+
unique_types = {type(issue).__name__ for issue in issues}
|
|
60
|
+
closest_match = set(difflib.get_close_matches(search, unique_types))
|
|
61
|
+
issues = IssueList([issue for issue in issues if type(issue).__name__ in closest_match])
|
|
62
|
+
|
|
63
|
+
if IN_NOTEBOOK:
|
|
64
|
+
from IPython.display import Markdown, display
|
|
65
|
+
|
|
66
|
+
issue_str = "\n".join(
|
|
67
|
+
[f" * **{type(issue).__name__}**: {issue.as_message(include_type=False)}" for issue in issues]
|
|
68
|
+
)
|
|
69
|
+
message = f"### {len(issues)} issues found\n\n{issue_str}"
|
|
70
|
+
display(Markdown(message))
|
|
71
|
+
|
|
72
|
+
if return_dataframe:
|
|
73
|
+
return issues.to_pandas()
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
def _print(self, message: str) -> None:
|
|
77
|
+
if IN_NOTEBOOK:
|
|
78
|
+
from IPython.display import Markdown, display
|
|
79
|
+
|
|
80
|
+
display(Markdown(message))
|
|
81
|
+
else:
|
|
82
|
+
print(message)
|
|
83
|
+
|
|
84
|
+
def __repr__(self) -> str:
|
|
85
|
+
return self.__repr_html__()
|
|
86
|
+
|
|
87
|
+
def __repr_html__(self) -> str:
|
|
88
|
+
return (
|
|
89
|
+
"Inspect issues by calling .inspect.issues() or "
|
|
90
|
+
"search for specific issues by calling .inspect.issues('MyTypeWarning')."
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@intercept_session_exceptions
|
|
95
|
+
class InspectOutcome:
|
|
96
|
+
def __init__(self, state: SessionState) -> None:
|
|
97
|
+
self._state = state
|
|
98
|
+
|
|
99
|
+
@staticmethod
|
|
100
|
+
def _as_set(value: str | list[str] | None) -> set[str] | None:
|
|
101
|
+
if value is None:
|
|
102
|
+
return None
|
|
103
|
+
if isinstance(value, str):
|
|
104
|
+
return {value}
|
|
105
|
+
return set(value)
|
|
106
|
+
|
|
107
|
+
@overload
|
|
108
|
+
def __call__(
|
|
109
|
+
self,
|
|
110
|
+
name: str | list[str] | None = None,
|
|
111
|
+
has_errors: bool = False,
|
|
112
|
+
has_issues: bool = False,
|
|
113
|
+
return_dataframe: Literal[False] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
114
|
+
) -> None: ...
|
|
115
|
+
|
|
116
|
+
@overload
|
|
117
|
+
def __call__(
|
|
118
|
+
self,
|
|
119
|
+
name: str | list[str] | None = None,
|
|
120
|
+
has_errors: bool = False,
|
|
121
|
+
has_issues: bool = False,
|
|
122
|
+
return_dataframe: Literal[True] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
123
|
+
) -> pd.DataFrame: ...
|
|
124
|
+
|
|
125
|
+
def __call__(
|
|
126
|
+
self,
|
|
127
|
+
name: str | list[str] | None = None,
|
|
128
|
+
has_errors: bool = False,
|
|
129
|
+
has_issues: bool = False,
|
|
130
|
+
return_dataframe: bool = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
131
|
+
) -> pd.DataFrame | None:
|
|
132
|
+
"""Returns the outcome of the last upload."""
|
|
133
|
+
outcome = self._state.last_outcome
|
|
134
|
+
name_set = self._as_set(name)
|
|
135
|
+
|
|
136
|
+
def outcome_filter(item: UploadResultCore) -> bool:
|
|
137
|
+
nonlocal name_set
|
|
138
|
+
if name_set and item.name not in name_set:
|
|
139
|
+
return False
|
|
140
|
+
if has_errors and not item.error_messages:
|
|
141
|
+
return False
|
|
142
|
+
if has_issues and not item.issues:
|
|
143
|
+
return False
|
|
144
|
+
return True
|
|
145
|
+
|
|
146
|
+
outcome = UploadResultList([item for item in outcome if outcome_filter(item)])
|
|
147
|
+
if IN_NOTEBOOK:
|
|
148
|
+
from IPython.display import Markdown, display
|
|
149
|
+
|
|
150
|
+
lines: list[str] = []
|
|
151
|
+
for item in outcome:
|
|
152
|
+
lines.append(f"### {item.name}")
|
|
153
|
+
if unique_errors := set(item.error_messages):
|
|
154
|
+
lines.append("#### Errors")
|
|
155
|
+
for error in unique_errors:
|
|
156
|
+
lines.append(f" * {error}")
|
|
157
|
+
if unique_issue_messages := set([issue.as_message() for issue in item.issues]):
|
|
158
|
+
lines.append("#### Issues")
|
|
159
|
+
for issue in unique_issue_messages:
|
|
160
|
+
lines.append(f" * {issue}")
|
|
161
|
+
if isinstance(item, UploadResult):
|
|
162
|
+
dumped = item.dump(aggregate=False)
|
|
163
|
+
for key, value in dumped.items():
|
|
164
|
+
if key in ["name", "error_messages", "issues"]:
|
|
165
|
+
continue
|
|
166
|
+
lines.append(f"#### {key}")
|
|
167
|
+
if isinstance(value, list):
|
|
168
|
+
for v in value:
|
|
169
|
+
lines.append(f" * {v}")
|
|
170
|
+
else:
|
|
171
|
+
lines.append(f" * {value}")
|
|
172
|
+
|
|
173
|
+
display(Markdown("\n".join(lines)))
|
|
174
|
+
|
|
175
|
+
if return_dataframe:
|
|
176
|
+
return outcome.to_pandas()
|
|
177
|
+
return None
|
|
@@ -7,6 +7,7 @@ from cognite.neat._rules.models.dms._rules import DMSRules
|
|
|
7
7
|
from cognite.neat._rules.models.information._rules import InformationRules
|
|
8
8
|
from cognite.neat._rules.models.information._rules_input import InformationInputRules
|
|
9
9
|
from cognite.neat._store import NeatGraphStore
|
|
10
|
+
from cognite.neat._utils.upload import UploadResultList
|
|
10
11
|
|
|
11
12
|
from .exceptions import NeatSessionError
|
|
12
13
|
|
|
@@ -17,6 +18,7 @@ class SessionState:
|
|
|
17
18
|
input_rules: list[ReadRules] = field(default_factory=list)
|
|
18
19
|
verified_rules: list[VerifiedRules] = field(default_factory=list)
|
|
19
20
|
issue_lists: list[IssueList] = field(default_factory=list)
|
|
21
|
+
outcome: list[UploadResultList] = field(default_factory=list)
|
|
20
22
|
_store: NeatGraphStore | None = field(init=False, default=None)
|
|
21
23
|
|
|
22
24
|
@property
|
|
@@ -34,6 +36,14 @@ class SessionState:
|
|
|
34
36
|
raise NeatSessionError("No input data model available. Try using [bold].read[/bold] to load a data model.")
|
|
35
37
|
return self.input_rules[-1]
|
|
36
38
|
|
|
39
|
+
@property
|
|
40
|
+
def last_outcome(self) -> UploadResultList:
|
|
41
|
+
if not self.outcome:
|
|
42
|
+
raise NeatSessionError(
|
|
43
|
+
"No outcome available. Try using [bold].to.cdf[/bold] to upload a data model/instances."
|
|
44
|
+
)
|
|
45
|
+
return self.outcome[-1]
|
|
46
|
+
|
|
37
47
|
@property
|
|
38
48
|
def information_input_rule(self) -> ReadRules | None:
|
|
39
49
|
if self.input_rules:
|
|
@@ -4,8 +4,10 @@ from typing import Any, Literal, overload
|
|
|
4
4
|
from cognite.client import CogniteClient
|
|
5
5
|
|
|
6
6
|
from cognite.neat._graph import loaders
|
|
7
|
+
from cognite.neat._issues import IssueList, catch_warnings
|
|
7
8
|
from cognite.neat._rules import exporters
|
|
8
9
|
from cognite.neat._session._wizard import space_wizard
|
|
10
|
+
from cognite.neat._utils.upload import UploadResultCore
|
|
9
11
|
|
|
10
12
|
from ._state import SessionState
|
|
11
13
|
from .exceptions import intercept_session_exceptions
|
|
@@ -61,11 +63,19 @@ class CDFToAPI:
|
|
|
61
63
|
|
|
62
64
|
return loader.load_into_cdf(self._client)
|
|
63
65
|
|
|
64
|
-
def data_model(self, existing_handling: Literal["fail", "skip", "update", "force"] = "skip"):
|
|
66
|
+
def data_model(self, existing_handling: Literal["fail", "skip", "update", "force"] = "skip", dry_run: bool = False):
|
|
65
67
|
"""Export the verified DMS data model to CDF.
|
|
66
68
|
|
|
67
69
|
Args:
|
|
68
70
|
existing_handling: How to handle if component of data model exists. Defaults to "skip".
|
|
71
|
+
dry_run: If True, no changes will be made to CDF. Defaults to False.
|
|
72
|
+
|
|
73
|
+
... note::
|
|
74
|
+
|
|
75
|
+
- "fail": If any component already exists, the export will fail.
|
|
76
|
+
- "skip": If any component already exists, it will be skipped.
|
|
77
|
+
- "update": If any component already exists, it will be updated.
|
|
78
|
+
- "force": If any component already exists, it will be deleted and recreated.
|
|
69
79
|
|
|
70
80
|
"""
|
|
71
81
|
if not self._state.last_verified_dms_rules:
|
|
@@ -76,4 +86,10 @@ class CDFToAPI:
|
|
|
76
86
|
if not self._client:
|
|
77
87
|
raise ValueError("No client provided!")
|
|
78
88
|
|
|
79
|
-
|
|
89
|
+
conversion_issues = IssueList(action="to.cdf.data_model")
|
|
90
|
+
with catch_warnings(conversion_issues):
|
|
91
|
+
result = exporter.export_to_cdf(self._state.last_verified_dms_rules, self._client, dry_run)
|
|
92
|
+
result.insert(0, UploadResultCore(name="schema", issues=conversion_issues))
|
|
93
|
+
self._state.outcome.append(result)
|
|
94
|
+
print("You can inspect the details with the .inspect.outcome(...) method.")
|
|
95
|
+
return result
|
|
@@ -3,7 +3,7 @@ from dataclasses import dataclass, field
|
|
|
3
3
|
from functools import total_ordering
|
|
4
4
|
from typing import Any, Generic
|
|
5
5
|
|
|
6
|
-
from cognite.neat._issues import
|
|
6
|
+
from cognite.neat._issues import IssueList
|
|
7
7
|
from cognite.neat._shared import T_ID, NeatList, NeatObject
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ from cognite.neat._shared import T_ID, NeatList, NeatObject
|
|
|
12
12
|
class UploadResultCore(NeatObject, ABC):
|
|
13
13
|
name: str
|
|
14
14
|
error_messages: list[str] = field(default_factory=list)
|
|
15
|
-
issues:
|
|
15
|
+
issues: IssueList = field(default_factory=IssueList)
|
|
16
16
|
|
|
17
17
|
def __lt__(self, other: object) -> bool:
|
|
18
18
|
if isinstance(other, UploadResultCore):
|
|
@@ -27,10 +27,19 @@ class UploadResultCore(NeatObject, ABC):
|
|
|
27
27
|
return NotImplemented
|
|
28
28
|
|
|
29
29
|
def dump(self, aggregate: bool = True) -> dict[str, Any]:
|
|
30
|
-
|
|
30
|
+
output: dict[str, Any] = {"name": self.name}
|
|
31
|
+
if self.error_messages:
|
|
32
|
+
output["error_messages"] = len(self.error_messages) if aggregate else self.error_messages
|
|
33
|
+
if self.issues:
|
|
34
|
+
output["issues"] = len(self.issues) if aggregate else [issue.dump() for issue in self.issues]
|
|
35
|
+
return output
|
|
31
36
|
|
|
32
37
|
|
|
33
|
-
class UploadResultList(NeatList[UploadResultCore]):
|
|
38
|
+
class UploadResultList(NeatList[UploadResultCore]):
|
|
39
|
+
def _repr_html_(self) -> str:
|
|
40
|
+
df = self.to_pandas().fillna(0)
|
|
41
|
+
df = df.style.format({column: "{:,.0f}".format for column in df.select_dtypes(include="number").columns})
|
|
42
|
+
return df._repr_html_() # type: ignore[attr-defined]
|
|
34
43
|
|
|
35
44
|
|
|
36
45
|
@dataclass
|
|
@@ -85,10 +94,12 @@ class UploadResult(UploadResultCore, Generic[T_ID]):
|
|
|
85
94
|
output["failed_changed"] = len(self.failed_changed) if aggregate else list(self.failed_changed)
|
|
86
95
|
if self.failed_deleted:
|
|
87
96
|
output["failed_deleted"] = len(self.failed_deleted) if aggregate else list(self.failed_deleted)
|
|
88
|
-
if
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
if "error_messages" in output:
|
|
98
|
+
# Trick to move error_messages to the end of the dict
|
|
99
|
+
output["error_messages"] = output.pop("error_messages")
|
|
100
|
+
if "issues" in output:
|
|
101
|
+
# Trick to move issues to the end of the dict
|
|
102
|
+
output["issues"] = output.pop("issues")
|
|
92
103
|
return output
|
|
93
104
|
|
|
94
105
|
def __str__(self) -> str:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.96.3"
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import difflib
|
|
2
|
-
from typing import Literal, overload
|
|
3
|
-
|
|
4
|
-
import pandas as pd
|
|
5
|
-
|
|
6
|
-
from cognite.neat._constants import IN_NOTEBOOK
|
|
7
|
-
from cognite.neat._issues import IssueList
|
|
8
|
-
|
|
9
|
-
from ._state import SessionState
|
|
10
|
-
from .exceptions import intercept_session_exceptions
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@intercept_session_exceptions
|
|
14
|
-
class InspectAPI:
|
|
15
|
-
def __init__(self, state: SessionState) -> None:
|
|
16
|
-
self._state = state
|
|
17
|
-
self.issues = InspectIssues(state)
|
|
18
|
-
|
|
19
|
-
@property
|
|
20
|
-
def properties(self) -> pd.DataFrame:
|
|
21
|
-
"""Returns the properties of the current data model."""
|
|
22
|
-
return self._state.last_verified_rule.properties.to_pandas()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@intercept_session_exceptions
|
|
26
|
-
class InspectIssues:
|
|
27
|
-
"""Inspect issues of the current data model."""
|
|
28
|
-
|
|
29
|
-
def __init__(self, state: SessionState) -> None:
|
|
30
|
-
self._state = state
|
|
31
|
-
|
|
32
|
-
@overload
|
|
33
|
-
def __call__(
|
|
34
|
-
self,
|
|
35
|
-
search: str | None = None,
|
|
36
|
-
return_dataframe: Literal[True] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
37
|
-
) -> pd.DataFrame: ...
|
|
38
|
-
|
|
39
|
-
@overload
|
|
40
|
-
def __call__(
|
|
41
|
-
self,
|
|
42
|
-
search: str | None = None,
|
|
43
|
-
return_dataframe: Literal[False] = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
44
|
-
) -> None: ...
|
|
45
|
-
|
|
46
|
-
def __call__(
|
|
47
|
-
self,
|
|
48
|
-
search: str | None = None,
|
|
49
|
-
return_dataframe: bool = (False if IN_NOTEBOOK else True), # type: ignore[assignment]
|
|
50
|
-
) -> pd.DataFrame | None:
|
|
51
|
-
"""Returns the issues of the current data model."""
|
|
52
|
-
issues = self._state.last_issues
|
|
53
|
-
if not issues:
|
|
54
|
-
self._print("No issues found.")
|
|
55
|
-
|
|
56
|
-
if issues and search is not None:
|
|
57
|
-
unique_types = {type(issue).__name__ for issue in issues}
|
|
58
|
-
closest_match = set(difflib.get_close_matches(search, unique_types))
|
|
59
|
-
issues = IssueList([issue for issue in issues if type(issue).__name__ in closest_match])
|
|
60
|
-
|
|
61
|
-
if IN_NOTEBOOK:
|
|
62
|
-
from IPython.display import Markdown, display
|
|
63
|
-
|
|
64
|
-
issue_str = "\n".join(
|
|
65
|
-
[f" * **{type(issue).__name__}**: {issue.as_message(include_type=False)}" for issue in issues]
|
|
66
|
-
)
|
|
67
|
-
message = f"### {len(issues)} issues found\n\n{issue_str}"
|
|
68
|
-
display(Markdown(message))
|
|
69
|
-
|
|
70
|
-
if return_dataframe:
|
|
71
|
-
return issues.to_pandas()
|
|
72
|
-
return None
|
|
73
|
-
|
|
74
|
-
def _print(self, message: str) -> None:
|
|
75
|
-
if IN_NOTEBOOK:
|
|
76
|
-
from IPython.display import Markdown, display
|
|
77
|
-
|
|
78
|
-
display(Markdown(message))
|
|
79
|
-
else:
|
|
80
|
-
print(message)
|
|
81
|
-
|
|
82
|
-
def __repr__(self) -> str:
|
|
83
|
-
return self.__repr_html__()
|
|
84
|
-
|
|
85
|
-
def __repr_html__(self) -> str:
|
|
86
|
-
return (
|
|
87
|
-
"Inspect issues by calling .inspect.issues() or "
|
|
88
|
-
"search for specific issues by calling .inspect.issues('MyTypeWarning')."
|
|
89
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.96.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/context_manager/__init__.py
RENAMED
|
File without changes
|
{cognite_neat-0.96.2 → cognite_neat-0.96.3}/cognite/neat/_app/api/context_manager/manager.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
|