Skip to content

Commit

Permalink
Merge pull request #16 from yohila/main
Browse files Browse the repository at this point in the history
Added New Version IOKR
  • Loading branch information
gaetanbrison authored Mar 22, 2023
2 parents 2d81d17 + 2962516 commit 2870d88
Show file tree
Hide file tree
Showing 18 changed files with 5,335 additions and 2,958 deletions.
96 changes: 49 additions & 47 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
name: Build

on:
push:
branches-ignore:
- "main"

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
## os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v2
- name: Build wheels
uses: pypa/[email protected]
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl



# name: Build

# on: [push, pull_request]
# on:
# push:
# branches-ignore:
# - main
# pull_request:
# branches-ignore:
# - main

# jobs:
# build_wheels:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# # os: [ubuntu-20.04, windows-2019, macos-10.15]
# os: [windows-2019]
# os: [macos-10.15]
# # os: [ubuntu-20.04, windows-2019, macos-10.15]

# steps:
# - uses: actions/checkout@v2

# - name: Build wheels
# uses: pypa/[email protected]
# # to supply options, put them in 'env', like:
# # env:
# # CIBW_SOME_OPTION: value

# - uses: actions/upload-artifact@v2
# with:
# path: ./wheelhouse/*.whl



# # name: Build

# # on:
# # push:
# # branches-ignore:
# # - main
# # pull_request:
# # branches-ignore:
# # - main

# # jobs:
# # build_wheels:
# # name: Build wheels on ${{ matrix.os }}
# # runs-on: ${{ matrix.os }}
# # strategy:
# # matrix:
# # os: [macos-10.15]
# # # os: [ubuntu-20.04, windows-2019, macos-10.15]

# # steps:
# # - uses: actions/checkout@v2

# # - name: Build wheels
# # uses: pypa/[email protected]
# # # to supply options, put them in 'env', like:
# # # env:
# # # CIBW_SOME_OPTION: value
# # - uses: actions/upload-artifact@v2
# # with:
# # path: ./wheelhouse/*.whl
# - uses: actions/checkout@v2

# - name: Build wheels
# uses: pypa/[email protected]
# # to supply options, put them in 'env', like:
# # env:
# # CIBW_SOME_OPTION: value
# - uses: actions/upload-artifact@v2
# with:
# path: ./wheelhouse/*.whl
45 changes: 45 additions & 0 deletions .github/workflows/build_wheels_Manul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Generating Wheels

on:
push:
branches-ignore:
- "main"
# branches: [ main ]
schedule:
- cron: '0 0 1 * *'
# pull_request:
# branches:
# - '*'

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
# os: [macos-latest, ubuntu-latest, windows-latest]
python: ['3.7', '3.8', '3.9']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and compile
run: make dist
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v2
with:
path: ./dist/*.whl


37 changes: 37 additions & 0 deletions .github/workflows/build_wheels_Manul_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python package build and publish

# on:
# release:
# types: [created]
on:
push:
branches-ignore:
- "main"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# pip install twine flake8
# - name: Lint with flake8 for syntax errors
# run: |
# pip install flake8
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp39-cp39'
build-requirements: 'cython numpy scikit-learn==1.0'
- uses: actions/upload-artifact@v2
with:
path: ./dist/*.whl

74 changes: 74 additions & 0 deletions .github/workflows/pytest_cp310.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: pytesting 3.10

on:
push:
branches-ignore:
- "main"
# branches: [ main ]
schedule:
- cron: '0 0 1 * *'
# pull_request:
# branches:
# - '*'

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
# os: [macos-latest, ubuntu-latest, windows-latest]
python: ['3.10',]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
################### Use this when you want to use local wheel installation through dist #################
pip install -r requirements.txt
# - name: Lint with flake8
# run: |
# pip install flake8
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# pip install pytest
# pytest -v --cov=structured-predictions --cov-report=html


# - name: Build and compile
# run: |
# make dist
# python setup.py develop

- name: Build and compile
run: |
make clean
# pip install .
################## Use this when you want to use local wheel installation through dist ######################
make dist
pip install dist/*
#############################################################################
# python setup.py develop
# pip install -i https://test.pypi.org/simple/ structured-predictions==0.0.6
# pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple structured-predictions
# pip install -i https://test.pypi.org/simple/ structured-predictions
# python tests/tests_DIOKR/Demo_DeepIOKR_bibtex.py
- name: Test with pytest
run: |
pip install pytest
pytest tests/tests_OK3/test_tree_clf_and_reg.py tests/tests_OK3/test_complementary.py
pytest tests/tests_DIOKR
# python tests/tests_IOKR/ISOKR.py
# python tests/tests_IOKR/SISOKR.py
# pytest tests/tests_IOKR
4 changes: 3 additions & 1 deletion .github/workflows/pytest_cp36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ jobs:
run: |
pip install pytest
pytest tests/tests_OK3/test_tree_clf_and_reg.py tests/tests_OK3/test_complementary.py tests/tests_IOKR tests/tests_DIOKR
# pytest tests/tests_IOKR
# pytest tests/tests_IOKR
20 changes: 12 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[build-system]
requires = ["setuptools", "wheel", "oldest-supported-numpy", "cython>=0.23", "scikit-learn"]
requires = ["setuptools", "wheel", "oldest-supported-numpy", "cython>=0.23", "scikit-learn==0.24.2"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
# Only build on CPython 3.9
#build = "cp39-*"
# build = "cp310-*"
#skip = ["cp39-musllinux*"]

# Skip for Windows
skip = ["pp*", "cp310-*"]
# skip = ["pp*", "cp310-*", "cp36-*"]
#Skip for MacOS
# skip = ["pp*"]
#Skip for Ubuntu # 32bit cp310 results in error
# skip = ["cp36-musllinux*", "cp37-musllinux*", "cp38-musllinux*", "cp39-musllinux*", "pp*", "cp310-*"]
# skip = ["pp*", "cp36-*"]
# Skip for Ubuntu # 32bit cp310 results in error
skip = ["cp36-musllinux*", "cp37-musllinux*", "cp38-musllinux*", "cp39-musllinux*", "pp*", "cp310-*", "cp36-*"]
# skip = ["cp36-*", "cp37-*", "cp38-*", "pp*", "cp310-*"]


# Build `universal2` and `arm64` wheels on an Intel runner.
Expand All @@ -24,5 +25,8 @@ archs = ["x86_64", "universal2", "arm64"]
# On an Linux Intel runner with qemu installed, build Intel and ARM wheels
[tool.cibuildwheel.linux]
#archs = ["auto", "aarch64"] # aarch64 results in unfinished job on github Action
archs = ["auto"]
#archs = ["x86_64"]
# archs = ["auto"]
archs = ["x86_64"]

[tool.cibuildwheel.windows]
archs = ['AMD64']
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

setup(
name='structured-predictions',
version='0.0.9',
version='0.1.1',
description='Structured-Predictions',
# long_description=README,
long_description_content_type='text/markdown',
Expand Down Expand Up @@ -89,7 +89,7 @@
setup_requires=["oldest-supported-numpy", "cython>=0.23"],
# install_requires=["numpy>=1.16", "scipy>=1.0", "scikit-learn", "torch",
# "liac-arff", "requests"],
install_requires=["numpy", "scipy", "scikit-learn", "torch",
install_requires=["numpy", "scipy", "scikit-learn==0.24.2", "torch",
"liac-arff", "requests"],
python_requires=">=3.6",
classifiers=[
Expand Down
4 changes: 2 additions & 2 deletions stpredictions/datasets/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def load_bibtex_train_from_arff():
"""
path_tr = join(project_root(), 'datasets/bibtex/bibtex-train.arff')
print(path_tr)
# print(path_tr)
X_train, Y_train = load_from_arff(path_tr, label_count=159)
return X_train, Y_train

Expand All @@ -195,7 +195,7 @@ def load_bibtex_test_from_arff():
"""
path_tr = join(project_root(), 'datasets/bibtex/bibtex-test.arff')
print(path_tr)
# print(path_tr)
X_test, Y_test = load_from_arff(path_tr, label_count=159)
return X_test, Y_test

Expand Down
Loading

0 comments on commit 2870d88

Please sign in to comment.