Generalize generator type in MockProfileInput #699
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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