Closed krisvanneste closed 5 months ago
Hi Kris, surprised by this error.
The method MediumProperties().get()
called here should always return a number (float or integer).
What does it return in your case?
Ah, ok, I understood: you have a numpy.float32
and not a regular python float
!
Let me fix that!
Claudio,
Indeed, it is a numpy float.
Hopefully fixed by 165e20ff4c7f8547e32ad30fc9ecdd1bf84135c2.
Can you check?
You probably have an old NumPy version, since is_integer()
was added to NumPy in version 1.22.0: https://numpy.org/doc/stable/release/1.22.0-notes.html
Claudio,
The fix is working!
Indeed, an older numpy version (although it is composed of the same digits: 1.20.2).
I was not aware of this is_integer
method for python and numpy floats.
Kris
Just made commit 6e8df95da56818b82107e42c0d5c6112c0302b99 to fix this everywhere.
It's indeed just a (hackish?) solution to pretty print pure integers 😉
Thanks!
@claudiodsf ,
Before working on the variable window length issue, I need to update my code to run sourcespec. I managed to catch up with most of your recent changes, but I run into a problem when I try to set the VP and VS of the event hypocenter:
I don't know how to solve this. The
vp_source
andvs_source
properties of theconfig
object passed to_hypo_vel
are lists of floats, but apparently they should be objects having anis_integer
method. However, I couldn't find any class definition with anis_integer
method in sourcespec. When I comment out the offending lines in theto_string
method ofMediumProperties
, everything seems to work. However, I notice that there are at least 2 other places where thisis_integer
method is called in sourcespec, so I'm probably doing something wrong. I hope you can tell me.Kris