Skip to content

Possibly disable month and year for Duration parameter type #321

@jkiviluo

Description

@jkiviluo

While Python, Julia and SpineOpt all handle month and year correctly for Duration parameter (in Python using dateutils.relativedelta), there are some drawbacks:

  • months and years have changing duration --> most models don't know how to deal with those (user could use them and get weird behaviour)
  • Python's dateutils.relativedelta (and probably Julia's equivalent) is slower than datetime.timedelta, since the latter does not deal with complex if clauses

Our options:

  • keep doing as now (use relativedelta, leave it to user not to srew-up), but:
    • improve documentation
    • add a warning note where appropriate
  • implement timedelta as the default parameter type for Duration (leave relativedelta as an option)
    • speed improvement should be tested
  • switch completely to timedelta
    • check if anyone is using months or years as Duration in their models - and are these important use cases where the workaround is non-satisfactory

Relates to: #319

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions