Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: list available profiles directly #548

Merged
merged 1 commit into from
Sep 16, 2021
Merged

Conversation

jenhagg
Copy link
Collaborator

@jenhagg jenhagg commented Sep 15, 2021

Purpose

Simplify the process to use a custom profile - instead of requiring a local version.json, we can just list the existing files.

What the code is doing

Extracts the profile version from the filename, for files in the raw/{grid_model} folder. We currently assume this folder exists, and the files conform to the current naming convention.

Testing

Ran it locally, added a new profile, got expected result:

In [17]: ProfileHelper.get_profile_version_local("usa_tamu", "demand")
Out[17]: ['vJan2021', 'vFeb2021']

Time estimate

10 min

@jenhagg jenhagg self-assigned this Sep 15, 2021
@jenhagg
Copy link
Collaborator Author

jenhagg commented Sep 15, 2021

Any windows users want to do a quick test? @danielolsen? :)

@jenhagg jenhagg linked an issue Sep 15, 2021 that may be closed by this pull request
1 task
@rouille
Copy link
Collaborator

rouille commented Sep 15, 2021

Nice use of fs

Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Thanks!

Copy link
Contributor

@danielolsen danielolsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on Windows too!

>>> from powersimdata.data_access.profile_helper import ProfileHelper
>>> ProfileHelper.get_profile_version_local("usa_tamu", "demand")
['vJan2021', 'vSep2021']

@jenhagg jenhagg merged commit c3e7d8c into develop Sep 16, 2021
@jenhagg jenhagg deleted the jon/local-profile branch September 16, 2021 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Load Custom Demand/Gen Profiles .csv
4 participants