Skip to content

Strange code pattern #70

@eric-muller

Description

@eric-muller

In a number of places, we have a PERIODS p, and want to use data indexed by TIMEPOINTS for that period p:

excess_generation.py:50
generators/dispatch.py:367
generators/dispatch.py:384
for t in m.TIMEPOINTS if m.tp_period[t] == p

renewable_target.py:72
renewable_target.py:83
for (z, t) in m.ZONE_TIMEPOINTS if m.tp_period[t] == p

However, at renewable_target.py:97, the TIMEPOINTS are not restricted to those in the period:
for t in m.TIMEPOINTS

I don't understand enough of the code to tell if this a problem or not, I only noticed the difference of pattern. If it is intended, a comment may help the reader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions