From 43a782017c25ca6d946a11b004aada39af30620f Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 10:42:00 +0100 Subject: [PATCH 01/43] add matrix to CI to expand tests --- .github/workflows/ci.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68351191a..1c9d58adc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,20 @@ jobs: # Only then, normal testing proceeds unit-tests: needs: qa - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | @@ -48,14 +54,19 @@ jobs: regression-tests: needs: qa - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | From 51d66b2dee2b2a762eaa7fe88c66383cd968d9ac Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 10:42:07 +0100 Subject: [PATCH 02/43] Added GitHub workflow to check for broken links --- .github/workflows/broken-link-check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/broken-link-check.yml diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml new file mode 100644 index 000000000..67f78cbc6 --- /dev/null +++ b/.github/workflows/broken-link-check.yml @@ -0,0 +1,19 @@ +on: + schedule: + - cron: 0 0 1 * * # run monthly + repository_dispatch: # run manually + types: [check-link] + # push: + # ... + +name: Broken Link Check +jobs: + check: + name: Broken Link Check + runs-on: ubuntu-latest + steps: + - name: Broken Link Check + uses: technote-space/broken-link-checker-action@v2 + with: + TARGET: https://muse-os.readthedocs.io/en/latest/ + From 61e6293bfacec80321df88941de842be45e7f62a Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 11:21:08 +0100 Subject: [PATCH 03/43] Run workflow on push --- .github/workflows/broken-link-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 67f78cbc6..40dcb8d92 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -3,8 +3,8 @@ on: - cron: 0 0 1 * * # run monthly repository_dispatch: # run manually types: [check-link] - # push: - # ... + push: + branches: [develop, broken_link_checker] name: Broken Link Check jobs: From 501ec0ee317d326b86a2998c5ebd60714db53a5c Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 11:30:27 +0100 Subject: [PATCH 04/43] Recursively check for broken links --- .github/workflows/broken-link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 40dcb8d92..ca498d8b9 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -16,4 +16,4 @@ jobs: uses: technote-space/broken-link-checker-action@v2 with: TARGET: https://muse-os.readthedocs.io/en/latest/ - + RECURSIVE: true From 70ef6a416f13aeb2e1f3cf505b2f6b015d452f84 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 19 May 2023 11:41:25 +0100 Subject: [PATCH 05/43] Update .github/workflows/ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c9d58adc..e34e1be4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: strategy: matrix: + fail-fast: false os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.8, 3.9, 3.10, 3.11] From 57c677ed0cbbf7b16cf831a8e1488a78c9c75361 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 19 May 2023 11:41:36 +0100 Subject: [PATCH 06/43] Update .github/workflows/ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e34e1be4b..c8b5505bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,8 @@ jobs: strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + fail-fast: false + os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.8, 3.9, 3.10, 3.11] steps: From e77742e8516c78aa6aa1a0aec5dd2901f0ce08a2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 19 May 2023 11:46:59 +0100 Subject: [PATCH 07/43] Update .github/workflows/ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8b5505bb..aef231945 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: matrix: fail-fast: false os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 From b4a27cae9d811a651f7a0903b67af816ef7184a6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 19 May 2023 11:56:04 +0100 Subject: [PATCH 08/43] Update .github/workflows/ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aef231945..30efe1bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: matrix: fail-fast: false os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 From f21eeb620a8723e15b05ffbc4f6beca7af2ff3c7 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 12:16:08 +0100 Subject: [PATCH 09/43] Run test on push to expand_ci_system branch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30efe1bf2..65ae0cf2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, reopened] push: - branches: [main, develop] + branches: [main, develop, expand_ci_system] jobs: # Checks the style using the pre-commit hooks From 0a99291fec1b533b36e34357d96a4403304c2e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= <6095790+dalonsoa@users.noreply.github.com> Date: Fri, 19 May 2023 12:34:53 +0100 Subject: [PATCH 10/43] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65ae0cf2a..9d14b9868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: pull_request: types: [opened, synchronize, reopened] push: - branches: [main, develop, expand_ci_system] jobs: # Checks the style using the pre-commit hooks From 098e940c066ca02f2573afe8b04c23260d69541b Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 12:40:49 +0100 Subject: [PATCH 11/43] Fix error in workflow file --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65ae0cf2a..4d862aa42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: strategy: + fail-fast: false matrix: - fail-fast: false os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] @@ -58,8 +58,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - fail-fast: false os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] From 762a34f29a60f0ad1509c51978d68298b0856135 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 12:42:46 +0100 Subject: [PATCH 12/43] Fix error in workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adb677cba..9de91e705 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, reopened] push: - + branches: [main, develop, expand_ci_system] jobs: # Checks the style using the pre-commit hooks qa: From 59bb28f57088687e04ccd879e890ad000334a295 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Fri, 19 May 2023 13:38:33 +0100 Subject: [PATCH 13/43] Moved all that can be moved from setup.cfg to pyproject.toml. --- pyproject.toml | 125 ++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 114 -------------------------------------------- setup.py | 3 -- 3 files changed, 124 insertions(+), 118 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 5450808c2..2b16dc340 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,127 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] \ No newline at end of file +[project] +name = "MUSE" +authors = [ + {name = "Sustainable Gas Institute", email = "sgi@imperial.ac.uk"}, +] +description = "Energy System Model" +readme = "README.md" +requires-python = ">= 3.7" +keywords = ["energy", "modelling"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3.8", + "Intended Audience :: Science", + "Intended Audience :: Research", + "Intended Audience :: Economists", + "Intended Audience :: Energy Experts", + "Intended Audience :: Climate Mitigation Experts", + "Intended Audience :: Industry", +] +dependencies = [ + "numpy==1.23.0", + "scipy", + "pandas<=1.3", + "click", + "xarray==2022.3.0", + "bottleneck", + "coloredlogs", + "toml", + "xlrd==1.2.0", + "mypy-extensions", + "pypubsub", +] +dynamic = ["version"] + +[project.urls] +Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" + +[project.optional-dependencies] +all = ["MUSE[dev,doc,excel]"] +dev = [ + "pytest>4.0.2", + "flake8!=3.8.1,!=3.8.0,<4.0.0", + "black", + "pytest-flake8", + "IPython", + "jupyter", + "nbconvert", + "nbformat", + "mypy", + "numpy>=1.17", + "pytest-xdist", + "bump2version", +] +doc = [ + "sphinx==5.0.2", + "ipykernel", + "nbsphinx", + "myst-parser", + "sphinxcontrib-bibtex", + "ipython", + "pandoc", +] +excel = ["openpyxl"] +private_sgi_model = [ + "SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master", + "StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy", +] + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false + +[tool.setuptools.package-data] +"*" = ["**/*.toml", "**/*.csv"] + +[tool.setuptools.dynamic] +version = {attr = "muse.VERSION"} + +[tool.setuptools_scm] + +[tool.pyls] +configurationsources = ['flake8'] + +[tool.aliases] +test = "pytest" + +[tool.pytest.ini_options] +testpaths = ["tests", "src/muse"] +addopts = "--doctest-modules --flake8 -rfE -n auto" +markers = [ + "sgidata: test that require legacy data", + "legacy: test that require legacy modules", + "regression: a regression test", + "notebook: a test which consist in running a jupyter notebook", +] + +[tool.pycodestyle] +max-line-length = "88" +ignore = ["E203", "W503"] + +[tool.mypy] +ignore_missing_imports = true +strict_optional = true +files = ["src/**/*.py", "tests/**/*.py"] + +[[tool.mypy.overrides]] +module = ["setup"] +ignore_errors = true + +[tool.isort] +line_length = 88 +multi_line_output = 3 +include_trailing_comma = true + +[tool.build_sphinx] +project = "'MUSE'" +version = "attr: muse.VERSION" +release = "attr: muse.VERSION" +source-dir = "docs" +build-dir = "docs/build" diff --git a/setup.cfg b/setup.cfg index 64ce969c7..9883457f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,104 +3,10 @@ current_version = "1.0" commit = True tag = True -[metadata] -name = MUSE -version = attr: src.muse.VERSION -description = Energy System Model -classifiers = - Development Status :: 3 - Alpha - Programming Language :: Python :: 3.8 - Intended Audience :: Science - Intended Audience :: Research - Intended Audience :: Economists - Intended Audience :: Energy Experts - Intended Audience :: Climate Mitigation Experts - Intended Audience :: Industry -keywords = ["energy", "modelling"] -author = Sustainable Gas Institute -author_email = sgi@imperial.ac.uk -url = http://www.sustainablegasinstitute.org/home/muse-energy-model/ - -[options] -python_requires = >= 3.7 -package_dir = - =src -packages = find: -include_package_data = True -install_requires = - numpy==1.23.0 - scipy - pandas<=1.3 - click - xarray==2022.3.0 - bottleneck - coloredlogs - toml - xlrd==1.2.0 - mypy-extensions - pypubsub - -[options.packages.find] -where = src - -[options.package_data] -* = **/*.toml, **/*.csv - -[options.extras_require] -all = - %(dev)s - %(doc)s - %(excel)s -dev = - pytest>4.0.2 - flake8!=3.8.1,!=3.8.0,<4.0.0 - black - pytest-flake8 - IPython - jupyter - nbconvert - nbformat - mypy - numpy>=1.17 - pytest-xdist - bump2version -doc = - sphinx==5.0.2 - ipykernel - nbsphinx - myst-parser - sphinxcontrib-bibtex - ipython - pandoc -excel = - openpyxl -private_sgi_model = - SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master - StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy - [bumpversion:file:src/muse/__init__.py] [bumpversion:file:docs/conf.py] -[pyls] -configurationSources = ['flake8'] - -[aliases] -test = pytest - -[tool:pytest] -testpaths = tests src/muse -addopts = --doctest-modules --flake8 -rfE -n auto -markers = - sgidata: test that require legacy data - legacy: test that require legacy modules - regression: a regression test - notebook: a test which consist in running a jupyter notebook - -[pycodestyle] -max-line-length = 88 -ignore = E203,W503 - [flake8] max-line-length = 88 exclude = @@ -109,23 +15,3 @@ exclude = build, __pycache__, ignore = E203,W503 - -[mypy] -ignore_missing_imports = True -strict_optional = True -files = src/**/*.py,tests/**/*.py - -[mypy-setup] -ignore_errors = True - -[isort] -line_length = 88 -multi_line_output = 3 -include_trailing_comma = true - -[build_sphinx] -project = 'MUSE' -version = attr: src.muse.VERSION -release = attr: src.muse.VERSION -source-dir = docs -build-dir = docs/build diff --git a/setup.py b/setup.py deleted file mode 100644 index b908cbe55..000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup() From 5711d68ea9c68caa36e569040e1ed7b84e7a914c Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 13:41:16 +0100 Subject: [PATCH 14/43] Switch from technote-space to ruzickap link checker --- .github/workflows/broken-link-check.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index ca498d8b9..4270b127a 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -1,8 +1,6 @@ on: schedule: - cron: 0 0 1 * * # run monthly - repository_dispatch: # run manually - types: [check-link] push: branches: [develop, broken_link_checker] @@ -13,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Broken Link Check - uses: technote-space/broken-link-checker-action@v2 + uses: ruzickap/action-my-broken-link-checker@v2 with: - TARGET: https://muse-os.readthedocs.io/en/latest/ - RECURSIVE: true + url: https://muse-os.readthedocs.io/en/latest/ + cmd_params: '--buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0" --timeout=10' # muffet parameters From 448e5adb10086cdcf8300dee9220f18450660650 Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 14:02:03 +0100 Subject: [PATCH 15/43] Added back run manually, added correct branches to run on, removed unnecessary cmd param --- .github/workflows/broken-link-check.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 4270b127a..1ad0014a7 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -1,8 +1,10 @@ on: schedule: - cron: 0 0 1 * * # run monthly + repository_dispatch: # run manually + types: [check-link] push: - branches: [develop, broken_link_checker] + branches: [main, develop_imperial] name: Broken Link Check jobs: @@ -14,4 +16,4 @@ jobs: uses: ruzickap/action-my-broken-link-checker@v2 with: url: https://muse-os.readthedocs.io/en/latest/ - cmd_params: '--buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0" --timeout=10' # muffet parameters + cmd_params: '--buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters From 3a5d1242df34a3e2c1eebb2420924f986da3dc12 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 14:22:22 +0100 Subject: [PATCH 16/43] Remove targeting Python 3.10 and 3.11 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9de91e705..68bd267c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9"] steps: - uses: actions/checkout@v3 From f6a6f9bc0c282c0309364e570253a87768d4eb48 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 14:26:21 +0100 Subject: [PATCH 17/43] Remove targeting Python 3.10 and 3.11 from regression-tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68bd267c6..86bde140b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9"] steps: - uses: actions/checkout@v3 From f9d486f714967448a12fea3cc6187183d7c2e646 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 14:42:48 +0100 Subject: [PATCH 18/43] Remove expand_ci_system branch from list of branches in CI workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86bde140b..3e62503e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, reopened] push: - branches: [main, develop, expand_ci_system] + branches: [main, develop] jobs: # Checks the style using the pre-commit hooks qa: From 0b69bae1c6324d819570528eecaec1021cb28a38 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 15:05:03 +0100 Subject: [PATCH 19/43] Update pyproject.toml with Python versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b16dc340..404805415 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Energy System Model" readme = "README.md" -requires-python = ">= 3.7" +requires-python = ">= 3.8, <3.10" keywords = ["energy", "modelling"] classifiers = [ "Development Status :: 3 - Alpha", From c30d6f5491018fd72c9e1611f0de387a31308bfb Mon Sep 17 00:00:00 2001 From: Dan Cummins Date: Fri, 19 May 2023 15:11:34 +0100 Subject: [PATCH 20/43] Updated change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e42afc4b..f344a620c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- Add GitHub action to check for broken links ([#115](https://github.com/SGIModel/MUSE_OS/pull/115)) - Inconsistent trade case study ([#58](https://github.com/SGIModel/MUSE_OS/pull/58)) - Update README.txt in installation path ([#57](https://github.com/SGIModel/MUSE_OS/pull/57)) - Add tests to check the case of not using retrofit agents ([#53](https://github.com/SGIModel/MUSE_OS/pull/53)) From 228b77f6f0bc02fed098d802a3d89837de06d451 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Fri, 19 May 2023 16:21:02 +0100 Subject: [PATCH 21/43] Add entrypoint (via muse_main) to pyproject.toml --- pyproject.toml | 3 ++ src/muse/__main__.py | 98 ++++++++++++++++++++++---------------------- 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b16dc340..8791b6372 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,9 @@ dynamic = ["version"] [project.urls] Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" +[project.scripts] +muse = "muse.__main__:muse_main" + [project.optional-dependencies] all = ["MUSE[dev,doc,excel]"] dev = [ diff --git a/src/muse/__main__.py b/src/muse/__main__.py index fc0346507..34345bd5b 100644 --- a/src/muse/__main__.py +++ b/src/muse/__main__.py @@ -1,55 +1,53 @@ +import click +INPUT_PATH = click.Path(exists=False, file_okay=True, resolve_path=True) +MODEL_PATH = click.Path(file_okay=False, resolve_path=True) +MODELS = click.Choice( + ["default", "multiple-agents", "medium", "minimum-service", "trade"] +) + """Makes MUSE executable.""" +@click.command(context_settings=dict(help_option_names=["-h", "--help"])) +@click.argument("settings", default="settings.toml", type=INPUT_PATH) +@click.option( + "--model", + type=MODELS, + help="Runs a model distributed with MUSE. SETTINGS is ignored.", +) +@click.option( + "--copy", + type=MODEL_PATH, + help=( + "Folder where to copy the model specified by the '--model' option. " + "The folder must not exist: this command will refuse to overwrite existing " + "data. Exits without running the model." + ), +) +def muse_main(settings, model, copy): + """Runs a MUSE simulation. + + SETTINGS should be a .toml file. + """ + from logging import getLogger + from pathlib import Path + + from muse import examples + from muse.mca import MCA + from muse.readers.toml import read_settings + + if (not model) and not Path(settings).exists(): + print(f"Invalid or missing input: file {settings} does not exist.") + return + + if copy: + examples.copy_model(name=model if model else "default", path=copy) + elif model: + examples.model(model).run() + else: + settings = read_settings(settings) + getLogger("muse").setLevel(settings.log_level) + MCA.factory(settings).run() + if "__main__" == __name__: from sys import argv, executable - - import click - - INPUT_PATH = click.Path(exists=False, file_okay=True, resolve_path=True) - MODEL_PATH = click.Path(file_okay=False, resolve_path=True) - MODELS = click.Choice( - ["default", "multiple-agents", "medium", "minimum-service", "trade"] - ) - - @click.command(context_settings=dict(help_option_names=["-h", "--help"])) - @click.argument("settings", default="settings.toml", type=INPUT_PATH) - @click.option( - "--model", - type=MODELS, - help="Runs a model distributed with MUSE. SETTINGS is ignored.", - ) - @click.option( - "--copy", - type=MODEL_PATH, - help=( - "Folder where to copy the model specified by the '--model' option. " - "The folder must not exist: this command will refuse to overwrite existing " - "data. Exits without running the model." - ), - ) - def muse_main(settings, model, copy): - """Runs a MUSE simulation. - - SETTINGS should be a .toml file. - """ - from logging import getLogger - from pathlib import Path - - from muse import examples - from muse.mca import MCA - from muse.readers.toml import read_settings - - if (not model) and not Path(settings).exists(): - print(f"Invalid or missing input: file {settings} does not exist.") - return - - if copy: - examples.copy_model(name=model if model else "default", path=copy) - elif model: - examples.model(model).run() - else: - settings = read_settings(settings) - getLogger("muse").setLevel(settings.log_level) - MCA.factory(settings).run() - argv[0] = "%s -m muse" % executable muse_main() From 5a521b60853618e3100fcd2d3dd64295535f6b95 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Fri, 19 May 2023 20:57:17 +0100 Subject: [PATCH 22/43] Fix flake8 empty line complains --- src/muse/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/muse/__main__.py b/src/muse/__main__.py index 34345bd5b..b3122a72e 100644 --- a/src/muse/__main__.py +++ b/src/muse/__main__.py @@ -1,3 +1,4 @@ +"""Makes MUSE executable.""" import click INPUT_PATH = click.Path(exists=False, file_okay=True, resolve_path=True) MODEL_PATH = click.Path(file_okay=False, resolve_path=True) @@ -5,7 +6,7 @@ ["default", "multiple-agents", "medium", "minimum-service", "trade"] ) -"""Makes MUSE executable.""" + @click.command(context_settings=dict(help_option_names=["-h", "--help"])) @click.argument("settings", default="settings.toml", type=INPUT_PATH) @click.option( @@ -47,6 +48,7 @@ def muse_main(settings, model, copy): getLogger("muse").setLevel(settings.log_level) MCA.factory(settings).run() + if "__main__" == __name__: from sys import argv, executable argv[0] = "%s -m muse" % executable From 0f4f034a8988847626b1a06c7771e51f34f0cde2 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Sat, 20 May 2023 12:30:26 +0100 Subject: [PATCH 23/43] More robust project data inclusion --- pyproject.toml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8791b6372..976f3a1b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,12 +36,6 @@ dependencies = [ ] dynamic = ["version"] -[project.urls] -Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" - -[project.scripts] -muse = "muse.__main__:muse_main" - [project.optional-dependencies] all = ["MUSE[dev,doc,excel]"] dev = [ @@ -73,16 +67,20 @@ private_sgi_model = [ "StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy", ] +[project.urls] +Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" + +[project.scripts] +muse = "muse.__main__:muse_main" + [tool.setuptools] -package-dir = {"" = "src"} +license-files = ["LICENSE"] include-package-data = true [tool.setuptools.packages.find] where = ["src"] -namespaces = false - -[tool.setuptools.package-data] -"*" = ["**/*.toml", "**/*.csv"] +include = ["*"] +namespaces = true [tool.setuptools.dynamic] version = {attr = "muse.VERSION"} @@ -90,7 +88,7 @@ version = {attr = "muse.VERSION"} [tool.setuptools_scm] [tool.pyls] -configurationsources = ['flake8'] +configurationsources = ["flake8"] [tool.aliases] test = "pytest" From b2f6c3ae5ba81f99c4f0eb2a6b319107f406e80d Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Mon, 22 May 2023 15:43:55 +0100 Subject: [PATCH 24/43] isort and black cleanup. --- src/muse/__main__.py | 2 ++ src/muse/demand_share.py | 2 +- src/muse/filters.py | 18 +++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/muse/__main__.py b/src/muse/__main__.py index b3122a72e..7a12cc995 100644 --- a/src/muse/__main__.py +++ b/src/muse/__main__.py @@ -1,5 +1,6 @@ """Makes MUSE executable.""" import click + INPUT_PATH = click.Path(exists=False, file_okay=True, resolve_path=True) MODEL_PATH = click.Path(file_okay=False, resolve_path=True) MODELS = click.Choice( @@ -51,5 +52,6 @@ def muse_main(settings, model, copy): if "__main__" == __name__: from sys import argv, executable + argv[0] = "%s -m muse" % executable muse_main() diff --git a/src/muse/demand_share.py b/src/muse/demand_share.py index 0b09d0a74..5ab0a1b51 100644 --- a/src/muse/demand_share.py +++ b/src/muse/demand_share.py @@ -99,7 +99,7 @@ def demand_share( agents: Sequence[AbstractAgent], market: xr.Dataset, technologies: xr.Dataset, - **kwargs + **kwargs, ) -> xr.DataArray: from copy import copy diff --git a/src/muse/filters.py b/src/muse/filters.py index bc36e344d..bb8dc905f 100644 --- a/src/muse/filters.py +++ b/src/muse/filters.py @@ -214,12 +214,12 @@ def factory( functions = [ partial( SEARCH_SPACE_INITIALIZERS[initial_settings["name"]], - **{k: v for k, v in initial_settings.items() if k != "name"} + **{k: v for k, v in initial_settings.items() if k != "name"}, ), *( partial( SEARCH_SPACE_FILTERS[setting["name"]], - **{k: v for k, v in setting.items() if k != "name"} + **{k: v for k, v in setting.items() if k != "name"}, ) for setting in parameters ), @@ -242,7 +242,7 @@ def same_enduse( technologies: xr.Dataset, *args, enduse_label: Text = "service", - **kwargs + **kwargs, ) -> xr.DataArray: """Only allow for technologies with at least the same end-use.""" from muse.commodities import is_enduse @@ -335,7 +335,7 @@ def maturity( technologies: xr.Dataset, market: xr.Dataset, enduse_label: Text = "service", - **kwargs + **kwargs, ) -> xr.DataArray: """Only allows technologies that have achieve a given market share. @@ -359,7 +359,7 @@ def spend_limit( technologies: xr.Dataset, market: xr.Dataset, enduse_label: Text = "service", - **kwargs + **kwargs, ) -> xr.DataArray: """Only allows technologies that have achieve a given market share. @@ -381,7 +381,7 @@ def compress( search_space: xr.DataArray, technologies: xr.Dataset, market: xr.Dataset, - **kwargs + **kwargs, ) -> xr.DataArray: """Compress search space to include only potential technologies. @@ -405,7 +405,7 @@ def reduce_asset( search_space: xr.DataArray, technologies: xr.Dataset, market: xr.Dataset, - **kwargs + **kwargs, ) -> xr.DataArray: """Reduce over assets.""" return search_space.any("asset") if "asset" in search_space.dims else search_space @@ -417,7 +417,7 @@ def with_asset_technology( search_space: xr.DataArray, technologies: xr.Dataset, market: xr.Dataset, - **kwargs + **kwargs, ) -> xr.DataArray: """Search space *also* contains its asset technology for each asset.""" return search_space | (search_space.asset == search_space.replacement) @@ -447,7 +447,7 @@ def initialize_from_assets( technologies: xr.Dataset, *args, coords: Sequence[Text] = ("region", "technology"), - **kwargs + **kwargs, ): """Initialize a search space from existing technologies.""" from muse.utilities import reduce_assets From 4f384f67b02076309e92dda6bd2bc7195e86f2af Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Fri, 19 May 2023 13:38:33 +0100 Subject: [PATCH 25/43] Moved all that can be moved from setup.cfg to pyproject.toml. --- pyproject.toml | 125 ++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 114 -------------------------------------------- setup.py | 3 -- 3 files changed, 124 insertions(+), 118 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 5450808c2..2b16dc340 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,127 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] \ No newline at end of file +[project] +name = "MUSE" +authors = [ + {name = "Sustainable Gas Institute", email = "sgi@imperial.ac.uk"}, +] +description = "Energy System Model" +readme = "README.md" +requires-python = ">= 3.7" +keywords = ["energy", "modelling"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3.8", + "Intended Audience :: Science", + "Intended Audience :: Research", + "Intended Audience :: Economists", + "Intended Audience :: Energy Experts", + "Intended Audience :: Climate Mitigation Experts", + "Intended Audience :: Industry", +] +dependencies = [ + "numpy==1.23.0", + "scipy", + "pandas<=1.3", + "click", + "xarray==2022.3.0", + "bottleneck", + "coloredlogs", + "toml", + "xlrd==1.2.0", + "mypy-extensions", + "pypubsub", +] +dynamic = ["version"] + +[project.urls] +Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" + +[project.optional-dependencies] +all = ["MUSE[dev,doc,excel]"] +dev = [ + "pytest>4.0.2", + "flake8!=3.8.1,!=3.8.0,<4.0.0", + "black", + "pytest-flake8", + "IPython", + "jupyter", + "nbconvert", + "nbformat", + "mypy", + "numpy>=1.17", + "pytest-xdist", + "bump2version", +] +doc = [ + "sphinx==5.0.2", + "ipykernel", + "nbsphinx", + "myst-parser", + "sphinxcontrib-bibtex", + "ipython", + "pandoc", +] +excel = ["openpyxl"] +private_sgi_model = [ + "SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master", + "StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy", +] + +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false + +[tool.setuptools.package-data] +"*" = ["**/*.toml", "**/*.csv"] + +[tool.setuptools.dynamic] +version = {attr = "muse.VERSION"} + +[tool.setuptools_scm] + +[tool.pyls] +configurationsources = ['flake8'] + +[tool.aliases] +test = "pytest" + +[tool.pytest.ini_options] +testpaths = ["tests", "src/muse"] +addopts = "--doctest-modules --flake8 -rfE -n auto" +markers = [ + "sgidata: test that require legacy data", + "legacy: test that require legacy modules", + "regression: a regression test", + "notebook: a test which consist in running a jupyter notebook", +] + +[tool.pycodestyle] +max-line-length = "88" +ignore = ["E203", "W503"] + +[tool.mypy] +ignore_missing_imports = true +strict_optional = true +files = ["src/**/*.py", "tests/**/*.py"] + +[[tool.mypy.overrides]] +module = ["setup"] +ignore_errors = true + +[tool.isort] +line_length = 88 +multi_line_output = 3 +include_trailing_comma = true + +[tool.build_sphinx] +project = "'MUSE'" +version = "attr: muse.VERSION" +release = "attr: muse.VERSION" +source-dir = "docs" +build-dir = "docs/build" diff --git a/setup.cfg b/setup.cfg index 64ce969c7..9883457f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,104 +3,10 @@ current_version = "1.0" commit = True tag = True -[metadata] -name = MUSE -version = attr: src.muse.VERSION -description = Energy System Model -classifiers = - Development Status :: 3 - Alpha - Programming Language :: Python :: 3.8 - Intended Audience :: Science - Intended Audience :: Research - Intended Audience :: Economists - Intended Audience :: Energy Experts - Intended Audience :: Climate Mitigation Experts - Intended Audience :: Industry -keywords = ["energy", "modelling"] -author = Sustainable Gas Institute -author_email = sgi@imperial.ac.uk -url = http://www.sustainablegasinstitute.org/home/muse-energy-model/ - -[options] -python_requires = >= 3.7 -package_dir = - =src -packages = find: -include_package_data = True -install_requires = - numpy==1.23.0 - scipy - pandas<=1.3 - click - xarray==2022.3.0 - bottleneck - coloredlogs - toml - xlrd==1.2.0 - mypy-extensions - pypubsub - -[options.packages.find] -where = src - -[options.package_data] -* = **/*.toml, **/*.csv - -[options.extras_require] -all = - %(dev)s - %(doc)s - %(excel)s -dev = - pytest>4.0.2 - flake8!=3.8.1,!=3.8.0,<4.0.0 - black - pytest-flake8 - IPython - jupyter - nbconvert - nbformat - mypy - numpy>=1.17 - pytest-xdist - bump2version -doc = - sphinx==5.0.2 - ipykernel - nbsphinx - myst-parser - sphinxcontrib-bibtex - ipython - pandoc -excel = - openpyxl -private_sgi_model = - SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master - StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy - [bumpversion:file:src/muse/__init__.py] [bumpversion:file:docs/conf.py] -[pyls] -configurationSources = ['flake8'] - -[aliases] -test = pytest - -[tool:pytest] -testpaths = tests src/muse -addopts = --doctest-modules --flake8 -rfE -n auto -markers = - sgidata: test that require legacy data - legacy: test that require legacy modules - regression: a regression test - notebook: a test which consist in running a jupyter notebook - -[pycodestyle] -max-line-length = 88 -ignore = E203,W503 - [flake8] max-line-length = 88 exclude = @@ -109,23 +15,3 @@ exclude = build, __pycache__, ignore = E203,W503 - -[mypy] -ignore_missing_imports = True -strict_optional = True -files = src/**/*.py,tests/**/*.py - -[mypy-setup] -ignore_errors = True - -[isort] -line_length = 88 -multi_line_output = 3 -include_trailing_comma = true - -[build_sphinx] -project = 'MUSE' -version = attr: src.muse.VERSION -release = attr: src.muse.VERSION -source-dir = docs -build-dir = docs/build diff --git a/setup.py b/setup.py deleted file mode 100644 index b908cbe55..000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -import setuptools - -setuptools.setup() From 6dab36c9b884d5d32b3bca3f101d0521accdeef4 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Fri, 19 May 2023 15:05:03 +0100 Subject: [PATCH 26/43] Update pyproject.toml with Python versions --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b16dc340..404805415 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Energy System Model" readme = "README.md" -requires-python = ">= 3.7" +requires-python = ">= 3.8, <3.10" keywords = ["energy", "modelling"] classifiers = [ "Development Status :: 3 - Alpha", From f43e00b243dbed6d2a101fee79cbb450a15bb8ed Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Mon, 22 May 2023 21:19:05 +0100 Subject: [PATCH 27/43] Remove duplicate key declaration --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 99164d62f..7121c65a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,9 +36,6 @@ dependencies = [ ] dynamic = ["version"] -[project.urls] -Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" - [project.optional-dependencies] all = ["MUSE[dev,doc,excel]"] dev = [ From 6085c0bffbca2340dd04e20785cc9aaa84265776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Tue, 23 May 2023 09:53:09 +0100 Subject: [PATCH 28/43] Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f344a620c..a2a352607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Features +- Updating pyproject.toml with valid python versions ([#121](https://github.com/SGIModel/MUSE_OS/pull/121)) +- Expand CI workflow ([#119](https://github.com/SGIModel/MUSE_OS/pull/119)) +- Convert setup.cfg to pyproject.toml and add entrypoint ([#118](https://github.com/SGIModel/MUSE_OS/pull/118)) - Add GitHub action to check for broken links ([#115](https://github.com/SGIModel/MUSE_OS/pull/115)) - Inconsistent trade case study ([#58](https://github.com/SGIModel/MUSE_OS/pull/58)) - Update README.txt in installation path ([#57](https://github.com/SGIModel/MUSE_OS/pull/57)) From 588b2b53f92aff0efec720f742040ca920b46fb5 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Tue, 23 May 2023 14:17:26 +0100 Subject: [PATCH 29/43] Move bumpversion config from setup.cfg to .bumpversion.cfg --- .bumpversion.cfg | 8 ++++++++ setup.cfg | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 000000000..fe47eec99 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,8 @@ +[bumpversion] +current_version = "1.0" +commit = True +tag = True + +[bumpversion:file:src/muse/__init__.py] + +[bumpversion:file:docs/conf.py] diff --git a/setup.cfg b/setup.cfg index 9883457f3..13c2c187b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,12 +1,3 @@ -[bumpversion] -current_version = "1.0" -commit = True -tag = True - -[bumpversion:file:src/muse/__init__.py] - -[bumpversion:file:docs/conf.py] - [flake8] max-line-length = 88 exclude = From d15dd0bbbd1537a94a05094e3fa72d027d53aeca Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Tue, 23 May 2023 14:19:00 +0100 Subject: [PATCH 30/43] Remove pycodestyle config from pyproject.toml, since this is done by flake8 now. --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7121c65a2..1ae222910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,10 +103,6 @@ markers = [ "notebook: a test which consist in running a jupyter notebook", ] -[tool.pycodestyle] -max-line-length = "88" -ignore = ["E203", "W503"] - [tool.mypy] ignore_missing_imports = true strict_optional = true From 98720d42c5783aa86d4550972eebb765a8a3e9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 05:08:10 +0100 Subject: [PATCH 31/43] Add python 3.9 to classifiers --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1ae222910..8fcae2789 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ keywords = ["energy", "modelling"] classifiers = [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Intended Audience :: Science", "Intended Audience :: Research", "Intended Audience :: Economists", From 1e0a20d74128fbb465e4873514945b4bb885b315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 05:12:21 +0100 Subject: [PATCH 32/43] Add flake8 file and remove setup.cfg --- setup.cfg => .flake8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename setup.cfg => .flake8 (62%) diff --git a/setup.cfg b/.flake8 similarity index 62% rename from setup.cfg rename to .flake8 index 13c2c187b..0e75ca2d6 100644 --- a/setup.cfg +++ b/.flake8 @@ -3,6 +3,9 @@ max-line-length = 88 exclude = .tox, .git, + .venv, + venv, build, __pycache__, -ignore = E203,W503 +extend-ignore = + E203,W503 \ No newline at end of file From 6b5816c5496fe91c528262bede6d6a19d18b2e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 05:50:39 +0100 Subject: [PATCH 33/43] Add setup.py so sphinx can pick config from pyproject.toml --- pyproject.toml | 4 ++-- setup.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 8fcae2789..eb89a2ffe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" [project] @@ -54,7 +54,7 @@ dev = [ "bump2version", ] doc = [ - "sphinx==5.0.2", + "sphinx", "ipykernel", "nbsphinx", "myst-parser", diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..606849326 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() From 0e77ceefa4c0f9de306f8e7606fe89cfa3518a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 05:55:39 +0100 Subject: [PATCH 34/43] Remove alias from pyproject.toml --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eb89a2ffe..bd3cf600f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,9 +91,6 @@ version = {attr = "muse.VERSION"} [tool.pyls] configurationsources = ["flake8"] -[tool.aliases] -test = "pytest" - [tool.pytest.ini_options] testpaths = ["tests", "src/muse"] addopts = "--doctest-modules --flake8 -rfE -n auto" From 4cf01e89e70916a6321a2402d22ae60af3f2d3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 06:21:43 +0100 Subject: [PATCH 35/43] Update instructions on how to build the docs --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- README.md | 4 ++-- pyproject.toml | 9 +-------- setup.py | 3 --- 4 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 setup.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 08376a6bc..534959e7e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,7 +20,7 @@ document the change (include PR #) - note reverse order of PR #s. ## Key checklist - [ ] All tests pass: `$ python -m pytest` -- [ ] The documentation builds and looks OK: `$ python setup.py build_sphinx` +- [ ] The documentation builds and looks OK: `$ python -m sphinx -b html docs docs/build` ## Further checks diff --git a/README.md b/README.md index 80e4e2417..f83a59059 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,11 @@ theb testing framework of the same name. The documentation can be built with: ```bash -> python setup.py docs +> python -m sphinx -b html docs docs/build ``` The main page for the documentation can then be found at -`build\\sphinx\\html\\index.html` (or `build/sphinx/html/index.html` on Mac and Linux). +`docs\\build\\html\\index.html` (or `docs/build/html/index.html` on Mac and Linux). The file can viewed from any web browser. [vscode](https://code.visualstudio.com/) users will find that the repository is setup diff --git a/pyproject.toml b/pyproject.toml index bd3cf600f..a2f21141e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,11 +113,4 @@ ignore_errors = true [tool.isort] line_length = 88 multi_line_output = 3 -include_trailing_comma = true - -[tool.build_sphinx] -project = "'MUSE'" -version = "attr: muse.VERSION" -release = "attr: muse.VERSION" -source-dir = "docs" -build-dir = "docs/build" +include_trailing_comma = true \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 606849326..000000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() From 8f98273de52138f02cbd19b2b6ebe9f5bf84e826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 06:47:26 +0100 Subject: [PATCH 36/43] Check links when a PR opens --- .github/workflows/broken-link-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 1ad0014a7..066c54fe7 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -4,7 +4,9 @@ on: repository_dispatch: # run manually types: [check-link] push: - branches: [main, develop_imperial] + branches: [main, develop] + pull_request: + types: [opened, synchronize, reopened] name: Broken Link Check jobs: From 8f058efd50be1d936d1dc6a608fc9429e155430a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 06:53:39 +0100 Subject: [PATCH 37/43] Make link checker verbose --- .github/workflows/broken-link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 066c54fe7..621e9e163 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -18,4 +18,4 @@ jobs: uses: ruzickap/action-my-broken-link-checker@v2 with: url: https://muse-os.readthedocs.io/en/latest/ - cmd_params: '--buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters + cmd_params: '-v --buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters From b78d4aa31db5b37b9c48cbdf11874041e9f1044e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Wed, 24 May 2023 06:55:48 +0100 Subject: [PATCH 38/43] Remove verbose, add timeout --- .github/workflows/broken-link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml index 621e9e163..7b2e182aa 100644 --- a/.github/workflows/broken-link-check.yml +++ b/.github/workflows/broken-link-check.yml @@ -18,4 +18,4 @@ jobs: uses: ruzickap/action-my-broken-link-checker@v2 with: url: https://muse-os.readthedocs.io/en/latest/ - cmd_params: '-v --buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters + cmd_params: '--timeout=20 --buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters From 512ee593081dc414d18660a4cc32b1d15f1c78a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Fri, 26 May 2023 07:30:09 +0100 Subject: [PATCH 39/43] Update bump2version configuration --- .bumpversion.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index fe47eec99..2f73cf191 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,6 @@ [bumpversion] -current_version = "1.0" +current_version = "1.0.0" +# parse = "(?P\d+)\.(?P\d+)\.(?P\d+)(-(?P.*)-(?P\d+))?" commit = True tag = True From f0347ee2ff829abd726878fce6ba34b208963d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Fri, 26 May 2023 07:35:17 +0100 Subject: [PATCH 40/43] =?UTF-8?q?Bump=20version:=20"1.0.0"=20=E2=86=92=201?= =?UTF-8?q?.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 3 +-- docs/conf.py | 2 +- src/muse/__init__.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2f73cf191..e5a1f9233 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,5 @@ [bumpversion] -current_version = "1.0.0" -# parse = "(?P\d+)\.(?P\d+)\.(?P\d+)(-(?P.*)-(?P\d+))?" +current_version = 1.0.1 commit = True tag = True diff --git a/docs/conf.py b/docs/conf.py index 738bc1b47..c8ae25d54 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ project = "MUSE" copyright = "2022, Sustainable Gas Institute" author = "Imperial College London" -release = "1.0.0" +release = "1.0.1" version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- diff --git a/src/muse/__init__.py b/src/muse/__init__.py index 91a02d813..16633f2de 100644 --- a/src/muse/__init__.py +++ b/src/muse/__init__.py @@ -1,5 +1,5 @@ """MUSE model""" -VERSION = "1.0.0" +VERSION = "1.0.1" def _create_logger(): From bc3a249a91c515ce745a53c29b375c15ab18b909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Fri, 26 May 2023 08:06:36 +0100 Subject: [PATCH 41/43] Add publishing in TestPyPI and PyPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :wip: trigger publishing from develop_imperial branch :wip: fine tune publishing Bump version: 1.0.1 → 1.0.2 Run workflow when pushing tags Bump version: 1.0.2 → 1.0.3 :wip: fine tune publishing - again Bump version: 1.0.3 → 1.0.4 Bump version: 1.0.4 → 1.0.5 :wip: fine tune publishing - again2 Bump version: 1.0.5 → 1.0.6 :wip: fine tune publishing - again3 Bump version: 1.0.6 → 1.0.7 :wip: fine tune publishing - again4 Bump version: 1.0.7 → 1.0.8 :wip: fine tune publishing - again5 Bump version: 1.0.8 → 1.0.9 :wip: fine tune publishing - withou environment Bump version: 1.0.9 → 1.0.10 :wip: fine tune publishing - building package Bump version: 1.0.10 → 1.0.11 :wip: fine tune publishing - why artifacts not uploaded? Bump version: 1.0.11 → 1.0.12 Fix intended audience Bump version: 1.0.12 → 1.0.13 GitHub repos removed from pyproject.toml Bump version: 1.0.13 → 1.0.14 Rename MUSE as MUSE_OS in pyproject.toml Bump version: 1.0.14 → 1.0.15 Update CI to deploy to PyPI --- .bumpversion.cfg | 2 +- .github/workflows/ci.yml | 69 +++++++++++++++++++++++++++++++++++++++- docs/conf.py | 2 +- pyproject.toml | 16 +++------- src/muse/__init__.py | 2 +- 5 files changed, 75 insertions(+), 16 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e5a1f9233..954391a63 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.1 +current_version = 1.0.15 commit = True tag = True diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e62503e4..5aadab0a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,12 @@ -name: QA and tests +name: QA, tests and publishing on: pull_request: types: [opened, synchronize, reopened] push: branches: [main, develop] + tags: + - '*' jobs: # Checks the style using the pre-commit hooks qa: @@ -78,3 +80,68 @@ jobs: # The regression tests (with non coverage) - name: Regression tests run: pytest -m "regression" + + # If all tests pass, we try to build a wheel + build-wheel: + # needs: [regression-tests, unit-tests] + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build sdist + run: | + python -m pip install --upgrade build + python -m build + + - uses: actions/upload-artifact@v3 + with: + path: dist/MUSE* + + # And if we are pushing a tag, then we try to publish it + publish-TestPyPI: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: build-wheel + name: Publish MUSE to TestPyPI + runs-on: ubuntu-latest + permissions: + id-token: write + + steps: + + - name: Download sdist artifact + uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - name: Display structure of downloaded files + run: ls -R dist + + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + + publish-PyPI: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: publish-TestPyPI + name: Publish MUSE to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write + + steps: + + - name: Download sdist artifact + uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - name: Display structure of downloaded files + run: ls -R dist + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index c8ae25d54..5d8cb6047 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ project = "MUSE" copyright = "2022, Sustainable Gas Institute" author = "Imperial College London" -release = "1.0.1" +release = "1.0.15" version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index a2f21141e..77e9330d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61", "wheel", "setuptools_scm>=6.2"] build-backend = "setuptools.build_meta" [project] -name = "MUSE" +name = "MUSE_OS" authors = [ {name = "Sustainable Gas Institute", email = "sgi@imperial.ac.uk"}, ] @@ -15,12 +15,8 @@ classifiers = [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Intended Audience :: Science", - "Intended Audience :: Research", - "Intended Audience :: Economists", - "Intended Audience :: Energy Experts", - "Intended Audience :: Climate Mitigation Experts", - "Intended Audience :: Industry", + "Intended Audience :: Science/Research", + "Intended Audience :: Other Audience", ] dependencies = [ "numpy==1.23.0", @@ -38,7 +34,7 @@ dependencies = [ dynamic = ["version"] [project.optional-dependencies] -all = ["MUSE[dev,doc,excel]"] +all = ["MUSE_OS[dev,doc,excel]"] dev = [ "pytest>4.0.2", "flake8!=3.8.1,!=3.8.0,<4.0.0", @@ -63,10 +59,6 @@ doc = [ "pandoc", ] excel = ["openpyxl"] -private_sgi_model = [ - "SGIModelData @ git+https://github.com/SGIModel/SGIModelData.git@master", - "StarMUSELegacy @ git+https://github.com/SGIModel/StarMuse.git@archive/legacy", -] [project.urls] Homepage = "http://www.sustainablegasinstitute.org/home/muse-energy-model/" diff --git a/src/muse/__init__.py b/src/muse/__init__.py index 16633f2de..4e3db865e 100644 --- a/src/muse/__init__.py +++ b/src/muse/__init__.py @@ -1,5 +1,5 @@ """MUSE model""" -VERSION = "1.0.1" +VERSION = "1.0.15" def _create_logger(): From 68791ecab046b0e440b824dea0942d0a36dbde76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alonso=20=C3=81lvarez?= Date: Fri, 26 May 2023 10:18:43 +0100 Subject: [PATCH 42/43] Update instructions in README --- README.md | 129 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 88 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index f83a59059..f893001c0 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,135 @@ +# ModUlar energy system Simulation Environment: MUSE -Installation -============ +## Installation -Pre-requisite: A virtual environment ------------------------------------- +### Recommended way -Although not strictly necessary, creating a [conda](https://www.anaconda.com/what-is-anaconda/) -virtual environment is highly recommended: it will isolate users and developers from changes -occuring on their operating system, and from conflicts between python packages. It ensures -reproducibility from day to day. +The recommended way for **end users** to access and use the tool is via `pipx`. +This will create an isolated environment and install MUSE-OS within in one go, +also letting you to invoke `muse` anywhere in your system. -Create a virtual env including python with: +1. Install and configure [`pipx`](https://pypa.github.io/pipx/) following the + instructions appropriate for your operative system. Make sure it works well before + moving on. +2. Install MUSE-OS with `pipx install MUSE-OS`. It might take a + while to complete, but afterwards updates should be pretty fast. +3. To run MUSE-OS just open a terminal and execute `muse`, with the appropriate input + arguments, if relevant. See section below about usage. + +Whenever there is a new version of MUSE-OS, just run `pipx upgrade MUSE-OS` and +it will be downloaded and installed with no fuss. + +### Alternative way + +If you want to have a bit more control - or you don't want to use `pipx`, +just create a virtual environment first and then install `MUSE-OS`. + +Although not strictly necessary, **creating a virtual environment is highly recommended**: +it will isolate users and developers from changes occuring on their operating system, +and from conflicts between python packages. It ensures reproducibility from day to day. + +There are several ways of creating a virtual environment - below we list two of them. +Regardless of the method used, **once it has been created and activated**, you can install +`MUSE-OS` within using: ```bash -> conda create -n muse python=3.8 +python -m pip install MUSE-OS +``` + +And then use it by invoking `muse` with the relevant input arguments. + +#### Creating a virtual environment using `conda` + +Create a virtual environment including python with: + +```bash +conda create -n muse_env python=3.9 ``` Activate the environment with: ```bash -> conda activate muse +conda activate muse_env ``` Later, to recover the system-wide "normal" python, deactivate the environment with: ```bash -> conda deactivate +conda deactivate ``` -Installing muse itself ----------------------- +#### Creating a virtual environment using `venv` -Once a virtual environment has been *activated*, as describe above, we can -install muse without fear of interfering with other python jobs. Run: +Create a virtual environment with: ```bash -> python -m pip install https://github.com/SGIModel/MUSE_OS.git#egg=muse +python -m pip install venv +python -m venv muse_env ``` -Usage ------ +Activate the environment with: + +```powershell +# In Powershell +muse_env\Scripts\Activate.ps1 + +# In Linux/MacOS +source muse_env/bin/activate +``` + +Later, to recover the system-wide "normal" python, deactivate the environment with: + +```bash +deactivate +``` + +## Usage Once installed, users can: - activate the virtual environment (needed only once per session) as explained above -- run `python -m muse --model default` to run the default example model -- run `python -m muse --model default --copy XXX` to copy the model to subfolder `XXX`. -- Alternatively, run `python -m muse settings.toml`, where `settings.toml` is an input +- run `muse --model default` to run the default example model +- run `muse --model default --copy XXX` to copy the model to subfolder `XXX`. +- Alternatively, run `muse settings.toml`, where `settings.toml` is an input file for a custom model -- run `python -m muse --help` to get a description of the command-line arguments, +- run `muse --help` to get a description of the command-line arguments, including the name of any additional models provided with MUSE. -Development ------------ +## Development -It is strongly recommened to use a conda virtual environment, as above. The simplest approach is to +It is strongly recommened to use a virtual environment, as above. The simplest approach is to first download the muse code with: ```bash -> git clone https://github.com/SGIModel/MUSE_OS.git muse +> git clone https://github.com/SGIModel/MUSE_OS.git +``` + +```bash +cd MUSE_OS +# Create virtual environment - for development, this is typically called ".venv" +# Activate virtual environment. Finally, install muse: +python -m pip install -e ."[dev,doc]" ``` -And then install the working directory into the conda environment: +Please note the quotation marks. The downloaded code can then be modified. The changes will be +automatically reflected in the environment. + +To ensure the consistency of the code with other developers, install the pre-commit hooks with: ```bash -> # after activating the virtual environment with: -> # conda activate muse -> python -m pip install -e ."muse[dev,doc]" +python -m pip install pre-commit +pre-commit install ``` -Please note the quotation marks. `muse` in the last line above is the path to source code that was -just downloaded with `git`. The downloaded code can then be modified. The changes will be -automatically reflected in the conda environment. +This will ensure that a series of quality assurance tools are run with every commit you make. -In the developing phase, MUSE can also be used to run test cases to check that the model would reproduce expected results from a defined set of input data. -Tests can be run with the command [pytest](https://docs.pytest.org/en/latest/), from -theb testing framework of the same name. +In the developing phase, MUSE can also be used to run test cases to check that the model would reproduce expected results from a defined set of input data. Tests can be run with the command [pytest](https://docs.pytest.org/en/latest/), from the testing framework of the same name. The documentation can be built with: ```bash -> python -m sphinx -b html docs docs/build +python -m sphinx -b html docs docs/build ``` The main page for the documentation can then be found at @@ -95,7 +143,6 @@ or conda environment where to run the code. This will change the `.vscode/settin file and add a user-specific path to it. Users should try and avoid commiting changes to `.vscode/settings.json` indiscriminately. -Copyright ---------- +## Copyrigh -Copyright © 2021 Imperial College London +Copyright © 2023 Imperial College London From b4df93ef9b4a925116e2e9954dd888334f62785f Mon Sep 17 00:00:00 2001 From: Diego Date: Sat, 27 May 2023 10:02:46 +0100 Subject: [PATCH 43/43] Fix version numbers --- .bumpversion.cfg | 2 +- docs/conf.py | 2 +- src/muse/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 954391a63..e5a1f9233 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.15 +current_version = 1.0.1 commit = True tag = True diff --git a/docs/conf.py b/docs/conf.py index 5d8cb6047..c8ae25d54 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ project = "MUSE" copyright = "2022, Sustainable Gas Institute" author = "Imperial College London" -release = "1.0.15" +release = "1.0.1" version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- diff --git a/src/muse/__init__.py b/src/muse/__init__.py index 4e3db865e..16633f2de 100644 --- a/src/muse/__init__.py +++ b/src/muse/__init__.py @@ -1,5 +1,5 @@ """MUSE model""" -VERSION = "1.0.15" +VERSION = "1.0.1" def _create_logger():