imas.ids_factory.IDSFactory

class imas.ids_factory.IDSFactory(version: str | None = None, xml_path: str | Path | None = None)

Bases: object

Factory class generating IDSToplevel elements for specific DD versions.

Example:

>>> factory = IDSFactory()
>>> factory.core_profiles()
<imas.ids_toplevel.IDSToplevel object at 0x7f6afa03cdf0>
>>> factory.new("core_profiles")
<imas.ids_toplevel.IDSToplevel object at 0x7f6afa03ccd0>
__init__(version: str | None = None, xml_path: str | Path | None = None)

Create a new IDS Factory

See imas.dd_zip.dd_etree() for further details on the version and xml_path arguments.

Parameters:
version: str | None = None

DD version string, e.g. “3.38.1”.

xml_path: str | Path | None = None

XML file containing data dictionary definition.

Methods

__init__([version, xml_path])

Create a new IDS Factory

exists(ids_name)

Check if an IDS type with the given name exists.

ids_names()

Get a list of all known IDS names in the loaded Data Dictionary

new(ids_name, *[, _lazy])

Create a new IDSToplevel element for the provided IDS name

Attributes

dd_version

Get the DD version used by this IDS factory

version

Get the DD version used by this IDS factory

property dd_version : str

Get the DD version used by this IDS factory

exists(ids_name: str) bool

Check if an IDS type with the given name exists.

ids_names() list[str]

Get a list of all known IDS names in the loaded Data Dictionary

new(ids_name: str, *, _lazy: bool = False) IDSToplevel

Create a new IDSToplevel element for the provided IDS name

Parameters:
ids_name: str

Name of the IDS toplevel to create, e.g. “core_profiles”.

Keyword Arguments:
_lazy: bool = False

Internal usage only! Create an IDS Toplevel suitable for lazy loading when set to True.

property version : str

Get the DD version used by this IDS factory


Last update: 2026-01-28