Skip to content

Commit

Permalink
add contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Aug 1, 2023
1 parent 4e15e88 commit 651878d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 31 deletions.
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,3 @@ Installation
```
pip install dataframe-api-compat
```

Testing
-------
```
pytest test_standard.py --cov=dataframe_api_compat --cov=test_standard --cov-fail-under=100
```
100% branch coverage isn't the objective - it's the bare minimum.

Linting
-------
```
pre-commit run --all-files
```

Type Checking
-------------

First, clone the [dataframe_standard](https://github.com/data-apis/dataframe-api) to some
local path. Then, run:
```console
MYPYPATH=<path to dataframe-api/spec/API_specification> mypy dataframe_api_compat
MYPYPATH=<path to dataframe-api/spec/API_specification> mypy polars_standard.py
```

For example, if you cloned both repos in the same place, this could be:
```console
MYPYPATH=../dataframe-api/spec/API_specification/ mypy dataframe_api_compat
```
35 changes: 35 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Installation
------------
```
python3.10 -m venv .venv
. .venv/bin/activate
pip install -U pip wheel
pip install -r requirements-dev.txt
```
Testing
-------
```
pytest test_standard.py --cov=dataframe_api_compat --cov=test_standard --cov-fail-under=100
```
100% branch coverage isn't the objective - it's the bare minimum.

Linting
-------
```
pre-commit run --all-files
```

Type Checking
-------------

First, clone the [dataframe_standard](https://github.com/data-apis/dataframe-api) to some
local path. Then, run:
```console
MYPYPATH=<path to dataframe-api/spec/API_specification> mypy dataframe_api_compat
MYPYPATH=<path to dataframe-api/spec/API_specification> mypy polars_standard.py
```

For example, if you cloned both repos in the same place, this could be:
```console
MYPYPATH=../dataframe-api/spec/API_specification/ mypy dataframe_api_compat
```
4 changes: 2 additions & 2 deletions dataframe_api_compat/polars_standard/polars_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ def all(self, *, skip_nulls: bool = True) -> PolarsDataFrame:
return PolarsDataFrame(self.dataframe.select(pl.col("*").all()))

def any_rowwise(self, *, skip_nulls: bool = True) -> PolarsColumn[Bool]:
return PolarsColumn(self.dataframe.select(pl.any(pl.col("*")))["any"])
return PolarsColumn(self.dataframe.select(pl.any_horizontal(pl.col("*")))["any"])

def all_rowwise(self, *, skip_nulls: bool = True) -> PolarsColumn[Bool]:
return PolarsColumn(self.dataframe.select(pl.all(pl.col("*")))["all"])
return PolarsColumn(self.dataframe.select(pl.all_horizontal(pl.col("*")))["all"])

def min(self, *, skip_nulls: bool = True) -> PolarsDataFrame:
return PolarsDataFrame(self.dataframe.select(pl.col("*").min()))
Expand Down
2 changes: 1 addition & 1 deletion make.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
. type-check.sh
pytest tests --cov=dataframe_api_compat --cov=tests --cov-fail-under=100
pytest tests --cov=dataframe_api_compat --cov=tests --cov-fail-under=100 -W error
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
covdefaults
pandas
polars
pre-commit
pyarrow
pytest
pytest-cov

0 comments on commit 651878d

Please sign in to comment.