Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: Failed to get attribute TPyMultiGenFunction from ROOT for ROOT 6.22 #151

Open
guiguem opened this issue Sep 29, 2020 · 2 comments · Fixed by #152
Open

AttributeError: Failed to get attribute TPyMultiGenFunction from ROOT for ROOT 6.22 #151

guiguem opened this issue Sep 29, 2020 · 2 comments · Fixed by #152
Labels

Comments

@guiguem
Copy link
Contributor

guiguem commented Sep 29, 2020

Describe the bug
When using ROOT 6.22, one gets the following error when loading morpho:


RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

Traceback (most recent call last):
  File "fake_data_stan_analysis.py", line 20, in <module>
    from morpho.utilities import morphologging
  File "/usr/local/lib/python3.8/site-packages/morpho/__init__.py", line 24, in <module>
    module = loader.find_module(name).load_module(name)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/__init__.py", line 7, in <module>
    from . import diagnostics
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/diagnostics/__init__.py", line 6, in <module>
    from .CalibrationProcessor import CalibrationProcessor
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/diagnostics/CalibrationProcessor.py", line 16, in <module>
    from morpho.processors import BaseProcessor
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/__init__.py", line 11, in <module>
    from . import sampling
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/sampling/__init__.py", line 11, in <module>
    from .PyBindRooFitProcessor import PyBindRooFitProcessor
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 121, in _importhook
    return _orig_ihook(name, *args, **kwds)
  File "/usr/local/lib/python3.8/site-packages/morpho/processors/sampling/PyBindRooFitProcessor.py", line 22, in <module>
    class PyFunctionObject(ROOT.TPyMultiGenFunction):
  File "/usr/local/Cellar/root/6.22.02/lib/root/ROOT/_facade.py", line 163, in _fallback_getattr
    raise AttributeError("Failed to get attribute {} from ROOT".format(name))
AttributeError: Failed to get attribute TPyMultiGenFunction from ROOT

Morpho version
v2.7.1

Additional context
This class was removed from ROOT and replaced: see https://root.cern/doc/v622/release-notes.html#release-6.2202

@guiguem guiguem added the bug label Sep 29, 2020
@nsoblath
Copy link
Contributor

https://root.cern/doc/v622/release-notes.html#pyroot

It looks like the inheritance of PyFunctionObject needs to be changed to be from ROOT.IMultiGenFunction instead of ROOT.TPyMultiGenFunction. Probably there should be some detection of whether the latter exists to do the inheritance right.

@guiguem
Copy link
Contributor Author

guiguem commented Sep 30, 2020

Indeed, this is what I meant in the additional context section.
I think this is easy to change (they also give an example on how to adapt people's code), this needs to be tested though :)

@nsoblath nsoblath mentioned this issue Jul 7, 2021
@nsoblath nsoblath linked a pull request Jul 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants