Skip to content

[modernize] Use proper Enums and remove get_all #89

@jmarrec

Description

@jmarrec

https://github.com/NREL/EnergyPlusRegressionTool/blob/212d62afb573d77c748f29817e4cf89858fd110d/epregressions/structures.py#L17-L33

Transition to use Enums, which makes get_all unecessary

from enum import Enum
class ReportingFreq(Enum):
    DETAILED = "Detailed"
    TIME_STEP = "Timestep"
    HOURLY = "Hourly"
    DAILY = "Daily"
    MONTHLY = "Monthly"
    RUN_PERIOD = "RunPeriod"
    ENVIRONMENT = "Environment"
    ANNUAL = "Annual"
    
In [2]: [x for x in ReportingFreq]
Out [2]: 
[<ReportingFreq.DETAILED: 'Detailed'>,
 <ReportingFreq.TIME_STEP: 'Timestep'>,
 <ReportingFreq.HOURLY: 'Hourly'>,
 <ReportingFreq.DAILY: 'Daily'>,
 <ReportingFreq.MONTHLY: 'Monthly'>,
 <ReportingFreq.RUN_PERIOD: 'RunPeriod'>,
 <ReportingFreq.ENVIRONMENT: 'Environment'>,
 <ReportingFreq.ANNUAL: 'Annual'>]

(each enum has a .name and a .value attribute too)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions