Commit f91e96bc authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

epoch check for arrays

parent a7f43c49
......@@ -121,8 +121,10 @@ class Model(object):
float
The epoch in years.
'''
if epoch < self.t_min or self.t_max < epoch:
warn(f'Epoch {epoch} is outside of the models range [{self.t_min},'
epoch = np.asarray(epoch)
out_of_range = epoch[(epoch < self.t_min) + (self.t_max < epoch)]
if np.any(out_of_range):
warn(f'Epochs {out_of_range} are outside of the models range [{self.t_min},'
f' {self.t_max}]. The result will be extrapolated and not '
f'robust.',
category=OutOfRangeWarning)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment