Skip to content

Should we ensure model.time is sorted from earliest to latest time? #399

@JostMigenda

Description

@JostMigenda

For almost all models, model.time is sorted from earliest to latest simulation times. However, for Patton_2017 it is the other way around:

model = presn.Patton_2017(progenitor_mass=15*u.Msun)
model.time[0]  # -0 h
model.time[-1]  # -14425 h

This is not a bug, since we (afaik) never promised that model.time is sorted; but it is unexpected and inconsistent. Since I can think of no reason why we’d want such an inconsistency (and in the Patton_2017 case it’s just an accident—the times are implicitly sorted before the minus sign is added), I wonder if we should change

self.time = time

to

self.time = np.sort(time)

so that this is automatically sorted consistently for new models in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    SupernovaModelImplementing/correcting supernova modelminorLow prioritysuggestionAn idea that needs to be discussed/approved before starting implementaion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions