Skip to content

Change behaviour for time profiles with too few values #93

@trulsf

Description

@trulsf

Currently, if a TimeProfile contains fewer values than what is required for all time periods of a TimeStructure, the last value will be repeated. E.g.

periods = SimpleTimes(5,1)
op = OperationalProfile([1, 2, 3])
res = collect(op[t] for t in periods)

will return the vector [1, 2, 3, 3, 3].

This is convenient in some cases, e.g. testing for time structures with more periods than original intended to test for larger problem sizes. On the other hand, this may cause unintended errors/behavior that are not easily caught, if the profile is too short due to some other mismatch.

With more use of the package, and not everyone having detailed knowledge of this behavior, it seems better to let the indexing error at run-time when there are too few values (or consider a more tailored error message). This will be a breaking change and should be finalized before a 1.0 version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions