Skip to content

DOC: Remove tips and tricks section page from the wiki #30964

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
datapythonista opened this issue Jan 13, 2020 · 14 comments
Closed

DOC: Remove tips and tricks section page from the wiki #30964

datapythonista opened this issue Jan 13, 2020 · 14 comments

Comments

@datapythonista
Copy link
Member

This page: https://github.com/pandas-dev/pandas/wiki/Tips-&-Tricks-for-pandas-dev is mostly outdated, or provides general Python information.

Personally, I'd just keep the last section on PANDAS_TESTING_MODE. Not sure if the best would be to move it to the CI part of the docs: https://pandas.io/docs/development/contributing.html#testing-with-continuous-integration

Or I'd probably just add a comment where that parameter is being used: https://github.com/pandas-dev/pandas/blob/master/.travis.yml#L46

Anything else that people would like to move to the docs from that page?

@saloni30agr
Copy link
Contributor

Hey @datapythonista,
I would like to work on this issue. From the above description, it looks like, it would be better to move last part - Enabling Deprecations when running tests - to https://github.com/pandas-dev/pandas/blob/master/.travis.yml#L46. Should I go ahead with this?

@datapythonista
Copy link
Member Author

I think that make sense, and having a PR will facilitate the discussion. But can't promise we'll move forward without further discussion.

@keshavgu
Copy link

@datapythonista Is the problem still active?

@datapythonista
Copy link
Member Author

@datapythonista Is the problem still active?

Thanks for the triaging. In my opinion we could delete the wiki page now. @simonjayhawkins do you think that wiki page can be deleted, or do you think some content is still useful, and should be moved to the docs?

@simonjayhawkins
Copy link
Member

Some observations on the sections in Tips & Tricks for pandas dev


Testing for versions

This refers to the use of LooseVersion. Quick search does not find LooseVersion in the docs.
The example uses LooseVersion(np.__version__)>='1.7.0'. For numpy we use _np_version_under1p16 etc from pandas.compat.numpy
For testing we generally use skip_if_no etc from pandas.util._test_decorators unless we need to version for reasons other than skipping tests.
We have a convention for the imports where we always import pandas.util._test_decorators as td and then use the decorator as, for example, @td.skip_if_no("pyarrow", min_version="0.15.0").

I think we should capture these conventions in our contributing style guide, imports and testing sections.


Skipping an entire file full of tests on a failed import of a module named a_module

We no longer use this pattern. We mainly use, for instance, @td.skip_if_no_scipy as a test function decorator or test class decorator.
With pytest, we can skip at module level. With just a brief search, I didn’t find any module level skips in the code. I think our preference is to retain test classes for namespacing and to use the class decorator.

This section also refers to including a message so that when testing we can see why things were skipped.

I think we should ensure these conventions are captured in our contributing style guide, testing section.


Nose

We now use pytest, but the operations mentioned can also be done with pytest.

Exclude a particular test (e.g., a test that's failing you don't care about)

$ pytest pandas/tests -k ‘’not some_test_name’

Fail fast (on first failure - useful with git bisect)

$ pytest pandas/tests -x

Run with ids (and just re-run tests that failed)

$ pytest pandas/tests --lf

Print out skipped tests and their messages

$ pytest pandas/tests -rs

Personally I feel this information is out-of-scope for the pandas documentation.


Misc

Reading from a url

The convention is to use urlopen from pandas.io.common. This is not currently documented but is not used much in the code.

Reading a file named file.txt that's inside of a zip file named file.zip

The convention is to use ZipFile from pandas.io.common. Again this is not documented elsewhere.

Enabling Deprecations when running tests

Addressed by #31008

I think we should ensure the conventions for urlopen and ZipFile are captured in our contributing style guide, testing section


PRs addressing any of the above welcome.

@simonjayhawkins simonjayhawkins added this to the Contributions Welcome milestone May 21, 2020
@vijaysaimutyala
Copy link
Contributor

vijaysaimutyala commented May 24, 2020

@simonjayhawkins @datapythonista I would like to work on the above. This is my first time contributing here. As per above comments, I suppose parts of the wiki should be going here.

https://pandas.io/docs/development/code_style.html

Please correct me if I'm wrong.

@simonjayhawkins
Copy link
Member

As per above comments, I suppose parts of the wiki should be going here.

https://pandas.io/docs/development/code_style.html

That's where I think we should now be adding new content.

see also #33851 for current discussion/investigation about improving the code style docs. @Stockfoot @moaraccounts

@vijaysaimutyala
Copy link
Contributor

Thanks @simonjayhawkins. I was reading your comments on keeping the first PR's as minimal as possible and submitted my first PR that covers just urlopen and ZipFile in the style guide with #34366. Hope it looks ok.

I've a question on this. I was using VS Code for editing the rst file. I noticed VS Code has the reStructuredText extension that enables to live preview the rst file. However I see the below error while trying to start the live preview.

I've used the conf.py that's present in the root directory of the project. Sphinx does seem to have installed well since I was able to build the docs. Do you have any suggestions on this ?

image

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Jun 21, 2020

Do you have any suggestions on this ?

I wasn't able to get that working either, I usually just build the page I'm interested in seeing and open the html in the browser. e.g.

cd doc
python make.py clean
python make.py --single development/code_style.rst

@egd001
Copy link

egd001 commented Jul 15, 2020

Hi,

Is this issue closed or can I help?

Regards

@simonjayhawkins
Copy link
Member

Thanks @egd001 the Testing for versions and Skipping an entire file full of tests on a failed import of a module named a_module sections from #30964 (comment) are outstanding

@debnathshoham
Copy link
Member

Hi, I am new to open source contributions.
Is this issue open? It's still not clear to me, where to move the tips and tricks section to?

@datapythonista
Copy link
Member Author

Looks like all the useful content has already been moved. Only left is how to compare versions in Python with setuptools (not worth having in the pandas docs IMO, more for a stackoverflow question). And a section on nose, which I'm not aware of being used anymore.

If there are no objections I'll delete the wiki page soon.

@datapythonista
Copy link
Member Author

Deleted the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants