Skip to content

Bug in serialisation of minimizer fit report objects #97

@SpaceMan013

Description

@SpaceMan013

Unpickling stage fails for the minimizer fit reports generated by a script while with a notebook with interactive progressbar there are no problems. Likely cause is the progressbar behaving differently on jupyter notebooks and python scripts. (See slack discussion)

---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
Cell In[10], line 1
----> 1 minuit_fit_report=FitResults.load_report(report_file)

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/jetset/minimizer.py:171, in FitResults.load_report(cls, file_name)
    169 @classmethod
    170 def load_report(cls,file_name):
--> 171     c = pickle.load(open(file_name, "rb"))
    172     return c

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/dill/_dill.py:297, in load(file, ignore, **kwds)
    291 def load(file, ignore=None, **kwds):
    292     """
    293     Unpickle an object from a file.
    294 
    295     See :func:`loads` for keyword arguments.
    296     """
--> 297     return Unpickler(file, ignore=ignore, **kwds).load()

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/dill/_dill.py:452, in Unpickler.load(self)
    451 def load(self): #NOTE: if settings change, need to update attributes
--> 452     obj = StockUnpickler.load(self)
    453     if type(obj).__module__ == getattr(_main_module, '__name__', '__main__'):
    454         if not self._ignore:
    455             # point obj class to main

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/tqdm/utils.py:140, in ObjectWrapper.__getattr__(self, name)
    139 def __getattr__(self, name):
--> 140     return getattr(self._wrapped, name)

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/tqdm/utils.py:140, in ObjectWrapper.__getattr__(self, name)
    139 def __getattr__(self, name):
--> 140     return getattr(self._wrapped, name)

    [... skipping similar frames: ObjectWrapper.__getattr__ at line 140 (2966 times)]

File /media/spaceman/Data/miniconda3/envs/jetset_v13x/lib/python3.11/site-packages/tqdm/utils.py:140, in ObjectWrapper.__getattr__(self, name)
    139 def __getattr__(self, name):
--> 140     return getattr(self._wrapped, name)

RecursionError: maximum recursion depth exceeded

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions