Skip to content

Conversation

pabloitu
Copy link
Collaborator

Added customization options to plot_comparison_test, similar to those one of Poisson_consistency tests, and added functionality to plot simultaneously a list of w-test if provided. T-test bars are coloured by significance (green is sign. better, red if sign.worse and gray if not significant. W-test significance is shown with a filled marker at the mean IG.
However, this needs an example/tutorial so the "legend" can be explained.

@wsavran
Copy link
Collaborator

wsavran commented Jul 22, 2021

cool @pabloitu! let me know when you think its ready to merge.

def _get_marker_w_color(distribution):
"""Returns matplotlib marker style as fmt string"""

if distribution < 0.05:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add the percentile argument for this plot as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

ylims = plot_args.get('ylims', (None, None))
capsize = plot_args.get('capsize', 2)
linewidth = plot_args.get('linewidth', 1)
markersize = plot_args.get('markersize', 2)

fig, ax = pyplot.subplots()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you replace this line with the following code? this will let us plot this using a previously initialized axes

    if axes is None:
        fig, ax = pyplot.subplots(figsize=figsize)
    else:
        ax = axes
        fig = ax.get_figure()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, and added axes as function argument

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! ill merge this change once the CI is finished

…pyplot.ax() object and percentile for W-test confidence interval
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2021

Codecov Report

Merging #132 (b8ce984) into master (fa789f0) will increase coverage by 3.81%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
+ Coverage   53.25%   57.06%   +3.81%     
==========================================
  Files          19       19              
  Lines        3091     3142      +51     
  Branches      445      454       +9     
==========================================
+ Hits         1646     1793     +147     
+ Misses       1352     1238     -114     
- Partials       93      111      +18     
Impacted Files Coverage Δ
csep/core/poisson_evaluations.py 42.46% <0.00%> (-3.17%) ⬇️
csep/core/regions.py 54.48% <0.00%> (-0.90%) ⬇️
csep/utils/calc.py 53.57% <0.00%> (+3.57%) ⬆️
csep/__init__.py 32.20% <0.00%> (+8.47%) ⬆️
csep/core/catalogs.py 60.07% <0.00%> (+13.21%) ⬆️
csep/core/forecasts.py 55.51% <0.00%> (+17.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa789f0...b8ce984. Read the comment docs.

Copy link
Collaborator Author

@pabloitu pabloitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ready, but wanna test it with the Jupyter notebook for Figure 6, which guess can serve as tutorial

@wsavran
Copy link
Collaborator

wsavran commented Jul 22, 2021

merging now

@wsavran wsavran merged commit 4195021 into SCECcode:master Jul 22, 2021
@pabloitu pabloitu deleted the comparison_test branch July 22, 2021 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants