Skip to content

routed spatial_counts and spatial_magnitude_counts through region class #122

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

Merged
merged 2 commits into from
May 19, 2021

Conversation

wsavran
Copy link
Collaborator

@wsavran wsavran commented May 18, 2021

- added acceptance tests for these functions
- fixed SCECcode#121 -- issue with bin1d_vec for scalar values
@wsavran
Copy link
Collaborator Author

wsavran commented May 18, 2021

@khawajasim do you mind reviewing this before i merge?

@codecov-commenter
Copy link

Codecov Report

Merging #122 (26406c2) into master (40c28bb) will increase coverage by 0.40%.
The diff coverage is 80.95%.

❗ Current head 26406c2 differs from pull request most recent head 7206a3b. Consider uploading reports for the commit 7206a3b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
+ Coverage   56.88%   57.28%   +0.40%     
==========================================
  Files          19       19              
  Lines        3115     3121       +6     
  Branches      451      453       +2     
==========================================
+ Hits         1772     1788      +16     
+ Misses       1237     1225      -12     
- Partials      106      108       +2     
Impacted Files Coverage Δ
csep/core/catalogs.py 59.47% <77.77%> (+1.61%) ⬆️
csep/utils/calc.py 53.57% <100.00%> (+3.57%) ⬆️

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 40c28bb...7206a3b. Read the comment docs.

@khawajasim
Copy link
Contributor

khawajasim commented May 18, 2021

@khawajasim do you mind reviewing this before i merge?

Thanks. I looked through the code. Everything seems alright to my understanding.

I have one question though. I am not sure whether it is a right question or not. Why there is no change in region.py and evaluations.py? I was thinking that routing subject functions through region class means that these functions will be added as a member functions to region2D class. And eventually called in evaluations.py through that way. Or I was thinking it the wrong way?

@wsavran
Copy link
Collaborator Author

wsavran commented May 18, 2021

not a bad question at all! ultimately it came down to a choice of implementation. i decided to define the methods at the catalog level, because i wanted to keep the definition of the region objects as simple as possible. this way, all a region needs to do is define in the get_index_of function and it can be used in the catalog or evaluations.

we can always change this down the road so long as the functions on the catalog class do as they are intended.

@wsavran wsavran merged commit 4916f94 into SCECcode:master May 19, 2021
@wsavran wsavran deleted the wsavran_fix_121_116 branch May 19, 2021 20:12
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.

Make catalog binning work with functions directly from the Region class bin1d_vec doesn't return correct value for right_continuous with scalar input
3 participants