Closed simonameiler closed 9 months ago
Can you please merge the develop branch into this branch? All tests are now failing, but I think it is due to a bug that is fixed on develop.
I have one larger general question: from the naming, and what the docstring says, I would expect the new module to compute the absolute differences. However, the current code seems to compute relative differences. What is the rational here? This should maybe be an option?
After these points are resolved, someone should still do a careful check of the actual methods. I briefly went over them, and it seems all fine. But details can be important, in particular also because the test is quite minimal.
Can you please merge the develop branch into this branch? All tests are now failing, but I think it is due to a bug that is fixed on develop.
I did. I don't think the bug is fixed on develop yet.
I have one larger general question: from the naming, and what the docstring says, I would expect the new module to compute the absolute differences. However, the current code seems to compute relative differences. What is the rational here? This should maybe be an option?
After these points are resolved, someone should still do a careful check of the actual methods. I briefly went over them, and it seems all fine. But details can be important, in particular also because the test is quite minimal.
I resolved all points to my best knowledge. I don't think there should be an option to calculate delta impacts for absolute values. Absolute delta impact calculations are not useful without knowledge of a reference state. I added a few lines in the docstrings reasoning for the relative delta impact calculation.
This looks good and useful! There's not much left to do:
- Please resolve all linter issues (except
too-many-arguments
andtoo-many-local-variables
). This should be rather simple- The module documentation is missing. Please add an appropriate section to
doc/climada/climada.engine.unsequa.rst
and double-check the rendered docs.- The tutorial section on the new class should probably start with an explanation what the class does (current paragraphs 2 and 3), and then mention that it works analogously to the other class (paragraph 1)
- The table of contents in the tutorial was not updated, and the links don't work anyway. Maybe just remove it for now?
I addressed all your points. In my eyes, it's good to go.
Changes proposed in this PR:
unc_output
to skip columns of the uncertainty output dataframe which are zeros or nan.save_divide
inutil
which handles division by zero and NaN values in the numerator or denominator. This is needed for the relative impact change calculation (delta impact). Tests for the function are also added.PR Author Checklist
develop
)PR Reviewer Checklist