-
Notifications
You must be signed in to change notification settings - Fork 124
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
Feature/unsequa multiprocessing #763
Conversation
This fixes previously not working parallel computations and introduces a simpler handling of the pool. The users now only need to specify the number of processes.
# Conflicts: # climada/engine/unsequa/calc_cost_benefit.py # climada/engine/unsequa/calc_impact.py # climada/engine/unsequa/test/test_unsequa.py
* Allow to set loglevel * Add method to sort samples * Update CHANGELOG.md * Add advanced examples for unsequa * Remove logging control * Update changelog * Remove tipo * Clarify docstring * Correct docstring * Update t.o.c. * Remove unecessary output prints * Remove linter issues * Update changelog --------- Co-authored-by: Chahan Kropf <[email protected]>
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.
It looks good to me but I cannot really assess if this is a clear improvement. My main trouble is the amount of doubled code and the lack of documentation regarding the parallelization process. Other than that, I see no major issues 👍
samples_df.iterrows(), | ||
chunksize=chunksize) | ||
|
||
p_iterator = self._sample_parallel_iterator( |
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.
Suggestion: Make the entire iterator-computation-datamerge part a (local?) function that only takes a dataframe and the process number as arguments. Then you can pass the first DF row with processes=1
to estimate the compute time and afterwards pass the rest of the dataframe with processes=processes
. No need to double the code.
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.
Done in 261415c
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.
With "local" I meant a function that is defined (only) in the scope of uncertainty
. This way, it would need fewer parameters. But it works this way nonetheless
Co-authored-by: Lukas Riedel <[email protected]>
Co-authored-by: Lukas Riedel <[email protected]>
Co-authored-by: Lukas Riedel <[email protected]>
Co-authored-by: Lukas Riedel <[email protected]>
Co-authored-by: Lukas Riedel <[email protected]>
Edit: Follow-up issue: #774 |
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.
Well done!!
Changes proposed in this PR:
This PR is a small maintenance of the unsequa module.
Note: merge conflict is dependent on changes in PR #762 . Will be solved after the later is merged.SOLVED.impact.tot_value
(optional, can be reversed if this should be done when the deprecated method is removed)This PR fixes
unsequa
module unconditionally adjusts matplotlib style #758PR Author Checklist
develop
)PR Reviewer Checklist