-
Notifications
You must be signed in to change notification settings - Fork 235
Wrap blockmean #1092
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
Wrap blockmean #1092
Conversation
weiji14
left a comment
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.
Just one very minor point on moving _blockm to the top of the file, otherwise well done!
weiji14
left a comment
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.
Thanks Meghan! Really appreciate having another data processing module added to PyGMT's toolkit 😄
seisman
left a comment
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.
Looks good to me.
The alias of d is nodata in other modules, but was incorrectly set to data in blockmean and blockmode. This PR fixes the problem. blockmode was wrapped in #1456 (after v0.4.1), blockmean was wrapped in #1092 but the wrong alias was added in #1500 (after v0.4.1). Thus, the change won't go into the deprecation cycle.
* Rename blockmedian.py to blockm.py * Refactor blockmedian to support mean and mode * Wrap method blockmean * Add tests for blockmean method Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Wei Ji <[email protected]>
…ngTools#1563) The alias of d is nodata in other modules, but was incorrectly set to data in blockmean and blockmode. This PR fixes the problem. blockmode was wrapped in GenericMappingTools#1456 (after v0.4.1), blockmean was wrapped in GenericMappingTools#1092 but the wrong alias was added in GenericMappingTools#1500 (after v0.4.1). Thus, the change won't go into the deprecation cycle.
Description of proposed changes
This PR wraps the blockmean module. Some changes involved in this PR:
blockmedianmethod is moved to_blockmblockmedianandblockmeancall_blockmwith theblock_methodparameterpygmt/src/blockmedian.pyis renamed topygmt/src/blockm.pyfor simplicity given the similarities between these three methods. I think this is simpler (more pythonic) than having each in separate modules and importing_blockmfrom a fourth module, but feedback is welcome if others feel that Should data processing functions have their own modules? #807 should be more strictly adhered to.Addresses #1091
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version