Conversation
Add 3 test to check that the plotting functions of climada/entity/exposure/base.py do not throw any errors when they are called. Specifically, the functions tested are: 1) plot_scatter 2) plot_raster 3) plot_basemap
Add test that check that the function plot_rp_intensity(), present in climada/hazard/base.py, do not throw errors when it is called.
Add test to check that plot() in climada/entity/disc_rates/base.py do not raise errors when called.
1) Add test for centroid plots. 2) Add a test to check that the right title is displayed when using plot_rp_intensity() to plot hazard exceedance intensity
Add test for all the plotting functions of climada/engine/cost_benefit.py listed below. 1) plot_cost_benefit 2) plot_event_view 3) plot_waterfall_accumulated 4) plot_waterfall 5) plot_arrow_averted 6) _plot_list_cost_ben
climada/test/test_plot.py
Outdated
| <<<<<<< HEAD | ||
| from climada.entity.entity_def import Entity | ||
| from climada.entity.exposures.base import Exposures | ||
| from climada.entity import DiscRates,ImpfTropCyclone | ||
| from climada.entity.measures import Measure, MeasureSet | ||
| ======= | ||
| from climada.entity.exposures.base import Exposures | ||
| from climada.entity import DiscRates | ||
| >>>>>>> develop |
There was a problem hiding this comment.
These are leftovers from a merge conflict. The file cannot be executed in this state. Please "merge" the lines above the ==== and below, and remove the <<<< / >>>> markers. See "Basic Merge Conflicts" in Git Book: 3.2 Git Branching - Basic Branching and Merging
There was a problem hiding this comment.
Oh yes, my bad, I must have forgotten them. I made a new commit that should fix the left overs and convert docstring comments to regular comments with #. I hardly see comments on the code, should I also not comment ? I just thought a few comments might be helpful in structuring the long code to create a costbenefit object.
There was a problem hiding this comment.
Thank you! Generally, adding comments and using them to structure your code is important and recommended. However, there is a tradeoff when it comes to adding comments where there are no changes related to the PR. If you already worked through the class and think the code might need more comments, I think it would be best to add them in a separate PR.
There was a problem hiding this comment.
Copy that! I was referring mainly to the comments in the code that I added so I won't need to open a new PR to comment the class in general, but I will keep that in mind thanks!
1) Fix merging conflicts 2) Replace docstrings comments with regular comments
|
Cool. Thanks! 😄 |
peanutfun
left a comment
There was a problem hiding this comment.
Good job! These plots are getting more complex to set up but you seem to get the hang of CLIMADA 😉
| haz_future, entity_future) | ||
| costben.plot_arrow_averted(axis = ax, in_meas_names=['Measure A', 'Measure B'], | ||
| accumulate=True) | ||
| CostBenefit._plot_list_cost_ben(cb_list = [costben]) |
There was a problem hiding this comment.
_plot_list_cost_ben is a private method that is already called by plot_cost_benefit. I should not be necessary to call it explicitly to increase the coverage.
| CostBenefit._plot_list_cost_ben(cb_list = [costben]) |
|
🙌 |
Thank you!! :) @peanutfun |
Changes proposed in this PR:
Add test for all the plotting functions of
climada/engine/cost_benefit.py listed below.
1)
plot_cost_benefit2)
plot_event_view3)
plot_waterfall_accumulated4)
plot_waterfall5)
plot_arrow_averted6)
_plot_list_cost_benPR Author Checklist
develop)PR Reviewer Checklist