-
Notifications
You must be signed in to change notification settings - Fork 81
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
GitHub Actions only error: AttributeError("'NoneType' object has no attribute '_sorted_indices'") #2015
Comments
@kratsg @lukasheinrich If I run our CI from scratch inside of a
|
Expanding on #1274 (comment), this is able to be reproduced locally if one comments out one of the docstrings of any of the 3 functions under the > git diff
diff --git a/src/pyhf/infer/intervals/upper_limits.py b/src/pyhf/infer/intervals/upper_limits.py
index 5cc93c13..c609091b 100644
--- a/src/pyhf/infer/intervals/upper_limits.py
+++ b/src/pyhf/infer/intervals/upper_limits.py
@@ -33,22 +33,22 @@ def toms748_scan(
Parameter of Interest (POI) using an automatic scan through
POI-space, using the :func:`~scipy.optimize.toms748` algorithm.
- Example:
- >>> import numpy as np
- >>> import pyhf
- >>> pyhf.set_backend("numpy")
- >>> model = pyhf.simplemodels.uncorrelated_background(
- ... signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0]
- ... )
- >>> observations = [51, 48]
- >>> data = pyhf.tensorlib.astensor(observations + model.config.auxdata)
- >>> obs_limit, exp_limits = pyhf.infer.intervals.upper_limits.toms748_scan(
- ... data, model, 0., 5., rtol=0.01
- ... )
- >>> obs_limit
- array(1.01156939)
- >>> exp_limits
- [array(0.5600747), array(0.75702605), array(1.06234693), array(1.50116923), array(2.05078912)]
+ # Example:
+ # >>> import numpy as np
+ # >>> import pyhf
+ # >>> pyhf.set_backend("numpy")
+ # >>> model = pyhf.simplemodels.uncorrelated_background(
+ # ... signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0]
+ # ... )
+ # >>> observations = [51, 48]
+ # >>> data = pyhf.tensorlib.astensor(observations + model.config.auxdata)
+ # >>> obs_limit, exp_limits = pyhf.infer.intervals.upper_limits.toms748_scan(
+ # ... data, model, 0., 5., rtol=0.01
+ # ... )
+ # >>> obs_limit
+ # array(1.01156939)
+ # >>> exp_limits
+ # [array(0.5600747), array(0.75702605), array(1.06234693), array(1.50116923), array(2.05078912)]
Args:
data (:obj:`tensor`): The observed data.
@@ -231,7 +231,6 @@ def upper_limit(
array(1.01764089)
>>> exp_limits
[array(0.59576921), array(0.76169166), array(1.08504773), array(1.50170482), array(2.06654952)]
- >>> pyhf.set_backend("jax")
Args:
data (:obj:`tensor`): The observed data. and then run
I think this might mean we have a bug in Lines 49 to 56 in f7e974f
is used by doctest. Not sure, so input welcome. |
Here's the issue described in the
So if doctest is invoked with $ pytest src/ then |
Summary
In PR #1274 there is a
AttributeError("'NoneType' object has no attribute '_sorted_indices'")
that is happening for Python 3.10 only for unclear reasons. This is blocking releasev0.7.0
. This is also not reproducible locally on my laptop.OS / Environment
GitHub Actions on Python 3.10
Steps to Reproduce
$ pytest src/pyhf/tensor/jax_backend.py
File Upload (optional)
No response
Expected Results
For the CI to pass
Actual Results
pyhf Version
PR #1274
Code of Conduct
The text was updated successfully, but these errors were encountered: