Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sec23
korte
pymagglobal
Commits
f91e96bc
Commit
f91e96bc
authored
Jan 08, 2021
by
Maximilian Schanner
Browse files
epoch check for arrays
parent
a7f43c49
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pymagglobal/core.py
View file @
f91e96bc
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment