pandas: STYLE Increase coverage of inconsistent-namespace-usage
If you already have experience contributing, then please leave this issue to newcomers - thanks 👍
In .pre-commit-config.yaml, the check inconsistent-namespace-usage is limited to pandas/tests/frame/. Let’s expand it to the rest of pandas/tests/.
The task here is:
- make sure you’re familiar with the contributing guide
- choose a folder from the list below (e.g.
series) and add it to the check in.pre-commit-config.yaml. E.g., if you choseseries, that would be:
- id: inconsistent-namespace-usage
name: 'Check for inconsistent use of pandas namespace in tests'
entry: python scripts/check_for_inconsistent_pandas_namespace.py
language: python
types: [python]
files: ^pandas/tests/(frame|series)/
- temporarily add
tokenize-rtas an additional dependency and--replaceas an arg (these will be removed later):
- id: inconsistent-namespace-usage
name: 'Check for inconsistent use of pandas namespace in tests'
entry: python scripts/check_for_inconsistent_pandas_namespace.py
language: python
types: [python]
files: ^pandas/tests/(frame|series)/
additional_dependencies: [tokenize-rt]
args: [--replace]
- run this check on all files with pre-commit, i.e.:
$ pre-commit run inconsistent-namespace-usage --all-files
[INFO] Initializing environment for local:tokenize-rt.
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Check for inconsistent use of pandas namespace in tests.......................Failed
- hook id: inconsistent-namespace-usage
- files were modified by this hook
- run it again - this time, it should pass
$ pre-commit run inconsistent-namespace-usage --all-files
Check for inconsistent use of pandas namespace in tests.......................Passed
Check that the other hooks still pass - if you enable pre-commit (pre-commit install), then this will happen automatically when you try to commit your changes (see step 6)
- revert the changes to
.pre-commit-config.yaml(we’ll update it once these changes are all so as to avoid a barrage of merge conflicts) - commit your changes, and open a pull request. Check over your changes, make sure they look sensible, let me know if not
Here are the folders in pandas/tests which this check needs expanding to:
- series
- scalar
- resample
- util
- tseries
- dtypes
- arrays
- plotting
- tools
- indexing
- strings
- reductions
- frame
- arithmetic
- config
- api
- generic
- io
- base
- window
- internals
- reshape
- computation
- apply
- groupby
- tslibs
- libs
- indexes
- extension
No need to ask for permission to work on this, just leave a comment letting people know which folder(s) from the list above you’re working on
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (23 by maintainers)
Commits related to this issue
- STYLE: Inconsistent namespace - Indexes (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Add whatsnew for indexes (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - Indexes (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Fix sript name in whatsnew (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - Indexes (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - apply (pandas-dev#39992) Fix inconsistent namespace in apply directory. — committed to punitvara/pandas by punitvara 3 years ago
- STYLE: Inconsistent namespace - apply (pandas-dev#39992) Fix inconsistent namespace in apply directory. — committed to punitvara/pandas by punitvara 3 years ago
- STYLE: Inconsistent namespace - base (pandas-dev#39992) Fix inconsistent namespace in apply directory. — committed to punitvara/pandas by punitvara 3 years ago
- STYLE: Inconsistent namespace - apply (pandas-dev#39992) (#40029) Fix inconsistent namespace in apply directory. — committed to pandas-dev/pandas by punitvara 3 years ago
- STYLE: Inconsistent namespace - base (pandas-dev#39992) (#40031) Fix inconsistent namespace in apply directory. — committed to pandas-dev/pandas by punitvara 3 years ago
- STYLE: Inconsistent namespace - Indexes (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - groupby (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - Indexes (#39992) (#40001) — committed to pandas-dev/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - groupby (#39992) (#40056) — committed to pandas-dev/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - reshape (#39992) — committed to alexprincel/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - reshape (#39992) (#40058) Co-authored-by: Marco Gorelli <marcogorelli@protonmail.com> — committed to pandas-dev/pandas by alexprincel 3 years ago
- STYLE: Inconsistent namespace - dtypes (pandas-dev#39992) — committed to parkerashlan/pandas by parkerashlan 3 years ago
- STYLE: Inconsistent namespace - dtypes (pandas-dev#39992) (#40161) — committed to pandas-dev/pandas by parkerashlan 3 years ago
- STYLE: Inconsistent namespace - resample #39992 (#40220) * Fix styling * Fix other linting issues * Revert — committed to pandas-dev/pandas by thomasyu888 3 years ago
- STYLE: Inconsistent namespace - scalar #39992 (#40218) * Fix styling * revert — committed to pandas-dev/pandas by thomasyu888 3 years ago
Working to close this issue
As part of pyladies-sprint-March-2021, I looked at dir reductions