Skip to content

dataset.options broken #330

Description

@mikekryjak

Using commit c5cd2ee (before the h5netcdf upgrade) and loading a simple Hermes-3 slab dataset, accessing ds.options results in an error.

case = "neutlim-base-init_only"
ds = xbout.load.open_boutdataset(
    datapath = rf"/home/mike/work/cases/devtests/{case}/BOUT.dmp.0.nc",
    inputfilepath= rf"/home/mike/work/cases/devtests/{case}/BOUT.inp",
    keep_xboundaries = True,
    keep_yboundaries = True,
    info = False,
)

ds.options

Backtrace:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
File ~/pyenvs/base-3.12.5/lib/python3.12/site-packages/IPython/core/formatters.py:770, in PlainTextFormatter.__call__(self, obj)
    763 stream = StringIO()
    764 printer = pretty.RepresentationPrinter(stream, self.verbose,
    765     self.max_width, self.newline,
    766     max_seq_length=self.max_seq_length,
    767     singleton_pprinters=self.singleton_printers,
    768     type_pprinters=self.type_printers,
    769     deferred_pprinters=self.deferred_printers)
--> 770 printer.pretty(obj)
    771 printer.flush()
    772 return stream.getvalue()

File ~/pyenvs/base-3.12.5/lib/python3.12/site-packages/IPython/lib/pretty.py:420, in RepresentationPrinter.pretty(self, obj)
    409                         return meth(obj, self, cycle)
    410                 if (
    411                     cls is not object
    412                     # check if cls defines __repr__
   (...)    418                     and callable(_safe_getattr(cls, "__repr__", None))
    419                 ):
--> 420                     return _repr_pprint(obj, self, cycle)
    422     return _default_pprint(obj, self, cycle)
    423 finally:

File ~/pyenvs/base-3.12.5/lib/python3.12/site-packages/IPython/lib/pretty.py:795, in _repr_pprint(obj, p, cycle)
    793 """A pprint that just redirects to the normal repr function."""
    794 # Find newlines and replace them with p.break_()
--> 795 output = repr(obj)
    796 lines = output.splitlines()
    797 with p.group():

TypeError: __repr__ returned non-string (type dict)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions