Skip to content

Wrap filter1d #1512

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 34 commits into from
May 5, 2022
Merged

Wrap filter1d #1512

merged 34 commits into from
May 5, 2022

Conversation

willschlitzer
Copy link
Contributor

@willschlitzer willschlitzer commented Sep 15, 2021

This pull request wraps filter1d.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@willschlitzer willschlitzer added the feature Brand new feature label Sep 15, 2021
@willschlitzer willschlitzer added this to the 0.5.0 milestone Sep 15, 2021
@willschlitzer willschlitzer self-assigned this Sep 15, 2021
@willschlitzer willschlitzer changed the title WIP: Wrap filter1d Wrap filter1d Sep 23, 2021
@willschlitzer willschlitzer modified the milestones: 0.5.0, 0.6.0 Oct 7, 2021
@willschlitzer willschlitzer marked this pull request as ready for review November 6, 2021 07:27
@willschlitzer
Copy link
Contributor Author

The style checks are getting stuck on the argument ("\s+") passed to the sep= parameter for pd.read_csv. As far as I can tell, that is the correct way to be importing the MaunaLoa_CO2.txt data file and reading it into a dataframe. Is there a way to get this style check to pass?

Copy link
Member

@seisman seisman left a 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 except for a typo.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label May 2, 2022
Co-authored-by: Dongdong Tian <[email protected]>
@seisman
Copy link
Member

seisman commented May 3, 2022

Hopefully at least one of @michaelgrund and @weiji14 can give this PR a final review.

@seisman seisman requested review from michaelgrund and weiji14 May 3, 2022 01:49
@fmt_docstring
@use_alias(
E="end",
F="filter",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter is a built-in function in Python, see https://docs.python.org/3/library/functions.html#filter. Sure we want to use this? Or use a parameter name like filter_type instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @weiji14.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me; I'll make the change

Include Ends of time series in output. The default [False] loses
half the filter-width of data at each end.

time_col : int or str
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a str allowed for time_col (-N)? As in users can pass in the name of the time column in the pandas.DataFrame table input?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am under the impression that GMT reads a string containing an integer or floating point number as the same value as if it was passed as a number instead. I don't know why a Python user would ever pass a number as a string, so it may just be easier to leave it as int.

I'll see if I can try and test it, but filter1d is one (of the many) module that I don't understand its application and just wrapped using the provided GMT example and dataset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in users can pass in the name of the time column in the pandas.DataFrame table input?

I think this is a nice feature and can be implemented in a separate PR. In this initial wrapper, a time_col as int should be good.

@fmt_docstring
@use_alias(
E="end",
F="filter",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @weiji14.

Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@seisman seisman merged commit 2a3e2bc into main May 5, 2022
@seisman seisman deleted the wrap-filter1d branch May 5, 2022 11:49
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label May 5, 2022
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Michael Grund <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants