-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: Remove WeakList in favor of built-ins #1530
fix: Remove WeakList in favor of built-ins #1530
Conversation
I think something is going wrong with the $ python -m pytest -x -r sx --ignore tests/benchmarks/ --ignore tests/contrib --ignore tests/test_notebooks.py src/pyhf/infer/utils.py .. [ 3%]
src/pyhf/tensor/jax_backend.py F
================================================================================================ FAILURES =================================================================================================
_________________________________________________________________________ [doctest] pyhf.tensor.jax_backend.jax_backend.astensor __________________________________________________________________________
201
202 Convert to a JAX ndarray.
203
204 Example:
205
206 >>> import pyhf
207 >>> pyhf.set_backend("jax")
UNEXPECTED EXCEPTION: TypeError("'NoneType' object is not callable")
Traceback (most recent call last):
File "/home/feickert/.pyenv/versions/3.8.6/lib/python3.8/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest pyhf.tensor.jax_backend.jax_backend.astensor[1]>", line 1, in <module>
File "/home/feickert/Code/GitHub/pyhf/src/pyhf/events.py", line 122, in register_wrapper
result = func(*args, **kwargs)
File "/home/feickert/Code/GitHub/pyhf/src/pyhf/__init__.py", line 147, in set_backend
events.trigger("tensorlib_changed")()
File "/home/feickert/Code/GitHub/pyhf/src/pyhf/events.py", line 53, in __call__
func()(*args, **kwargs)
TypeError: 'NoneType' object is not callable
/home/feickert/Code/GitHub/pyhf/src/pyhf/tensor/jax_backend.py:207: UnexpectedException but $ pytest -x --doctest-modules src/pyhf/infer/utils.py src/pyhf/tensor/numpy_backend.py src/pyhf/tensor/jax_backend.py runs fine. |
for more information, see https://pre-commit.ci
This reverts commit 9c3e558.
2ed43bc
to
c92ed63
Compare
Codecov Report
@@ Coverage Diff @@
## master #1530 +/- ##
==========================================
+ Coverage 97.66% 97.70% +0.03%
==========================================
Files 63 63
Lines 4024 4050 +26
Branches 572 576 +4
==========================================
+ Hits 3930 3957 +27
+ Misses 55 54 -1
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Just putting a note that coverage needs to be fixed, but this is confirmed to work by @alexander-held . |
Once this is in and we're happy with it working let's cut a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure that I'm missing the obvious here, but if this isn't already being hit anywhere in CI then what are the types of events that would trigger this?
The removal still passes CI and the following
# /tmp/test.py
import pyhf
model = pyhf.simplemodels.uncorrelated_background(
signal=[5.0], bkg=[10.0], bkg_uncertainty=[2.0]
)
pyhf.set_backend("jax", "minuit")
model = pyhf.simplemodels.uncorrelated_background(
signal=[5.0], bkg=[10.0], bkg_uncertainty=[2.0]
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highest of fives @kratsg. This is great. :)
Also thanks for these tests as this better shows me how to do things with Mock
. 👍
Description
Resolves #1506
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: