gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 14 forks source link

load function of ODS obj is not respecting its setting #302

Closed kripnerl closed 1 month ago

kripnerl commented 3 months ago

l. 2118 of omas_core.py:

    def load(self, *args, **kw):
        r"""
        Load OMAS data

        :param filename: filename.XXX where the extension is used to select load format method (eg. 'pkl','nc','h5','ds','json','ids')
                         set to `imas`, `s3`, `hdc`, `mongo` for save methods that do not have a filename with extension

        :param consistency_check: perform consistency check once the data is loaded

        :param \*args: extra arguments passed to load_omas_XXX() method

        :param \**kw: extra keywords passed to load_omas_XXX() method

        :return: ODS with loaded data
        """
        # figure out format used
        ext, args = _handle_extension(*args)

        # manage consistency_check logic
        if 'consistency_check' in kw:
            consistency_check = kw['consistency_check']
        else:
            consistency_check = self.consistency_check
        if self.location:
            kw['consistency_check'] = False
        else:
            kw['consistency_check'] = consistency_check

        # load the data
        results = eval('load_omas_' + ext)(*args, **kw)
                                                                    ^^^^^^^^^^

is considering only self.consistency_check, but not other args/kwargs of original ODS - like imas_version.

If this is a design decision, it should be highlighted by documentation.

github-actions[bot] commented 1 month ago

Stale issue message