Skip to content
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

[ENH] Introduce xarray functionality into pyjanitor #585

Merged
merged 29 commits into from
Nov 17, 2019
Merged

[ENH] Introduce xarray functionality into pyjanitor #585

merged 29 commits into from
Nov 17, 2019

Conversation

zbarry
Copy link
Collaborator

@zbarry zbarry commented Oct 11, 2019

PR Description

Currently a proof-of-concept prototype of xarray functionality.

This PR resolves #586

PR Checklist

  1. PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.
  1. If you're not on the contributors list, add yourself to AUTHORS.rst.
  1. Add a line to CHANGELOG.rst under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Code Changes

If you are adding code changes, please ensure the following:

  • Ensure that you have added tests.
  • Run all tests ($ pytest .) locally on your machine.
    • Check to ensure that test coverage covers the lines of code that you have added.
    • Ensure that all tests pass.

Documentation Changes

If you are adding documentation changes, please ensure the following:

  • Build the docs locally.
  • View the docs to check that it renders correctly.

Relevant Reviewers

Please tag maintainers to review.

@zbarry zbarry added enhancement New feature or request help wanted Extra attention is needed good intermediate issue Issues that are good for seasoned programmers to make a contribution being worked on An individual has claimed this issue and would like to hack on it. labels Oct 11, 2019
@codecov
Copy link

codecov bot commented Oct 11, 2019

Codecov Report

Merging #585 into dev will increase coverage by 1.27%.
The diff coverage is 99%.

@@            Coverage Diff            @@
##              dev    #585      +/-   ##
=========================================
+ Coverage   90.82%   92.1%   +1.27%     
=========================================
  Files          13      16       +3     
  Lines         436     519      +83     
=========================================
+ Hits          396     478      +82     
- Misses         40      41       +1

bdice and others added 2 commits October 14, 2019 11:56
* Reviewed and edited functional syntax examples.

* Add bdice to AUTHORS.

* Update changelog.

* Fix examples of functional syntax in CONTRIBUTING.
* Add math module for chaining mathematical operations

* Fixing docstring and imports for .math

* Remove unnecessary imports from tests
hectormz and others added 7 commits October 18, 2019 07:42
* add dev requirements

* update changelog

* black; fix docstring

* docstring

* add data equivalence test

* update docstring with semantic line breaks
* Fix contributions hyperlinks

* Tag missing authors in `CHANGELOG.rst`
* Add pre-commit to dev env spec

* add  pre-commit

* Pre-commit text file fixes

* Added pre-commit hooks to install command

* Add instructions on pre-commit hooks

* add default -l 79 to black

* fix environment yaml spec filename

* add pre-commit to requirements-dev.txt
* Fix command formatting in CONTRIBUTING.rst

* Add handle to CHANGELOG
@zbarry
Copy link
Collaborator Author

zbarry commented Oct 30, 2019

Besides moving to pandas-flavor for function registration, what do you all think would need to be done to push this through?

@ericmjl
Copy link
Member

ericmjl commented Oct 31, 2019

Nothing more, let's use an updated version of pandas-flavor so that we don't have to manage function registration. The starter functions look good. I'm going to look at codecov, and see what's causing the precipitous drop in code coverage.

@ericmjl
Copy link
Member

ericmjl commented Oct 31, 2019

OK, mostly it's about missing tests in the new functions. Let's make sure that the new functions are tested, and that they get included in the docs as well.

dendrondal and others added 8 commits November 2, 2019 10:14
… accepted for column names (#610)

* First commit for changing type hints for functions modules, except for functions that would be non-sensical as non-strings (e.g. _change_case, _camel2snake, _strip_accents)

* Corrected docstrings to reflect type hint changes and make them more consistent between functions.

* Design choice was made to have all new column names be enforced as strings to maximize compatibility, and to force string column names with "transform_columns" so that dictionary mapping may be retained.

* Finished documentation correction for functions

* Fixed bugs introduced into functions.flag_nulls

* Fixed bugs introduced into convert_units (non-string column names make no sense if unit values in column names) and test_unionize_dataframe_categories.

* Formatted & linted
* Added to changelog

* Update CHANGELOG.rst

Co-Authored-By: Eric Ma <ericmjl@users.noreply.github.com>
* Relaxed type hinting for chemistry module.

* Relaxed type hinting for engineering module

* Changed Union value in ml module to "Hashable" rather than any

* Reformatted and linted

* Fixed bugs introduced into convert_units

* Added to changelog

* Update CHANGELOG.rst

Co-Authored-By: Eric Ma <ericmjl@users.noreply.github.com>
* bumpversion to 0.18.3

* removed isort, as it conflicts; only need to check black

* pre-commit checks

* maintenance: change CI system to use just "black"

* maintenance: fixed execution of notebooks
@zbarry zbarry removed the being worked on An individual has claimed this issue and would like to hack on it. label Nov 10, 2019
@zbarry zbarry changed the title [ENH] [WIP] introduce xarray functionality into pyjanitor [ENH] Introduce xarray functionality into pyjanitor Nov 10, 2019
@zbarry
Copy link
Collaborator Author

zbarry commented Nov 10, 2019

Good to look at now!

Copy link
Member

@ericmjl ericmjl left a comment

Choose a reason for hiding this comment

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

Just left my review! The number of changes looks intimidating, but really it's like 5-6 files that are substantially changed, so it's not so bad. Anybody else on the team would like to take a stab at reviewing the code? (tagging those who come to mind at this moment: @sallyhong @jk3587 @hectormz @szuckerman @eyaltrabelsi - no pressure, if you don't want to do anything, feel free to not comment back)

janitor/xarray/__init__.py Show resolved Hide resolved
janitor/xarray/functions.py Show resolved Hide resolved
janitor/xarray/functions.py Show resolved Hide resolved
janitor/xarray/utils.py Outdated Show resolved Hide resolved
tests/xarray/conftest.py Show resolved Hide resolved
tests/xarray/test_clone_using.py Show resolved Hide resolved
@zbarry
Copy link
Collaborator Author

zbarry commented Nov 16, 2019

Should be good for a check now

@ericmjl
Copy link
Member

ericmjl commented Nov 17, 2019

Awesome stuff. I will cut 0.19.0 straight away.

@ericmjl ericmjl merged commit bb6d113 into dev Nov 17, 2019
@ericmjl ericmjl deleted the xarray branch November 17, 2019 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good intermediate issue Issues that are good for seasoned programmers to make a contribution help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Implement framework for adding xarray methods
9 participants