-
Notifications
You must be signed in to change notification settings - Fork 216
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
Raise a GMTInvalidInput exception for only x,y input to blockmedian and blockmean #1447
Comments
Sounds a better option to me. |
I think I can try to do that, I can try to extend |
One option would be to add an optional keyword parameter But, I am actually not sure if making this code specific to |
I think those are separate issues.
|
OK, do you want to address the first of these two separate issues using z_required? If so, I can assign the issue to you. |
can do both if you think both of them are necessary, let's start with the first one I'll open a PR. |
I'm wondering if we should use a |
I think
I think the
|
Description of the desired feature
Currently, no exception is raised in the
blockmedian
andblockmean
functions if thex
andy
parameters are used but not thez
parameter. This should be disallowed because these functions require three columns. For example, GMT will raise an error if a textfile with only two columns is used.The simplest method to fix this problem would be to add the equivalent of these lines of code (using
table
rather thandata
) to the start of the_blockm
function:pygmt/pygmt/src/surface.py
Lines 81 to 83 in cd822ca
Another option could be to extend the
virtualfile_from_data
function to (optionally) check the number of columns. This would limit redundancy relative to using the same code block for all functions operating on x,y,z data (e.g., blockm*, surface, nearneighbor). If the test were in virtualfile_from_data, we could also reduce the tests required because the exception would not need to be tested in each module that requires three columns.Are you willing to help implement and maintain this feature? Glad to help someone else with this issue
The text was updated successfully, but these errors were encountered: