Breakthrough-Energy / PowerSimData

Simulation framework
https://breakthrough-energy.github.io/docs/
MIT License
52 stars 40 forks source link

Generalize generator type in MockProfileInput #699

Closed rouille closed 2 years ago

rouille commented 2 years ago

Pull Request doc

Purpose

Generalize generator type in the MockProfileInput class by using information from the model_immutables attribute of the Grid object

What the code is doing

Replace hard coded generator type with a dictionary grouping profile to generator type that is available through an attribute of a Grid object for all grid model

Testing

Existing unit tests. To get the tests in the powersimdata.tests.test_mock module pass, I had to sort the keys in the grid.model_immutables.plants["group_profile_resources"] dictionary to mirror what was hard coded before to get the random numbers in _random assigned to the same profile.

Where to look

The powersimdata.tests.mock_profile_input module

Usage Example/Visuals

N/A

Time estimate

5min

rouille commented 2 years ago

Ah, the random seed.

It took me a good 15min to figure it out

BainanXia commented 2 years ago

Ah, the random seed.

It took me a good 15min to figure it out

Even worse for me. My brain is not in a good situation.