Skip to content
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

Add histogram fitting for Raster data structures and break code into submodules #33

Merged
merged 9 commits into from
Apr 10, 2023

Conversation

jbisits
Copy link
Owner

@jbisits jbisits commented Apr 7, 2023

This PR adds methods to fit from StatsBase.jl for Rasters, RasterStacks and RasterSeriess creates the new module RasterHistogras. There is an abstract type AbstracRasterHistogram and a mutable type for generating a Histogram from a Raster, RasterStack, or RasterSeries. The RasterLayerHistogram is 1 dimensional while the RasterStackHistogram and RasterSeriesHistogram can be N-dimensional where N is the number of layers. The types are mutable so that the Histogram (that is fit using StastBase.jl) can be normalized and updated in the AbstractRasterHistogram.

There are functions to calculate area and volume weights based on the dimensions of Raster source.

The code is also organised into submodules so only parts of the package that are necessary to ones use can be loaded.
Closes #35

@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #33 (8a9f708) into main (66a034f) will decrease coverage by 6.19%.
The diff coverage is 89.34%.

@@             Coverage Diff             @@
##              main      #33      +/-   ##
===========================================
- Coverage   100.00%   93.81%   -6.19%     
===========================================
  Files            2        2              
  Lines          123      291     +168     
===========================================
+ Hits           123      273     +150     
- Misses           0       18      +18     
Impacted Files Coverage Δ
src/oceanvariableconversions.jl 100.00% <ø> (ø)
src/oceanvariabledistributions.jl 89.34% <89.34%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

jbisits added 3 commits April 7, 2023 20:36
Add temporary compat for DimensionalData.jl
Temporarily add DimensionalData to deps so compat is used
@jbisits
Copy link
Owner Author

jbisits commented Apr 9, 2023

Once tests have been updated for the new way the RasterHistograms module is structured codecov will jump back up.

@jbisits jbisits changed the title Add histogram fitting for Raster data structures Add histogram fitting for Raster data structures and break code into submodules Apr 10, 2023
@jbisits
Copy link
Owner Author

jbisits commented Apr 10, 2023

Codecov is less because of the Base.show methods and convert_arguments. Tests can be written for this later so for now I will merge this. If any other bugs pop up when writing documentation I will fix in new PRs.

@jbisits jbisits merged commit 57685b6 into main Apr 10, 2023
@jbisits jbisits deleted the joey-adddistributionfunctions branch April 11, 2023 07:13
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.

Shift to modules
1 participant