Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toml config and gather dependency files #478

Merged
merged 7 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_PyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build wheel
pip install -r requirements.txt
pip install -r requirements/requirements.txt

- name: Fetch the test environment details
run: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/testing_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,29 @@ jobs:
check-latest: true
cache: pip
cache-dependency-path: |
setup.cfg
requirements/requirements.txt
requirements/requirements_dev.txt

- name: Install PyTorch ${{ matrix.pytorch-version }}+cpu
# we have to install torch in advance because torch_sparse needs it for compilation,
# refer to https://github.com/rusty1s/pytorch_sparse/issues/156#issuecomment-1304869772 for details
run: |
which python
which pip
pip install numpy==1.24 torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/cpu
pip install torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/cpu
python -c "import torch; print('PyTorch:', torch.__version__)"

- name: Install other dependencies
run: |
pip install -r requirements.txt
pip install -r requirements/requirements.txt
pip install numpy==1.24 # many libs not compatible with numpy 2.0. Note 3.12 requests for numpy>=2.0
pip install pandas==1.5 # fix pandas version to avoid installing pandas 2.0, the same reason with numpy

- name: Test building package
# we need to know if the package can be built successfully without optional dependencies
run: |
pip install build wheel
python -m build --no-isolation
python -m build

- name: Continue to install torch-geometric dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build:
- python -m pip install --upgrade pip
- pip install torch==1.13.1 -f https://download.pytorch.org/whl/cpu
- pip install torch-geometric==2.3.1 torch-scatter==2.1.1 torch-sparse==0.6.17 -f "https://data.pyg.org/whl/torch-1.13.1+cpu.html"
- pip install -r requirements.txt
- pip install -r requirements/requirements.txt
- pip install pypots
- pip install sphinx==6.2.1 docutils==0.19 sphinxcontrib-bibtex==2.1.4 sphinxcontrib-gtagjs sphinx-autodoc-typehints furo==2023.07.26
- git clone https://github.com/WenjieDu/TSDB TSDB_repo --depth 1 && pip install ./TSDB_repo
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

91 changes: 91 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[build-system]
requires = ["setuptools>=71"]

[project]
name = "pypots"
description = "A Python Toolbox for Machine Learning on Partially-Observed Time Series"
authors = [{ name = "Wenjie Du", email = "wenjay.du@gmail.com" }]
dynamic = ["version", "readme", "dependencies", "optional-dependencies"]
license = { file = "LICENSE" }
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Healthcare Industry",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
keywords = [
"data science",
"data mining",
"neural networks",
"machine learning",
"deep learning",
"artificial intelligence",
"time-series analysis",
"time series",
"imputation",
"interpolation",
"classification",
"clustering",
"forecasting",
"partially observed",
"irregular sampled",
"partially-observed time series",
"incomplete time series",
"missing data",
"missing values",
]

[project.scripts]
pypots-cli = "pypots.cli.pypots_cli:main"

[project.urls]
Source = "https://github.com/WenjieDu/PyPOTS"
Homepage = "https://pypots.com"
Documentation = "https://docs.pypots.com"
"Bug Tracker" = "https://github.com/WenjieDu/PyPOTS/issues"
Download = "https://github.com/WenjieDu/PyPOTS/archive/main.zip"

[tool.setuptools.packages.find]
exclude = [
"*template",
"*README.md",
"docs*",
"test*",
"requirements*",
]

[tool.setuptools.dynamic]
version = { attr = "pypots.version.__version__" }
readme = { file = "README.md", content-type = "text/markdown" }
dependencies = { file = "requirements/requirements.txt" }
optional-dependencies.dev = { file = "requirements/requirements_dev.txt" }

[tool.flake8]
# People may argue that coding style is personal. This may be true if the project is personal and one works like a
# hermit, but to PyPOTS and its community, the answer is NO.
# We use Black and Flake8 to lint code style and keep the style consistent across all commits and pull requests.
# Black only reformats the code, and Flake8 is necessary for checking for some other issues not covered by Black.

# The Black line length is default as 88, while the default of Flake8 is 79. However, considering our monitors are
# much more advanced nowadays, I extend the maximum line length to 120, like other project e.g. transformers. People
# who prefer the default setting can keep using 88 or 79 while coding. Please ensure your code lines not exceeding 120.
max-line-length = 120
# why ignore E203? Refer to https://github.com/PyCQA/pycodestyle/issues/373
extend-ignore = """
E203
"""
# ignore some errors that are not important in template files
exclude = [
"*/template"
]
16 changes: 0 additions & 16 deletions requirements.txt

This file was deleted.

9 changes: 5 additions & 4 deletions environment-dev.yml → requirements/conda_env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pypots-dev
name: pypots

channels:
- conda-forge
Expand All @@ -16,11 +16,12 @@ dependencies:
- conda-forge::python
- conda-forge::einops
- conda-forge::pandas
- conda-forge::seaborn
- conda-forge::matplotlib
- conda-forge::tensorboard
- conda-forge::scikit-learn
- conda-forge::tsdb >=0.4
- conda-forge::pygrinder >=0.6
- conda-forge::tsdb >=0.6
- conda-forge::benchpots >=0.2
- pytorch::pytorch >=1.10.0
## Below we install the latest pypots because we need pypots-cli in it for development.
Expand Down Expand Up @@ -49,7 +50,7 @@ dependencies:
- conda-forge::jupyterlab

- pip:
# building
- build
# doc
- sphinxcontrib-gtagjs
# hyperparameter tuning
- nni
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ dependencies:
- conda-forge::numpy
- conda-forge::einops
- conda-forge::pandas
- conda-forge::seaborn
- conda-forge::matplotlib
- conda-forge::tensorboard
- conda-forge::scikit-learn
- conda-forge::tsdb >=0.4
- conda-forge::tsdb >=0.6
- conda-forge::pygrinder >=0.6
- conda-forge::benchpots >=0.2
- conda-forge::protobuf <=4.21.12
Expand All @@ -46,5 +47,5 @@ dependencies:
- conda-forge::flake8

- pip:
# doc
- sphinxcontrib-gtagjs
# doc
- sphinxcontrib-gtagjs
14 changes: 14 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
h5py
numpy
scipy
sympy
einops
pandas
seaborn
matplotlib
tensorboard
scikit-learn
torch>=1.10.0
tsdb>=0.6
pygrinder>=0.6
benchpots>=0.2
16 changes: 16 additions & 0 deletions requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
build
torch-sparse
torch-scatter
torch-geometric
pre-commit
jupyterlab
black
flake8
flake8-pyproject
pytest-cov
pytest-xdist
furo
sphinx
sphinxcontrib-bibtex
sphinxcontrib-gtagjs
sphinx-autodoc-typehints
76 changes: 0 additions & 76 deletions setup.cfg

This file was deleted.

Loading