Modularization and further Code Cleanup #36
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.
This Pull request encompasses three major topics:
1 Modularization of widgets for notebooks
In order to modularize code and to avoid duplication of code blocks, I created common and notebook-specific helper files that contain code to create the widgets. Storing these in dedicated files instead of repeating code across multiple notebooks will help to make code more maintainable. (This goes into direction of modularization as raised in Issue 35.
2 Passing period and scenario as function parameters
I noticed that period and scenario variables were not yet passed as function parameters in the corresponding function definitions and calls. Thus, I modified the code so that these are now passed as function parameters.
3 Further Code Cleanup
I further cleaned up the code, most notable is that I removed the "from common import *" statement in runAnalysis as this behavior can clutter the namespace and makes it harder to track if, e.g., libraries are imported but not used. Other items include moving the URL for the world pop into the common file (to align with the rest_api_url parameter).