Skip to content

SNEWPY Warren_2020 model errors on initialization #86

@sgriswol

Description

@sgriswol

When loading Warren_2020 model in ASTERIA, an error similar to the following is produced. Thanks to @jlazar17 for finding this.
I suspect it is due to a duplicate time entry in the model file, as was the case with SNEWS2/snewpy#210.

~/IceCube/ASTERIA/python/asteria/source.py in __init__(self, model, model_params)
    37         for flavor in Flavor:
    38             t = self.model.time
--> 39             self._interp_lum.update({flavor: PchipInterpolator(t, self.model.luminosity[flavor], extrapolate=False)})
    40             self._interp_meanE.update({flavor: PchipInterpolator(t, self.model.meanE[flavor], extrapolate=False)})
    41             self._interp_pinch.update({flavor: PchipInterpolator(t, self.model.pinch[flavor], extrapolate=False)})

/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/_cubic.py in __init__(self, x, y, axis, extrapolate)
    232     """
    233     def __init__(self, x, y, axis=0, extrapolate=None):
--> 234         x, _, y, axis, _ = prepare_input(x, y, axis)
    235         xp = x.reshape((x.shape[0],) + (1,)*(y.ndim-1))
    236         dk = self._find_derivatives(xp, y)

/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/_cubic.py in prepare_input(x, y, axis, dydx)
     59     dx = np.diff(x)
     60     if np.any(dx <= 0):
---> 61         raise ValueError("`x` must be strictly increasing sequence.")
     62 
     63     y = np.rollaxis(y, axis)

ValueError: `x` must be strictly increasing sequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions