-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
219 additions
and
67 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,34 @@ | ||
# This workflow will upload a Python Package | ||
# using Twine when a release is created | ||
|
||
name: publish | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine upload dist/* |
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 @@ | ||
# This workflow will install Python dependencies, | ||
# then run tests over a variety of Python versions. | ||
|
||
name: test | ||
|
||
on: | ||
push: | ||
branches: [ main, dev ] | ||
tags: [ '*' ] | ||
pull_request: | ||
branches: [ main, dev ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-test.txt | ||
python3 -m pip install -r requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
python3 -m pytest --cov=disent tests/ | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
# codecov automatically merges all generated files | ||
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 |
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 @@ | ||
include requirements.txt |
This file was deleted.
Oops, something went wrong.
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
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
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 was deleted.
Oops, something went wrong.
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,3 @@ | ||
|
||
pytest == 6.2.2 | ||
pytest-cov == 2.11.1 |
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 |
---|---|---|
@@ -1,58 +1,58 @@ | ||
pip == 21.0 | ||
pip>=21.0 | ||
|
||
# DATA SCIENCE & ML | ||
# ================= | ||
numpy == 1.19.5 | ||
# pandas == 1.2.1 | ||
numpy==1.19.5 | ||
# pandas==1.2.1 | ||
|
||
# opencv-python == 4.5.1.48 | ||
# opencv-python==4.5.1.48 | ||
|
||
torch == 1.7.1 | ||
torchvision == 0.8.2 | ||
torch-optimizer == 0.1.0 | ||
pytorch-lightning == 1.1.5 | ||
# pytorch-lightning-bolts == 0.3.0 | ||
torch==1.7.1 | ||
torchvision==0.8.2 | ||
torch-optimizer==0.1.0 | ||
pytorch-lightning==1.1.7 | ||
# pytorch-lightning-bolts==0.3.0 | ||
|
||
# tensorflow == 2.4.1 | ||
# tensorflow-gpu == 2.4.1 | ||
# tensorboard == 2.4.1 | ||
# tensorflow==2.4.1 | ||
# tensorflow-gpu==2.4.1 | ||
# tensorboard==2.4.1 | ||
|
||
scipy == 1.6.0 | ||
scikit-learn == 0.24.1 | ||
# xgboost == 1.3.3 | ||
# lightgbm == 3.1.1 | ||
scipy==1.6.0 | ||
scikit-learn==0.24.1 | ||
# xgboost==1.3.3 | ||
# lightgbm==3.1.1 | ||
|
||
# IMAGE AUGMENTATION | ||
# ================== | ||
kornia == 0.4.1 # $ pip install git+https://github.com/kornia/kornia | ||
# imgaug == 0.4.0 | ||
# albumentations == 0.5.2 | ||
kornia==0.4.1 # $ pip install git+https://github.com/kornia/kornia | ||
# imgaug==0.4.0 | ||
# albumentations==0.5.2 | ||
|
||
# INPUT / OUTPUT | ||
# ================ | ||
# psutil == 5.8.0 | ||
# pillow == 8.1.0 | ||
# imageio == 2.9.0 | ||
# moviepy == 1.0.3 | ||
h5py >= 2.10.0 # as of tensorflow 2.4 it does not support h5py 3+ | ||
# psutil==5.8.0 | ||
# pillow==8.1.0 | ||
# imageio==2.9.0 | ||
# moviepy==1.0.3 | ||
h5py>=2.10.0 # as of tensorflow 2.4 it does not support h5py 3+ | ||
|
||
# GRAPHING & DISPLAY | ||
# ================== | ||
matplotlib == 3.3.3 | ||
# plotly == 4.14.3 | ||
# seaborn == 0.11.1 | ||
# tqdm == 4.56.0 | ||
matplotlib==3.3.4 | ||
# plotly==4.14.3 | ||
# seaborn==0.11.1 | ||
# tqdm==4.56.0 | ||
|
||
# streamlit == 0.75.0 | ||
wandb == 0.10.15 | ||
# streamlit==0.75.0 | ||
wandb==0.10.17 | ||
|
||
# UTILITY | ||
# ======= | ||
# pytest == 6.2.1 | ||
# pytest==6.2.1 | ||
|
||
hydra-core == 1.0.5 | ||
hydra-colorlog == 1.0.0 | ||
# hydra-joblib-launcher == 1.1.1 | ||
hydra-submitit-launcher == 1.0.1 | ||
hydra-core==1.0.6 | ||
hydra-colorlog==1.0.0 | ||
# hydra-joblib-launcher==1.1.1 | ||
hydra-submitit-launcher==1.1.0 | ||
|
||
# submitit == 1.1.5 | ||
# submitit==1.1.5 |
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,33 @@ | ||
import setuptools | ||
|
||
|
||
with open("README.md", "r", encoding="utf-8") as file: | ||
long_description = file.read() | ||
|
||
with open('requirements.txt', 'r') as f: | ||
install_requires = (req[0] for req in map(lambda x: x.split('#'), f.readlines())) | ||
install_requires = [req for req in map(str.strip, install_requires) if req] | ||
|
||
|
||
setuptools.setup( | ||
name="disent", | ||
author="Nathan Juraj Michlo", | ||
author_email="[email protected]", | ||
|
||
version="0.0.1.dev1", | ||
python_requires="==3.8", | ||
packages=setuptools.find_packages(), | ||
|
||
install_requires=install_requires, | ||
|
||
url="https://github.com/nmichlo/eunomia", | ||
description="Vae disentanglement framework built with pytorch lightning.", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
|
||
classifiers=[ | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.8", | ||
"Intended Audience :: Science/Research", | ||
], | ||
) |
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,30 @@ | ||
import sys | ||
from contextlib import contextmanager | ||
import pytest | ||
import os | ||
from glob import glob | ||
from disent.util import _set_test_run | ||
|
||
|
||
@contextmanager | ||
def no_stdout(): | ||
old_stdout = sys.stdout | ||
sys.stdout = open(os.devnull, 'w') | ||
yield | ||
sys.stdout = old_stdout | ||
|
||
|
||
ROOT_DIR = os.path.abspath(__file__ + '/../..') | ||
|
||
|
||
@pytest.mark.parametrize("module", [ | ||
os.path.relpath(path, ROOT_DIR).replace('/', '.')[:-3] | ||
for path in glob(os.path.join(ROOT_DIR, 'docs/examples/**.py')) | ||
]) | ||
def test_docs_examples(capsys, module): | ||
# make sure everything doesnt take 5 years to run | ||
_set_test_run() | ||
# run all the files in the examples folder | ||
import importlib | ||
with no_stdout(): | ||
importlib.import_module(module) |
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