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

Migrate Ember provider to new structure #50

Merged
merged 8 commits into from
Aug 2, 2022
Merged

Migrate Ember provider to new structure #50

merged 8 commits into from
Aug 2, 2022

Conversation

rossf7
Copy link
Contributor

@rossf7 rossf7 commented Aug 2, 2022

Towards #44

@rossf7 rossf7 changed the title WIP: Migrate ember provider to new structure Migrate Ember provider to new structure Aug 2, 2022

func getGridIntensityData() (map[string]GridIntensity, error) {
data := map[string]GridIntensity{}
func GetEmberGridIntensity() (map[string]EmberGridIntensity, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new pkg/internal/data package means the data and logic for getting the data file is separate from the provider.

We could extend this for other data files or to add more Ember data. The internal name is so its clear this isn't part of the public API.

Copy link
Member

Choose a reason for hiding this comment

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

I hadn't thought of this as an idea, but I really like it. It's also something we could use on any other libraries that use local data. 👍

}

validFrom := time.Date(emberDataYear, 1, 1, 0, 0, 0, 0, time.UTC)
validTo := time.Date(emberDataYear, 12, 31, 23, 59, 0, 0, time.UTC)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we set the time period for the data.

@rossf7 rossf7 marked this pull request as ready for review August 2, 2022 16:36
@rossf7 rossf7 requested a review from mrchrisadams August 2, 2022 16:36
@mrchrisadams
Copy link
Member

hey @rossf7 - this is good to merge in. Thanks!

@rossf7 rossf7 merged commit 0be1ce6 into main Aug 2, 2022
@rossf7 rossf7 deleted the pkg-provider-2 branch August 2, 2022 17:49
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.

2 participants