Skip to content

Commit

Permalink
squash DeprecationWarning: Conversion of an array with ndim > 0 to a …
Browse files Browse the repository at this point in the history
…scalar is deprecated
  • Loading branch information
jvansanten committed May 6, 2024
1 parent 69003ef commit 94c32ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toise/pointsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def f(flux_norm):
ns = total - nb
logging.getLogger().info(
"baseline: %.2g actual %.2g ns: %.2g nb: %.2g ts: %.2g"
% (baseline, actual, ns, nb, ts(actual))
% (baseline, actual[0], ns, nb, ts(actual))
)
return actual[0], ns, nb

Expand Down Expand Up @@ -591,7 +591,7 @@ def f(flux_norm):
else:
# actual = optimize.bisect(f, 0, baseline, xtol=baseline*1e-2)
actual = optimize.fsolve(f, baseline, xtol=tolerance, factor=1, epsfcn=1)
logging.getLogger().debug("baseline: %.2g actual %.2g" % (baseline, actual))
logging.getLogger().debug("baseline: %.2g actual %.2g" % (baseline, actual[0]))
allh = asimov_llh(components, ps=actual, **fixed)
total = nevents(allh, ps=actual, **fixed)
nb = nevents(allh, ps=0, **fixed)
Expand Down

0 comments on commit 94c32ba

Please sign in to comment.