Skip to content

Commit

Permalink
refactor: script and moved feature preview out
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino committed Jul 25, 2024
1 parent 22623bf commit cd41e63
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cognite/client/data_classes/cdm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from __future__ import annotations

from cognite.client.utils._experimental import FeaturePreviewWarning

FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn()
3 changes: 0 additions & 3 deletions cognite/client/data_classes/cdm/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
TypedNode,
TypedNodeApply,
)
from cognite.client.utils._experimental import FeaturePreviewWarning

FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn()


class CogniteDescribableProperties:
Expand Down
23 changes: 23 additions & 0 deletions scripts/generate_core_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""This script requires pygen to be installed. It generates typed classes for the core data model v1.
`pip install cognite-pygen==0.99.28`
"""

from pathlib import Path

from cognite.pygen._generator import generate_typed
from tests.tests_integration.conftest import make_cognite_client

THIS_REPO = Path(__file__).resolve().parent.parent

OUTPUT_FILE = THIS_REPO / "cognite" / "client" / "data_classes" / "cdm" / "v1.py"


def main() -> None:
client = make_cognite_client(beta=False)

generate_typed(("cdf_cdm_experimental", "core_data_model", "v1"), OUTPUT_FILE, client, format_code=False)


if __name__ == "__main__":
main()

0 comments on commit cd41e63

Please sign in to comment.