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

annoying error messages when exiting script using pyhf #1553

Closed
tancredicarli opened this issue Aug 18, 2021 · 3 comments · Fixed by #1530
Closed

annoying error messages when exiting script using pyhf #1553

tancredicarli opened this issue Aug 18, 2021 · 3 comments · Fixed by #1530
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@tancredicarli
Copy link

tancredicarli commented Aug 18, 2021

I am using pyhf, version 0.6.2. I have a simple script that loads a workspace from a json file. When exiting I get some
strange error messages. Otherwise the program runs ok.
The messages are:

Exception ignored in: <function WeakMethod.__new__.<locals>._cb at 0x7fb987f11dc0>
Traceback (most recent call last):
  File "/usr/lib/python3.8/weakref.py", line 58, in _cb
  File "/usr/lib/python3.8/weakref.py", line 74, in __eq__
TypeError: isinstance() arg 2 must be a type or tuple of types
Exception ignored in: <function WeakMethod.__new__.<locals>._cb at 0x7fb987f11af0>
Traceback (most recent call last):

The script is as follows:

import pyhf
import json

filename = "atlas_jet2015_cifital_eta_1_Lambda_20_TeV"
# read json describing the workspace
with open(filename + ".txt") as serialized:
    spec = json.load(serialized)

# create workspace
workspace = pyhf.Workspace(spec)
print(json.dumps(workspace, indent=2))
model = workspace.model()
@kratsg
Copy link
Contributor

kratsg commented Aug 18, 2021

Can you provide python3 -m pip list? #1530 exists to try to fix this (see #1506). One current solution we've found is to downgrade Click -- e.g.

python3 -m pip install click~=7.0

should be a current stop-gap.

@kratsg kratsg self-assigned this Aug 18, 2021
@kratsg kratsg added the bug Something isn't working label Aug 18, 2021
@kratsg kratsg linked a pull request Aug 18, 2021 that will close this issue
4 tasks
@matthewfeickert
Copy link
Member

matthewfeickert commented Aug 18, 2021

Yeah, closing this as it is duplicate of Issue #1506. If you have additional follow up or questions please use that Issue. As @kratsg already said, if you downgrade Click to <8.0 this will go away.

@matthewfeickert matthewfeickert added the duplicate This issue or pull request already exists label Aug 18, 2021
@tancredicarli
Copy link
Author

tancredicarli commented Aug 18, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants