a bug whereby empty Python lists where returned from within the get_ground_motion_values* methods. This lead to an AttributeError in the to_dict method trying to flatten a (empty) Python list. All get_ground_motion_values* now return numpy arrays.
a bug whereby NaNs where encoded in the to_dict method of MagnitudeDistance* classes. Now None's are returned.
Added test for the Distance trellis class for case 1 and MagnitudeDistance trellis class for case 2 (with the parameter set whereby I found the bugs). Missing tests for the Magnitude trellis class as I could not programmatically create the right parameter set.
Fixed missing imports of os and sys forgot by some other contribution
Changed the argument name imt of from_rupture_parameter in MagnitudeDistance class: now it's called periods, which is more meaningful to me. I did not change other methods because legacy code might rely on the old argument name, although I would strongly suggest to rename the parameter as it is not a list of imt but a numeric sequence of periods.
Fixes:
get_ground_motion_values*
methods. This lead to anAttributeError
in theto_dict
method trying toflatten
a (empty) Python list. Allget_ground_motion_values*
now returnnumpy
arrays.to_dict
method ofMagnitudeDistance
* classes. Now None's are returned.Added test for the
Distance
trellis class for case 1 andMagnitudeDistance
trellis class for case 2 (with the parameter set whereby I found the bugs). Missing tests for theMagnitude
trellis class as I could not programmatically create the right parameter set.Fixed missing imports of
os
andsys
forgot by some other contributionChanged the argument name
imt
offrom_rupture_parameter
inMagnitudeDistance
class: now it's calledperiods
, which is more meaningful to me. I did not change other methods because legacy code might rely on the old argument name, although I would strongly suggest to rename the parameter as it is not a list ofimt
but a numeric sequence of periods.