forked from ydataai/ydata-profiling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(benchmark): Benchmark introduction (ydataai#753)
- Loading branch information
Showing
8 changed files
with
112 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Performance Benchmarks | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
benchmark: | ||
name: ${{ matrix.os }} x ${{ matrix.python }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] #, macos-latest, windows-latest ] | ||
python: ['3.8'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Run benchmark | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-test.txt | ||
pytest tests/benchmarks/bench.py --benchmark-json benchmark.json | ||
- name: Store benchmark result | ||
uses: rhysd/github-action-benchmark@v1 | ||
with: | ||
name: Pandas Profiling Benchmarks | ||
tool: 'pytest' | ||
output-file-path: benchmark.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ coverage<5 | |
codecov | ||
pytest-mypy | ||
pytest-cov | ||
pytest-benchmark~=3.2.2 | ||
nbval | ||
pyarrow | ||
flake8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import pandas as pd | ||
|
||
from pandas_profiling import ProfileReport | ||
from pandas_profiling.utils.cache import cache_file | ||
|
||
|
||
def test_titanic_explorative(benchmark): | ||
file_name = cache_file( | ||
"titanic.parquet", | ||
"https://github.com/pandas-profiling/pandas-profiling-data/raw/master/data/titanic.parquet", | ||
) | ||
|
||
data = pd.read_parquet(file_name) | ||
|
||
def func(df): | ||
profile = ProfileReport( | ||
df, title="Titanic Dataset", explorative=True, progress_bar=False | ||
) | ||
report = profile.to_html() | ||
return report | ||
|
||
benchmark(func, data) | ||
|
||
|
||
def test_titanic_default(benchmark): | ||
file_name = cache_file( | ||
"titanic.parquet", | ||
"https://github.com/pandas-profiling/pandas-profiling-data/raw/master/data/titanic.parquet", | ||
) | ||
|
||
data = pd.read_parquet(file_name) | ||
|
||
def func(df): | ||
profile = ProfileReport(df, title="Titanic Dataset", progress_bar=False) | ||
report = profile.to_html() | ||
return report | ||
|
||
benchmark(func, data) | ||
|
||
|
||
def test_titanic_minimal(benchmark): | ||
file_name = cache_file( | ||
"titanic.parquet", | ||
"https://github.com/pandas-profiling/pandas-profiling-data/raw/master/data/titanic.parquet", | ||
) | ||
|
||
data = pd.read_parquet(file_name) | ||
|
||
def func(df): | ||
profile = ProfileReport( | ||
df, title="Titanic Dataset", minimal=True, progress_bar=False | ||
) | ||
report = profile.to_html() | ||
return report | ||
|
||
benchmark(func, data) | ||
|
||
|
||
def test_rdw_minimal(benchmark): | ||
file_name = cache_file( | ||
"rdw.parquet", | ||
"https://github.com/pandas-profiling/pandas-profiling-data/raw/master/data/rdw.parquet", | ||
) | ||
|
||
data = pd.read_parquet(file_name) | ||
|
||
def func(df): | ||
profile = ProfileReport( | ||
df, title="RDW Dataset", minimal=True, progress_bar=False | ||
) | ||
report = profile.to_html() | ||
return report | ||
|
||
benchmark(func, data) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.