Skip to content

CLN, DOC: Remove unused parameters #13167

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

Closed
wants to merge 1 commit into from
Closed

CLN, DOC: Remove unused parameters #13167

wants to merge 1 commit into from

Conversation

Michael-E-Rose
Copy link

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master | flake8 --diff
  • remove unused parameters out and dtype from cumulated functions (cummin, cumsum, cumprod, cummax)

This also affects the documentation. Check for example: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.cumsum.html, where the two parameters are mentioned, but not explained.

@jorisvandenbossche
Copy link
Member

@gfyoung This is OK? I think dtype and out are already checked in validate_cum_func (https://github.com/pydata/pandas/blob/23eb483d17ce41c0fe41b0bfa72c90df82151598/pandas/compat/numpy/function.py#L148)

@jorisvandenbossche jorisvandenbossche added the Compat pandas objects compatability with Numpy or Python functions label May 13, 2016
@jorisvandenbossche jorisvandenbossche added this to the 0.18.2 milestone May 13, 2016
@gfyoung
Copy link
Member

gfyoung commented May 13, 2016

I would like to say "LGTM", but unfortunately, Travis disagrees. You will have to edit validate_cum_func and replace the two arguments with *args for this to work with older numpy versions.

You probably should also then do some pre-processing on axis and skipna to make sure that they aren't being given numpy parameters (which should then be validated while axis and skipna are given their default values).

Please look at pandas/compat/numpy/function.py and pandas/util/validators.py to see how the validation system works as well as examples.

@Michael-E-Rose : Sorry if this is more complicated than you had expected! You unfortunately walked into a compatibility minefield with these functions. Let me know if you have any questions!

@Michael-E-Rose
Copy link
Author

My nosetests run 0 tests - quite useless.

Being in root, I did as explained here, but all I get is


/usr/local/lib/python2.7/dist-packages/nose/importer.py:94: FutureWarning: The pandas.rpy module is deprecated and will be removed in a future version. We refer to external packages like rpy2. 
See here for a guide on how to port your code to rpy2: http://pandas.pydata.org/pandas-docs/stable/r_interface.html
  mod = load_module(part_fqname, fh, filename, desc)

----------------------------------------------------------------------
Ran 0 tests in 0.023s

OK

@jreback
Copy link
Contributor

jreback commented May 15, 2016

you need to make sure that you build in-place and run them there. Not sure what root is in this context, are you actually running as root?

e.g. something like

git clone https:://www.github.com/pydata/pandas.git
cd pandas
python setup.py build_ext --inplace
nosetests -A 'not slow' pandas

@Michael-E-Rose
Copy link
Author

Root of the repo.

But my build process has quite a long output as well. Mostly warnings about outdated stuff etc.

@gfyoung
Copy link
Member

gfyoung commented May 15, 2016

@Michael-E-Rose : Because this is actually a numpy compat issue, I would suggest building in a separate environment (e.g. conda or virtualenv) so that you can swap out the various numpy versions (e.g. 1.11.0, 1.10.4, etc.) for testing. Then just do the following in your top pandas directory:

> python setup.py install
> cd .. // or anywhere else outside of your `pandas` directory
> python -c "import pandas as pd;pd.test(raise_warnings=())"

@jreback
Copy link
Contributor

jreback commented Jun 30, 2016

@Michael-E-Rose can you rebase / update

@Michael-E-Rose
Copy link
Author

No sorry. This is too complicated for me.

On 30 June 2016 at 12:20, Jeff Reback [email protected] wrote:

@Michael-E-Rose https://github.com/Michael-E-Rose can you rebase /
update


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13167 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AGxGdtd6g5qhvsv_8lU07_c1gvv-nv2pks5qQ5hcgaJpZM4Id0Lk
.

Michael E. Rose / PhD student

University of Cape Town | African Institute of Financial Markets and Risk
Management
michael-e-ro.se/

@gfyoung
Copy link
Member

gfyoung commented Jun 30, 2016

@Michael-E-Rose : I can take a look since I have waded through those muddy waters that are compat with numpy. If that's alright, you can close this.

@Michael-E-Rose
Copy link
Author

It's alright, thanks. I close this now.

@jorisvandenbossche jorisvandenbossche modified the milestones: No action, 0.18.2 Jul 1, 2016
jreback pushed a commit that referenced this pull request Jul 3, 2016
Picks up from #13167 by properly removing the parameters and ensuring
that `numpy` compatibility has been maintained.  The current test
suite does a good job of checking that already, so no tests were
added.    Closes #13541.

Author: gfyoung <[email protected]>

Closes #13550 from gfyoung/cum-func-cleanup and squashes the following commits:

6ba7a77 [gfyoung] Removed unnecessary params in cum_func
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants