Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an configuration option to turn off property mappings in the generate strategy #328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions oteapi_dlite/strategies/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,29 @@ class DLiteStorageConfig(DLiteConfiguration):
),
),
] = None
property_mappings: Annotated[
bool,
Field(
description="Whether property mappings should be performed.",
),
] = True
store_collection: Annotated[
bool,
Field(
description="Whether to store the entire collection in the session "
"instead of a single instance. Cannot be combined with `label` or "
"`datamodel`.",
description=(
"Whether to store the entire collection in the session "
"instead of a single instance. Cannot be combined with "
"`label` or `datamodel`."
),
),
] = False
store_collection_id: Annotated[
Optional[str],
Field(
description="Used together with `store_collection` If given, store "
"a copy of the collection with this id.",
description=(
"Used together with `store_collection` If given, store "
"a copy of the collection with this id."
),
),
] = None
allow_incomplete: Annotated[
Expand Down Expand Up @@ -287,7 +297,7 @@ def get(self) -> DLiteResult:
elif config.datamodel:
instances = coll.get_instances(
metaid=config.datamodel,
property_mappings=True,
property_mappings=config.property_mappings,
allow_incomplete=config.allow_incomplete,
)
inst = next(instances)
Expand Down
Loading