NatLabRockies / NatLabRockies/EnergyPlusRegressionTool

[modernize] Use proper Enums and remove get_all

Open
#89 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
10
Forks
18
Avg merge
21m
Merged PRs (30d)
1

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in epregressions/structures.py at lines 17-33, then inspect the existing get_all implementation and its callers. Identify the enum-like definitions covered by the issue and verify that their existing string values remain available after the transition; done means get_all is no longer needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.