-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding pip * add tests * fix test bug * fix example * change test name
- Loading branch information
1 parent
21c013d
commit ecf3401
Showing
13 changed files
with
263 additions
and
57 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,31 @@ | ||
name: Upload Python Package to PyPI when a Release is Created | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Publish release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/multi_comp_matrix | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
- name: Build package | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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,44 @@ | ||
name: PR pytest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "multi_comp_matrix/**" | ||
- ".github/workflows/**" | ||
- "pyproject.toml" | ||
|
||
jobs: | ||
test-mcm: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-22.04, macOS-14, windows-2022 ] | ||
python-version: [ "3.10" ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 30 | ||
max_attempts: 3 | ||
command: python -m pip install .[dev] | ||
|
||
- name: Show dependencies | ||
run: python -m pip list | ||
|
||
- name: Run tests | ||
run: python -m pytest -n logical |
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,9 @@ | ||
recursive-include multi_comp_matrix *.py | ||
include LICENSE | ||
include MANIFEST.in | ||
include pyproject.toml | ||
include README.md | ||
include *.csv | ||
include *.pdf | ||
include *.png | ||
include *.tex |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
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
File renamed without changes.
Empty file.
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,41 @@ | ||
from multi_comp_matrix.MCM import compare | ||
import pandas as pd | ||
import tempfile | ||
import time | ||
import pytest | ||
|
||
@pytest.mark.parametrize("save_type", ["pdf", "png", "tex"]) | ||
def test_all_type_saving(save_type): | ||
"""Test each of the save types.""" | ||
data = { | ||
'clf1': [1, 2, 3, 4], | ||
'clf2': [4.0, 6.0, 2.0, 1.0], | ||
'clf3': [10.5, 20.5, 30.5, 40.5] | ||
} | ||
df = pd.DataFrame(data) | ||
with tempfile.TemporaryDirectory() as tmp: | ||
if save_type == "pdf": | ||
curr_time = str(time.time_ns()) | ||
|
||
compare(df_results=df, output_dir=tmp, pdf_savename=curr_time+"test_pdf") | ||
compare(df_results=df, output_dir=tmp, pdf_savename=curr_time+"test_vertical_pdf", | ||
excluded_col_comparates=["clf1", "clf3"],) | ||
compare(df_results=df, output_dir=tmp, pdf_savename=curr_time+"test_horizontal_pdf", | ||
excluded_row_comparates=["clf1", "clf3"],) | ||
elif save_type == "png": | ||
curr_time = str(time.time_ns()) | ||
|
||
compare(df_results=df, output_dir=tmp, png_savename=curr_time+"test_png") | ||
compare(df_results=df, output_dir=tmp, png_savename=curr_time+"test_vertical_png", | ||
excluded_col_comparates=["clf1", "clf3"],) | ||
compare(df_results=df, output_dir=tmp, png_savename=curr_time+"test_horizontal_png", | ||
excluded_row_comparates=["clf1", "clf3"],) | ||
elif save_type == "tex": | ||
curr_time = str(time.time_ns()) | ||
|
||
compare(df_results=df, output_dir=tmp, tex_savename=curr_time+"test_tex") | ||
compare(df_results=df, output_dir=tmp, tex_savename=curr_time+"test_vertical_tex", | ||
excluded_col_comparates=["clf1", "clf3"],) | ||
compare(df_results=df, output_dir=tmp, tex_savename=curr_time+"test_horizontal_tex", | ||
excluded_row_comparates=["clf1", "clf3"],) | ||
|
File renamed without changes.
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,77 @@ | ||
[build-system] | ||
requires = ["setuptools>61", "wheel", "toml", "build"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "multi_comp_matrix" | ||
version = "0.0.1" | ||
description = " Multi Comparison Matrix: A long term approach to benchmark evaluations " | ||
readme = { file = "README.md", content-type = "text/markdown" } | ||
authors = [ | ||
{name = "Ali Ismail-Fawaz", email = "[email protected]"}, | ||
{name = "Maxime Devanne", email = "[email protected]"}, | ||
{name = "Stefano Berretti", email = "[email protected]"}, | ||
{name = "Jonathan Weber", email = "[email protected]"}, | ||
{name = "Germain Forestier", email = "[email protected]"} | ||
] | ||
maintainers = [ | ||
{name = "Ali Ismail-Fawaz", email = "[email protected]"} | ||
] | ||
requires-python = ">=3.10" | ||
license = {text = "GPL-3.0-only"} | ||
|
||
keywords = [ | ||
"data-science", | ||
"machine-learning", | ||
"data-mining", | ||
"time-series", | ||
"time-series-analysis", | ||
"time-series-classification", | ||
"time-series-regression", | ||
"time-series-machine-learning", | ||
"benchmarking", | ||
"benchmarking-machine-learning" | ||
] | ||
|
||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12" | ||
] | ||
|
||
dependencies = [ | ||
"numpy==1.24.4", | ||
"pandas==2.0.3", | ||
"matplotlib==3.7.4", | ||
"scipy==1.10.0", | ||
"baycomp==1.0", | ||
"tqdm==4.66.1" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black", | ||
"flake8", | ||
"mypy", | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-xdist", | ||
"pytest-timeout", | ||
"pytest-rerunfailures", | ||
"pre-commit" | ||
] | ||
|
||
[tool.setuptools] | ||
packages = ["multi_comp_matrix"] | ||
|
||
[tool.setuptools.package-data] | ||
multi_comp_matrix = [ | ||
"*.png", | ||
"*.csv", | ||
"*.pdf", | ||
"*.tex", | ||
] |