-
Notifications
You must be signed in to change notification settings - Fork 128
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/coverage #616
Feature/coverage #616
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! 😄 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_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_benefit
2)
plot_event_view
3)
plot_waterfall_accumulated
4)
plot_waterfall
5)
plot_arrow_averted
6)
_plot_list_cost_ben
PR Author Checklist
develop
)PR Reviewer Checklist