Skip to content

Commit d90f425

Browse files
committed
fix: modified plot_test_distribution so its compatible with newer numpy versions (numpy.bool_ can't behave as int anymore).
1 parent be9464a commit d90f425

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

csep/plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ def plot_test_distribution(
10941094
x=observation,
10951095
color="black",
10961096
linestyle="--",
1097-
label=obs_label + numpy.isinf(observation) * " (-inf)",
1097+
label=obs_label + (" (-inf)" if numpy.isinf(observation) else "")
10981098
)
10991099
elif isinstance(observation, (list, numpy.ndarray)):
11001100
observation = observation[~numpy.isnan(observation)]

tests/test_plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,8 @@ def setUp(self):
984984

985985
class MockRegion:
986986
def __init__(self):
987-
self.xs = numpy.linspace(-20, 20, 100)
988-
self.ys = numpy.linspace(-10, 10, 50)
987+
self.xs = numpy.linspace(-20, 20, 100, endpoint=False)
988+
self.ys = numpy.linspace(-10, 10, 50, endpoint=False)
989989

990990
@staticmethod
991991
def get_bbox():

0 commit comments

Comments
 (0)