Skip to content

Troubleshooting test error #94

@Nush395

Description

@Nush395

Setup:
imas_core: 5.5.3
imas: 2.1.0-post1
imas_data_dictionaries: 4.0.0

We're in the process of linking imas-python to imas-core now that it's open sourced. There are several requires_imas tests that now run that previously weren't being run in our CI. One class of errors we're now seeing is:

failed on setup with "imas.exception.DataEntryException: IDS 'equilibrium', occurrence 0 is empty."
requires_imas = None

    @pytest.fixture
    def test_data(requires_imas):
>       db_entry = imas.training.get_training_db_entry()

[test/test_ids_ascii_data](http://test/test_ids_ascii_data).py:22: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
training.py:22: in get_training_db_entry
    ids = entry.get(ids_name, autoconvert=False)
db_entry.py:356: in get
    return self._get(
db_entry.py:568: in _get
    dd_version = self._dbe_impl.read_dd_version(ids_name, occurrence)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <imas.backends.imas_core.db_entry_al.ALDBEntryImpl object at 0x12643ce82db0>
ids_name = 'equilibrium', occurrence = 0

    def read_dd_version(self, ids_name: str, occurrence: int) -> str:
        if self._db_ctx is None:
            raise RuntimeError("Database entry is not open.")
        # Mixing contexts can be problematic, ensure all lazy contexts are closed:
        self._clear_lazy_ctx_cache()
    
        ll_path = ids_name
        if occurrence != 0:
            ll_path += f"/{occurrence}"
    
        datapath = "ids_properties" if self.backend == "uda" else ""
        with self._db_ctx.global_action(ll_path, READ_OP, datapath) as read_ctx:
            time_mode_path = "ids_properties/homogeneous_time"
            time_mode = read_ctx.read_data(time_mode_path, "", INTEGER_DATA, 0)
            dd_version_path = "ids_properties/version_put/data_dictionary"
            dd_version = read_ctx.read_data(dd_version_path, "", CHAR_DATA, 1)
    
        if time_mode not in IDS_TIME_MODES:
>           raise DataEntryException(
                f"IDS {ids_name!r}, occurrence {occurrence} is empty."
            )
E           imas.exception.DataEntryException: IDS 'equilibrium', occurrence 0 is empty.

backends/imas_core/db_entry_al.py:268: DataEntryException

Do you have any advice on what is going wrong here/how to debug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions