-
Notifications
You must be signed in to change notification settings - Fork 224
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
Allow pygmt.which to accept a list of filenames as input #1312
Conversation
Let the fname parameter in `pygmt.which` accept list inputs. List of filenames are parsed using the `sequence_space` and then passed into GMT C API as space delimited filenames. Also added a unit test to check that multi-file inputs work.
download : bool or str | ||
If the file is downloadable and not found, we will try to download the | ||
it. Use True or 'l' (default) to download to the current directory. Use |
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.
I'm tempted to update the download (-G) docstring to include the 'a' option (added in GMT 6.1 I think). Should it be done in this PR or a separate one?
download : bool or str | |
If the file is downloadable and not found, we will try to download the | |
it. Use True or 'l' (default) to download to the current directory. Use | |
download : bool or str | |
If the file is downloadable and not found, we will try to download | |
it. Use True or 'l' (default) to download to the current directory. Use |
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.
A separate one is better.
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.
A separate one is better.
I agree.
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.
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.
Great~
Co-Authored-By: Michael Grund <[email protected]>
…ingTools#1312) Let the fname parameter in `pygmt.which` accept list inputs. List of filenames are parsed using `sequence_space` and then passed into GMT C API as space delimited filenames. Also added a unit test to check that multi-file inputs work. Use case for this is to download multiple files at once using `pygmt.which` without going through a for-loop. Co-authored-by: Michael Grund <[email protected]>
Description of proposed changes
Let the fname parameter in
pygmt.which
accept list inputs. List of filenames are parsed using thesequence_space
(see #325) and then passed into GMT C API as space delimited filenames. Also added a unit test to check that multi-file inputs work.Use case for this is to download multiple files at once using
pygmt.which
without going through a for-loop, as in #1310.Addresses #1310 (comment)
Reminders
make format
andmake check
to 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