-
Notifications
You must be signed in to change notification settings - Fork 5
Tweaks to aid nismod2 integration #80
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
Conversation
edwardoughton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Will,
Thanks for these changes which have been useful. The only issue I can see is the ongoing development of interventions.py. I think the key preference you have is to pass only the asset objects into interventions.py, rather than the system, so I'm taking that into consideration in the redevelopment of the model on my branch.
| def update_desirability_to_adopt(self, desirability_to_adopt): | ||
| self.adoption_desirability = desirability_to_adopt | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is a PEP8 style preference to have a double line space after a class or function?
| ################################################################ | ||
|
|
||
|
|
||
| def get_all_distributions_ranked(system, ranking_variable, technology, reverse_value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my branch I have updated the model to work in an asset neutral way, so you can just give it either exchanges, cabinets or distribution points. Therefore I'm not going to accept these proposed changes to interventions.py, as I have new updates that I will make to the master in the next few days which meet and hopefully exceed this integration requirement.
| params['payback_period'] = param['default_value'] | ||
| if param['name'] == 'profit_margin': | ||
| params['profit_margin'] = param['default_value'] | ||
| for name, param in parameters.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Adds
data_patharguments to the functions which read in assets and links using read_csv. This allows these functions to be imported and re-used fromnismod2/models/digital_comms/run.pyCommit 6643d1e simplifies
read_parameterswhich @edwardoughton, you should check before accepting. You cangit revert 6643d1eto undo this commit if it is not helpful.Closes Factor out system from interventions and adoption modules to allow use in smif wrapper #82
I also demonstrate how to use test classes and a pytest fixture to setup a system for each of the tests. This is a really useful way to organise the tests and makes it easier to find and fix the bugs. You'll note that the tests now passsystem._distributionsinto the methods whose arguments have changed. The tests make making these sorts of changes really easy to check!