From fca2dd1241b0ab887b94bbc570874c74a007d417 Mon Sep 17 00:00:00 2001 From: Juan Esteban Aristizabal Date: Sat, 22 May 2021 18:27:51 -0500 Subject: [PATCH 1/2] chore: migrated to pyproject.toml --- Pipfile | 4 +-- Pipfile.lock | 25 ++++++++++++++ dinjo/predefined/__init__.py | 0 docs/source/conf.py | 9 +++-- examples/col_vars_params.py | 2 +- examples/seirv_model_colombia.py | 2 +- pyproject.toml | 2 +- setup.cfg | 34 +++++++++++++++++++ setup.py | 16 +-------- src/dinjo/__init__.py | 1 + {dinjo => src/dinjo}/model.py | 0 {dinjo => src/dinjo}/optimizer.py | 0 {dinjo => src/dinjo/predefined}/__init__.py | 0 .../predefined/epidemiology/__init__.py | 0 .../predefined/epidemiology/_seir_model.py | 0 .../predefined/epidemiology/_seirv_fixed.py | 0 .../predefined/epidemiology/_seirv_model.py | 0 .../predefined/epidemiology/_sir_model.py | 0 .../dinjo}/predefined/physics/__init__.py | 0 .../physics/_harmonic_oscillator.py | 0 20 files changed, 72 insertions(+), 23 deletions(-) delete mode 100644 dinjo/predefined/__init__.py create mode 100644 setup.cfg create mode 100644 src/dinjo/__init__.py rename {dinjo => src/dinjo}/model.py (100%) rename {dinjo => src/dinjo}/optimizer.py (100%) rename {dinjo => src/dinjo/predefined}/__init__.py (100%) rename {dinjo => src/dinjo}/predefined/epidemiology/__init__.py (100%) rename {dinjo => src/dinjo}/predefined/epidemiology/_seir_model.py (100%) rename {dinjo => src/dinjo}/predefined/epidemiology/_seirv_fixed.py (100%) rename {dinjo => src/dinjo}/predefined/epidemiology/_seirv_model.py (100%) rename {dinjo => src/dinjo}/predefined/epidemiology/_sir_model.py (100%) rename {dinjo => src/dinjo}/predefined/physics/__init__.py (100%) rename {dinjo => src/dinjo}/predefined/physics/_harmonic_oscillator.py (100%) diff --git a/Pipfile b/Pipfile index 057c0b1..ca218d7 100644 --- a/Pipfile +++ b/Pipfile @@ -22,9 +22,9 @@ dinjo = {editable = true, path = "."} tests = "python -m pytest tests" tests-cov = "python -m pytest tests --cov dinjo" tests-cov-html = "python -m pytest tests --cov-report html --cov dinjo" -linter = "flake8 dinjo tests examples --max-line-length=99" +linter = "flake8 src/dinjo tests examples --max-line-length=99" docs = "make -C docs html" -docs-latex = "make -C docs latexpdf" +docs-latex = "make -C docs latexpdf LATEXMKOPTS='-silent'" docs-clean = "make -C docs clean" [requires] diff --git a/Pipfile.lock b/Pipfile.lock index 32d287c..75392c6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -526,6 +526,31 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==2.25.1" }, + "scipy": { + "hashes": [ + "sha256:01b38dec7e9f897d4db04f8de4e20f0f5be3feac98468188a0f47a991b796055", + "sha256:10dbcc7de03b8d635a1031cb18fd3eaa997969b64fdf78f99f19ac163a825445", + "sha256:19aeac1ad3e57338723f4657ac8520f41714804568f2e30bd547d684d72c392e", + "sha256:1b21c6e0dc97b1762590b70dee0daddb291271be0580384d39f02c480b78290a", + "sha256:1caade0ede6967cc675e235c41451f9fb89ae34319ddf4740194094ab736b88d", + "sha256:23995dfcf269ec3735e5a8c80cfceaf384369a47699df111a6246b83a55da582", + "sha256:2a799714bf1f791fb2650d73222b248d18d53fd40d6af2df2c898db048189606", + "sha256:3274ce145b5dc416c49c0cf8b6119f787f0965cd35e22058fe1932c09fe15d77", + "sha256:33d1677d46111cfa1c84b87472a0274dde9ef4a7ef2e1f155f012f5f1e995d8f", + "sha256:44d452850f77e65e25b1eb1ac01e25770323a782bfe3a1a3e43847ad4266d93d", + "sha256:9e3302149a369697c6aaea18b430b216e3c88f9a61b62869f6104881e5f9ef85", + "sha256:a75b014d3294fce26852a9d04ea27b5671d86736beb34acdfc05859246260707", + "sha256:ad7269254de06743fb4768f658753de47d8b54e4672c5ebe8612a007a088bd48", + "sha256:b30280fbc1fd8082ac822994a98632111810311a9ece71a0e48f739df3c555a2", + "sha256:b79104878003487e2b4639a20b9092b02e1bad07fc4cf924b495cf413748a777", + "sha256:d449d40e830366b4c612692ad19fbebb722b6b847f78a7b701b1e0d6cda3cc13", + "sha256:d647757373985207af3343301d89fe738d5a294435a4f2aafb04c13b4388c896", + "sha256:f68eb46b86b2c246af99fcaa6f6e37c7a7a413e1084a794990b877f2ff71f7b6", + "sha256:fdf606341cd798530b05705c87779606fcdfaf768a8129c348ea94441da15b04" + ], + "index": "pypi", + "version": "==1.6.3" + }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", diff --git a/dinjo/predefined/__init__.py b/dinjo/predefined/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/docs/source/conf.py b/docs/source/conf.py index e7c02dd..2c32334 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,8 +15,9 @@ import sphinx_rtd_theme # noqa -sys.path.insert(0, os.path.abspath('../../')) +sys.path.insert(0, os.path.abspath('../../src')) +from dinjo import VERSION # -- Project information ----------------------------------------------------- @@ -24,8 +25,10 @@ copyright = '2021, Juan Esteban Aristizabal-Zuluaga and FEnFiSDi' author = 'Juan Esteban Aristizabal-Zuluaga and FEnFiSDi' -version = '0.0' -release = '0.0.dev1' +dinjo_version = VERSION.split('.') + +version = '.'.join(dinjo_version[:2]) +release = '.'.join(dinjo_version[:3]) # -- General configuration --------------------------------------------------- diff --git a/examples/col_vars_params.py b/examples/col_vars_params.py index 4c58cd6..7f7f175 100644 --- a/examples/col_vars_params.py +++ b/examples/col_vars_params.py @@ -1,5 +1,5 @@ from dinjo.model import Parameter, StateVariable -from examples.cmodel_examples_utilities import param_sample_range +from cmodel_examples_utilities import param_sample_range # Instantiation of state variables and parameters diff --git a/examples/seirv_model_colombia.py b/examples/seirv_model_colombia.py index 35f17e5..609fff5 100644 --- a/examples/seirv_model_colombia.py +++ b/examples/seirv_model_colombia.py @@ -8,7 +8,7 @@ from dinjo import model from dinjo.predefined.epidemiology import ModelSEIRV # State variables and parameters are setup in col_vars_params.py module -from examples.col_vars_params import ( +from col_vars_params import ( seirv_state_variables_colombia, seirv_parameters_colombia ) diff --git a/pyproject.toml b/pyproject.toml index b0471b7..07de284 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta:__legacy__" \ No newline at end of file +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..1ca9b5c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,34 @@ +[metadata] +name = DINJO +version = attr:dinjo.VERSION +author = Juan Esteban Aristizabal-Zuluaga +author_email = jeaz.git@gmail.com +description = DINJO lets you find optimal values of initial value problems´ parameters +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/fenfisdi/dinjo +project_urls = + Documentation = https://dinjo.readthedocs.io/ +license = gplv3 +classifiers = + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Topic :: Scientific/Engineering + Topic :: Scientific/Engineering :: Mathematics + +[options] +package_dir = + = src +packages = find: +install_requires = + numpy==1.20.3 + scipy==1.6.3 +python_requires = >=3.8 +zip_safe = False + +[options.packages.find] +where = src diff --git a/setup.py b/setup.py index be5357e..b908cbe 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,3 @@ import setuptools -with open("README.md", "r") as f: - long_description = f.read() - -setuptools.setup( - name='DINJO', - version='0.0.dev1', - description='DINJO lets you find optimal values of initial value problems\' parameters', - long_description=long_description, - long_description_content_type="text/markdown", - author='Juan Esteban Aristizabal-Zuluaga', - author_email='jeaz.git@gmail.com', - license='gplv3', - packages=['dinjo'], - zip_safe=False -) +setuptools.setup() diff --git a/src/dinjo/__init__.py b/src/dinjo/__init__.py new file mode 100644 index 0000000..8a5a9d3 --- /dev/null +++ b/src/dinjo/__init__.py @@ -0,0 +1 @@ +VERSION = '0.0.dev1' diff --git a/dinjo/model.py b/src/dinjo/model.py similarity index 100% rename from dinjo/model.py rename to src/dinjo/model.py diff --git a/dinjo/optimizer.py b/src/dinjo/optimizer.py similarity index 100% rename from dinjo/optimizer.py rename to src/dinjo/optimizer.py diff --git a/dinjo/__init__.py b/src/dinjo/predefined/__init__.py similarity index 100% rename from dinjo/__init__.py rename to src/dinjo/predefined/__init__.py diff --git a/dinjo/predefined/epidemiology/__init__.py b/src/dinjo/predefined/epidemiology/__init__.py similarity index 100% rename from dinjo/predefined/epidemiology/__init__.py rename to src/dinjo/predefined/epidemiology/__init__.py diff --git a/dinjo/predefined/epidemiology/_seir_model.py b/src/dinjo/predefined/epidemiology/_seir_model.py similarity index 100% rename from dinjo/predefined/epidemiology/_seir_model.py rename to src/dinjo/predefined/epidemiology/_seir_model.py diff --git a/dinjo/predefined/epidemiology/_seirv_fixed.py b/src/dinjo/predefined/epidemiology/_seirv_fixed.py similarity index 100% rename from dinjo/predefined/epidemiology/_seirv_fixed.py rename to src/dinjo/predefined/epidemiology/_seirv_fixed.py diff --git a/dinjo/predefined/epidemiology/_seirv_model.py b/src/dinjo/predefined/epidemiology/_seirv_model.py similarity index 100% rename from dinjo/predefined/epidemiology/_seirv_model.py rename to src/dinjo/predefined/epidemiology/_seirv_model.py diff --git a/dinjo/predefined/epidemiology/_sir_model.py b/src/dinjo/predefined/epidemiology/_sir_model.py similarity index 100% rename from dinjo/predefined/epidemiology/_sir_model.py rename to src/dinjo/predefined/epidemiology/_sir_model.py diff --git a/dinjo/predefined/physics/__init__.py b/src/dinjo/predefined/physics/__init__.py similarity index 100% rename from dinjo/predefined/physics/__init__.py rename to src/dinjo/predefined/physics/__init__.py diff --git a/dinjo/predefined/physics/_harmonic_oscillator.py b/src/dinjo/predefined/physics/_harmonic_oscillator.py similarity index 100% rename from dinjo/predefined/physics/_harmonic_oscillator.py rename to src/dinjo/predefined/physics/_harmonic_oscillator.py From dbba2fdf6da3df7ded9afe6d295eea10d4fc8dca Mon Sep 17 00:00:00 2001 From: Juan Esteban Aristizabal Date: Sun, 23 May 2021 13:34:56 -0500 Subject: [PATCH 2/2] chore: updated classifiers in setup.cfg and scripts in Pipfile --- Pipfile | 4 ++-- Pipfile.lock | 1 - requirements-dev.txt | 2 +- setup.cfg | 4 ++++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index ca218d7..cd5523b 100644 --- a/Pipfile +++ b/Pipfile @@ -20,8 +20,8 @@ dinjo = {editable = true, path = "."} [scripts] tests = "python -m pytest tests" -tests-cov = "python -m pytest tests --cov dinjo" -tests-cov-html = "python -m pytest tests --cov-report html --cov dinjo" +tests-cov = "python -m pytest tests --cov src/dinjo" +tests-cov-html = "python -m pytest tests --cov-report html --cov src/dinjo" linter = "flake8 src/dinjo tests examples --max-line-length=99" docs = "make -C docs html" docs-latex = "make -C docs latexpdf LATEXMKOPTS='-silent'" diff --git a/Pipfile.lock b/Pipfile.lock index 75392c6..923ad8b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -635,7 +635,6 @@ "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.2" }, "urllib3": { diff --git a/requirements-dev.txt b/requirements-dev.txt index f06ecae..74af979 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -53,5 +53,5 @@ sphinxcontrib-htmlhelp==2.0.0; python_version >= '3.6' sphinxcontrib-jsmath==1.0.1; python_version >= '3.5' sphinxcontrib-qthelp==1.0.3; python_version >= '3.5' sphinxcontrib-serializinghtml==1.1.5; python_version >= '3.5' -toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' +toml==0.10.2 urllib3==1.26.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' diff --git a/setup.cfg b/setup.cfg index 1ca9b5c..1d082c1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,10 @@ classifiers = License :: OSI Approved :: GNU General Public License v3 (GPLv3) Topic :: Scientific/Engineering Topic :: Scientific/Engineering :: Mathematics + Development Status :: 3 - Alpha + Topic :: Software Development :: Libraries :: Python Modules + Topic :: Software Development :: Libraries + Topic :: Software Development [options] package_dir =