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.
Pull Request doc
Purpose
Generalize generator type in the
MockProfileInput
class by using information from themodel_immutables
attribute of theGrid
objectWhat 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 modelTesting
Existing unit tests. To get the tests in the
powersimdata.tests.test_mock
module pass, I had to sort the keys in thegrid.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
moduleUsage Example/Visuals
N/A
Time estimate
5min