-
Notifications
You must be signed in to change notification settings - Fork 23
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
Plot Refactoring #263
base: v1.0.0-candidate
Are you sure you want to change the base?
Plot Refactoring #263
Commits on Aug 20, 2024
-
refac: initial refactoring of the plotting module.
- Harmonized the parameters for all plotting functions. Removed the `plot_args` argument from all functions. Now, default parameters, such as `title`, `figsize` and many other repeating parameters are now found in a global dictionary `DEFAULT_PLOT_ARGS`. All plotting functions now default to these parameters and update a copy of it with **kwargs, thus having control to customize plots. Relevant parameters to the function are left in the function signature. - Added type hints for all signatures. - Removed functions `plot_cumulative_events_versus_time_dev`, `plot_ecdf`, `plot_magnitude_histogram_dev`. - Refactored catalog evaluation plot functions `plot_number_test`, `plot_magnitude_test`, `plot_spatial_test`, `plot_likelihood_test` into a generic `plot_distribution_test` (Should it be renamed plot_consistency_test?). Automatic annotations for each type test are done if required, or when called directly from EvaluationResult subclasses. - The function `plot_poisson_consistency_test` was collapsed onto `plot_consistency_test`, which also included the negative binomial model. - Reworked `plot_magnitude_vs_time`: removed some old functionality and give the possibility to scale the size of each event by its magnitude. Added datetime formatter/locator - Reworked`plot_cumulative_events_versus_time`. Now it has the option to plot with the real datetimes, or hours/days after a given mainshock. - Now plot_magnitude_histogram plots in log scale. - plot_basemap now allows cacheing of downloaded data - Created or refactored from existing functions multiple helper functions to ease unit testing and code readability: `_get_basemap`,`_autosize_scatter`, `_size_map`, `_autoscale_histogram`, `_annotate_distribution_plot`, `_calculate_spatial_extent`, `_create_geo_axes`, `_calculate_marker_size`, `_add_gridlines`, `_define_colormap_and_alpha`, `_add_colorbar`, _process_stat_distribution`. These still needs some review, type hinting and further refactoring if necessary. tests: Completed test coverage of almost all plots.py functions. Added test artifacts for catalog based evaluations (catalogs, forecasts, test results).
Configuration menu - View commit details
-
Copy full SHA for 9648e76 - Browse repository at this point
Copy the full SHA 9648e76View commit details
Commits on Aug 22, 2024
-
ft: Added rasterio reader for plot_basemap, which plots a raster in t…
…he same projection of the cartopy GeoAxes. ft: Added cache handler for plot_basemap. Uses the cache option from cartopy, but removes the cache if a different basemap source is selected (otherwise it would get stuck with the first cached map). tests: added .tif basemap plotting to existing unit tests build: added rasterio as requirement
Configuration menu - View commit details
-
Copy full SHA for f9ade59 - Browse repository at this point
Copy the full SHA f9ade59View commit details -
Configuration menu - View commit details
-
Copy full SHA for 694f6f3 - Browse repository at this point
Copy the full SHA 694f6f3View commit details
Commits on Aug 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7d89727 - Browse repository at this point
Copy the full SHA 7d89727View commit details -
refactor: Added type hints and docstrings to helper functions. Remove…
…d unused helper functions
Configuration menu - View commit details
-
Copy full SHA for c348605 - Browse repository at this point
Copy the full SHA c348605View commit details
Commits on Aug 27, 2024
-
refactor: negative_binomial_number_test now stores the variance argum…
…ent into the EvaluationResult, as part of the test_distribution attribute: ('negbinom', mean, variance). plot_consistency_test() now does not accept variance as attribute, but it is rather obtained when processing the negative binomial distribution. tests: unittests of consistency test now do not accept variance argument, and negative_binomial mocks contain the second variance parameter as part of the test_distribution
Configuration menu - View commit details
-
Copy full SHA for 229d0d8 - Browse repository at this point
Copy the full SHA 229d0d8View commit details -
refactor: t-test EvaluationResult() now includes value of alpha, so i…
…t is not necessary to set it again when plotting. plot_comparison_test() includes a default legend that explains the symbology therein.
Configuration menu - View commit details
-
Copy full SHA for 7306329 - Browse repository at this point
Copy the full SHA 7306329View commit details
Commits on Aug 30, 2024
-
docs: Harmonized docstrings of all plotting main functions, making th…
…em compatible with sphinx docs. Reordered the index of the API reference docs for plotting functions. Also added EvaluationResult and CartesianGrid2D.get_cartesian, which are referenced by the plot docs. Added cartopy for intersphinx_mapping refac: Renamed plot_spatial_dataset to plot_gridded_dataset (since catalogs are also a spatial datasets)
Configuration menu - View commit details
-
Copy full SHA for 21fcc33 - Browse repository at this point
Copy the full SHA 21fcc33View commit details -
refactor: catalog and forecasts plot methods now uses kwargs instead …
…of plot_args. Kept the `plot_args` for legacy compatibility. docs: Adapted tutorials to the new plot refactoring. Added catalog_plot to Catalog Operations tutorial. ft: Added higher resolutions for basemap autoscale functions, in case extent is lower.
Configuration menu - View commit details
-
Copy full SHA for c009af4 - Browse repository at this point
Copy the full SHA c009af4View commit details