Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/source/multi-dd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ example:
factory_3_32_0 = imas.IDSFactory("3.32.0") # Use DD version 3.32.0

# Will write IDSs to the backend in DD version 3.32.0
dbentry = imas.DBEntry(imas.ids_defs.HDF5_BACKEND, "TEST", 10, 2, version="3.32.0")
dbentry = imas.DBEntry("imas:hdf5?path=dd3.32.0-output/", "w", dd_version="3.32.0")
dbentry.create()

.. seealso:: :ref:`multi-dd training`
Expand Down
11 changes: 11 additions & 0 deletions imas/backends/imas_core/db_entry_al.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from packaging.version import Version

import imas
from imas.backends.db_entry_impl import GetSampleParameters, GetSliceParameters
from imas.db_entry import DBEntryImpl
from imas.exception import DataEntryException, LowlevelError
Expand Down Expand Up @@ -280,6 +281,16 @@ def put(self, ids: IDSToplevel, occurrence: int, is_slice: bool) -> None:
# Create a version conversion map, if needed
nbc_map = None
if ids._version != self._ids_factory._version:
if ids._version.split(".")[0] != self._ids_factory._version.split(".")[0]:
logger.warning(
"Provided IDS uses DD %s which has a different major version than "
"the Data Entry (%s). IMAS-Python will convert the data "
"automatically, but this does not cover all changes. "
"See %s/multi-dd.html#conversion-of-idss-between-dd-versions",
ids._version,
self._ids_factory._version,
imas.PUBLISHED_DOCUMENTATION_ROOT,
)
ddmap, source_is_older = dd_version_map_from_factories(
ids_name, ids._parent, self._ids_factory
)
Expand Down
Loading