diff --git a/.github/workflows/release_to_pypi.yml b/.github/workflows/release_to_pypi.yml new file mode 100644 index 0000000..cb5ad2e --- /dev/null +++ b/.github/workflows/release_to_pypi.yml @@ -0,0 +1,49 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/oasisis + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/code/__pycache__/activity.cpython-310.pyc b/code/__pycache__/activity.cpython-310.pyc deleted file mode 100644 index 5497fad..0000000 Binary files a/code/__pycache__/activity.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/activity.cpython-37.pyc b/code/__pycache__/activity.cpython-37.pyc deleted file mode 100644 index de44541..0000000 Binary files a/code/__pycache__/activity.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/data_utils.cpython-310.pyc b/code/__pycache__/data_utils.cpython-310.pyc deleted file mode 100644 index 772a266..0000000 Binary files a/code/__pycache__/data_utils.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/data_utils.cpython-37.pyc b/code/__pycache__/data_utils.cpython-37.pyc deleted file mode 100644 index 6c50ec0..0000000 Binary files a/code/__pycache__/data_utils.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/error_terms.cpython-310.pyc b/code/__pycache__/error_terms.cpython-310.pyc deleted file mode 100644 index 5a60e5a..0000000 Binary files a/code/__pycache__/error_terms.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/error_terms.cpython-37.pyc b/code/__pycache__/error_terms.cpython-37.pyc deleted file mode 100644 index 538f4cc..0000000 Binary files a/code/__pycache__/error_terms.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/estimation.cpython-310.pyc b/code/__pycache__/estimation.cpython-310.pyc deleted file mode 100644 index 3014a6b..0000000 Binary files a/code/__pycache__/estimation.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/estimation.cpython-37.pyc b/code/__pycache__/estimation.cpython-37.pyc deleted file mode 100644 index bdb335c..0000000 Binary files a/code/__pycache__/estimation.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/helper_func.cpython-310.pyc b/code/__pycache__/helper_func.cpython-310.pyc deleted file mode 100644 index ebb5f03..0000000 Binary files a/code/__pycache__/helper_func.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/helper_func.cpython-37.pyc b/code/__pycache__/helper_func.cpython-37.pyc deleted file mode 100644 index 24b0ea4..0000000 Binary files a/code/__pycache__/helper_func.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/input_data.cpython-310.pyc b/code/__pycache__/input_data.cpython-310.pyc deleted file mode 100644 index 7ecfa8f..0000000 Binary files a/code/__pycache__/input_data.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/input_data.cpython-37.pyc b/code/__pycache__/input_data.cpython-37.pyc deleted file mode 100644 index a542e15..0000000 Binary files a/code/__pycache__/input_data.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/metropolis_hastings.cpython-310.pyc b/code/__pycache__/metropolis_hastings.cpython-310.pyc deleted file mode 100644 index 59ec141..0000000 Binary files a/code/__pycache__/metropolis_hastings.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/metropolis_hastings.cpython-37.pyc b/code/__pycache__/metropolis_hastings.cpython-37.pyc deleted file mode 100644 index b612cc7..0000000 Binary files a/code/__pycache__/metropolis_hastings.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/operators.cpython-310.pyc b/code/__pycache__/operators.cpython-310.pyc deleted file mode 100644 index 54ea173..0000000 Binary files a/code/__pycache__/operators.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/operators.cpython-37.pyc b/code/__pycache__/operators.cpython-37.pyc deleted file mode 100644 index 7ed66b1..0000000 Binary files a/code/__pycache__/operators.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/preprocessing.cpython-310.pyc b/code/__pycache__/preprocessing.cpython-310.pyc deleted file mode 100644 index 4cf1902..0000000 Binary files a/code/__pycache__/preprocessing.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/results.cpython-310.pyc b/code/__pycache__/results.cpython-310.pyc deleted file mode 100644 index 6529880..0000000 Binary files a/code/__pycache__/results.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/results.cpython-37.pyc b/code/__pycache__/results.cpython-37.pyc deleted file mode 100644 index 92196da..0000000 Binary files a/code/__pycache__/results.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/runner.cpython-310.pyc b/code/__pycache__/runner.cpython-310.pyc deleted file mode 100644 index eb505d5..0000000 Binary files a/code/__pycache__/runner.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/runner.cpython-37.pyc b/code/__pycache__/runner.cpython-37.pyc deleted file mode 100644 index df335f2..0000000 Binary files a/code/__pycache__/runner.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/runner_estimation.cpython-310.pyc b/code/__pycache__/runner_estimation.cpython-310.pyc deleted file mode 100644 index 4646d7d..0000000 Binary files a/code/__pycache__/runner_estimation.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/runner_estimation.cpython-37.pyc b/code/__pycache__/runner_estimation.cpython-37.pyc deleted file mode 100644 index a64688c..0000000 Binary files a/code/__pycache__/runner_estimation.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/runner_multiday.cpython-310.pyc b/code/__pycache__/runner_multiday.cpython-310.pyc deleted file mode 100644 index 39a064c..0000000 Binary files a/code/__pycache__/runner_multiday.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/runner_multiday.cpython-37.pyc b/code/__pycache__/runner_multiday.cpython-37.pyc deleted file mode 100644 index e17576f..0000000 Binary files a/code/__pycache__/runner_multiday.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/settings.cpython-310.pyc b/code/__pycache__/settings.cpython-310.pyc deleted file mode 100644 index 9539a58..0000000 Binary files a/code/__pycache__/settings.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/settings.cpython-37.pyc b/code/__pycache__/settings.cpython-37.pyc deleted file mode 100644 index 8da0c24..0000000 Binary files a/code/__pycache__/settings.cpython-37.pyc and /dev/null differ diff --git a/code/__pycache__/simulation.cpython-310.pyc b/code/__pycache__/simulation.cpython-310.pyc deleted file mode 100644 index 24ce118..0000000 Binary files a/code/__pycache__/simulation.cpython-310.pyc and /dev/null differ diff --git a/code/__pycache__/simulation.cpython-37.pyc b/code/__pycache__/simulation.cpython-37.pyc deleted file mode 100644 index 67b6a62..0000000 Binary files a/code/__pycache__/simulation.cpython-37.pyc and /dev/null differ diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..c987233 --- /dev/null +++ b/gitignore @@ -0,0 +1,156 @@ +# Don't track these files + +*~ +.DS_Store +.vscode +.Rhistory + +# Folders +/dask-worker-space/ +/data/DISDRODB/Processed + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +_version.py + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +docs/source/api + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +/venv/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site +*.bkp + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ +train_interactive.py +tmp_fig.py +log.txt diff --git a/code/activity.py b/oasisis/activity.py similarity index 100% rename from code/activity.py rename to oasisis/activity.py diff --git a/code/data_utils.py b/oasisis/data_utils.py similarity index 100% rename from code/data_utils.py rename to oasisis/data_utils.py diff --git a/code/error_terms.py b/oasisis/error_terms.py similarity index 100% rename from code/error_terms.py rename to oasisis/error_terms.py diff --git a/code/estimation.py b/oasisis/estimation.py similarity index 100% rename from code/estimation.py rename to oasisis/estimation.py diff --git a/code/helper_func.py b/oasisis/helper_func.py similarity index 100% rename from code/helper_func.py rename to oasisis/helper_func.py diff --git a/code/input_data.py b/oasisis/input_data.py similarity index 100% rename from code/input_data.py rename to oasisis/input_data.py diff --git a/code/metropolis_hastings.py b/oasisis/metropolis_hastings.py similarity index 100% rename from code/metropolis_hastings.py rename to oasisis/metropolis_hastings.py diff --git a/code/operators.py b/oasisis/operators.py similarity index 100% rename from code/operators.py rename to oasisis/operators.py diff --git a/code/results.py b/oasisis/results.py similarity index 100% rename from code/results.py rename to oasisis/results.py diff --git a/code/runner.py b/oasisis/runner.py similarity index 100% rename from code/runner.py rename to oasisis/runner.py diff --git a/code/runner_estimation.py b/oasisis/runner_estimation.py similarity index 100% rename from code/runner_estimation.py rename to oasisis/runner_estimation.py diff --git a/code/runner_multiday.py b/oasisis/runner_multiday.py similarity index 100% rename from code/runner_multiday.py rename to oasisis/runner_multiday.py diff --git a/code/settings.py b/oasisis/settings.py similarity index 100% rename from code/settings.py rename to oasisis/settings.py diff --git a/code/simulation.py b/oasisis/simulation.py similarity index 100% rename from code/simulation.py rename to oasisis/simulation.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..183702a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,49 @@ +[build-system] +requires = ["setuptools>=61.0", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "oasisis" +authors = [ + {name = "Janody Pougala",email = "janody.pougala@epfl.ch"}, +] +description = "This is a stable version of the OASIS activity-based framework. This repository includes the simulation code, based on the Python API of the CPLEX solver." +readme = "README.md" +keywords = ["python", "disdrometer"] +classifiers = [ + "Development Status :: 1 - Planning", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Operating System :: Unix", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", +] +requires-python = ">=3.8" +dependencies = [ + "click", + "cplex", + "docplex", + "joblib", + "json5", + "jsonschema", + "matplotlib", + "numpy", + "ortools", + "pandas", + "python-dateutil", + "python-json-logger", + "scipy", + "seaborn", + "geopy" +] +dynamic = ["version"] + +[project.optional-dependencies] +dev = [ +] + +[tool.setuptools_scm] +write_to = "oasisis/_version.py" + +[tool.setuptools] +packages = ["oasisis"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9ba3d3a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -cplex==22.1.1.1 -docplex==2.25.236 -joblib==1.2.0 -json5==0.9.6 -jsonschema==4.17.3 -matplotlib==3.7.1 -numpy==1.24.2 -ortools==9.6.2534 -pandas==1.5.3 -pip==23.0.1 -python-dateutil==2.8.2 -python-json-logger==2.0.7 -scipy==1.10.1 -seaborn==0.12.2