Skip to content

Commit 00e4b35

Browse files
authored
Merge pull request #225 from EnergySystemsModellingLab/develop
Update main branch
2 parents db1f02a + 03a2e02 commit 00e4b35

1,631 files changed

Lines changed: 40005 additions & 111514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
current_version = 1.0.2
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:src/muse/__init__.py]
7+
8+
[bumpversion:file:docs/conf.py]

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
max-line-length = 88
3+
exclude =
4+
.tox,
5+
.git,
6+
.venv,
7+
venv,
8+
build,
9+
__pycache__,
10+
extend-ignore =
11+
E203,W503
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug
11+
A clear and concise description of what the bug is, including error messages.
12+
13+
14+
## To Reproduce
15+
Steps to reproduce the behavior. Attache any input file that might be required.
16+
17+
18+
## Expected behavior
19+
A clear and concise description of what you expected to happen.
20+
21+
## Screenshots
22+
If applicable, add screenshots to help explain your problem.
23+
24+
## Context
25+
26+
Please, complete the following to better understand the system you are using to run MUSE.
27+
28+
- Operative system (eg. Windows 10):
29+
- MUSE version (eg. 1.0.1):
30+
- Installation method (eg. pipx, pip, development mode):
31+
- Python version (you can get this running `python --version`):
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Is your feature request related to a problem? Please describe.
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
## Describe the solution you'd like
14+
A clear and concise description of what you want to happen.
15+
16+
## Describe alternatives you've considered
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
## Additional context
20+
Add any other context or screenshots about the feature request here.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Usage support
3+
about: For questions related to how to use MUSE
4+
title: "[QUESTION]"
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
## What you want to achieve
11+
12+
(Please, describe in detail what you want to achieve and what parts of the documentation you have checked to do so)
13+
14+
15+
## What you have tried
16+
17+
(If you have already taken some steps, please, describe here what you have tried. Provide any input files you are trying to use).
18+
19+
20+
## Context
21+
22+
Please, complete the following to better understand the system you are using to run MUSE.
23+
24+
- Operative system (eg. Windows 10):
25+
- MUSE version (eg. 1.0.1):
26+
- Installation method (eg. pipx, pip, development mode):
27+
- Python version (you can get this running `python --version`):

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ document the change (include PR #) - note reverse order of PR #s.
2020
## Key checklist
2121

2222
- [ ] All tests pass: `$ python -m pytest`
23-
- [ ] The documentation builds and looks OK: `$ python setup.py build_sphinx`
23+
- [ ] The documentation builds and looks OK: `$ python -m sphinx -b html docs docs/build`
2424

2525
## Further checks
2626

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
schedule:
3+
- cron: 0 0 * * 0 # At 12:00 AM, only on Sunday
4+
repository_dispatch: # run manually
5+
types: [check-link]
6+
7+
name: Broken Link Check
8+
jobs:
9+
check:
10+
name: Broken Link Check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Broken Link Check
14+
uses: ruzickap/action-my-broken-link-checker@v2
15+
with:
16+
url: https://muse-os.readthedocs.io/en/latest/
17+
cmd_params: '--timeout=20 --buffer-size=8192 --max-connections=3 --color=always --skip-tls-verification --header="User-Agent:curl/7.54.0"' # muffet parameters

.github/workflows/ci.yml

Lines changed: 138 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,183 @@
1-
name: QA and tests
1+
name: QA, tests and publishing
22

33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66
push:
7-
branches: [main, develop]
8-
7+
branches: [main, develop]
8+
tags:
9+
- '*'
910
jobs:
1011
# Checks the style using the pre-commit hooks
1112
qa:
1213
runs-on: ubuntu-latest
1314
steps:
14-
- uses: actions/checkout@v2
15-
- uses: pre-commit/action@v2.0.2
15+
- uses: actions/checkout@v4
16+
- uses: pre-commit/action@v3.0.0
1617

1718
# Only then, normal testing proceeds
1819
unit-tests:
1920
needs: qa
20-
runs-on: ubuntu-latest
21+
runs-on: ${{ matrix.os }}
22+
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: [ubuntu-latest, macos-latest, windows-latest]
28+
python-version: ["3.8", "3.9"]
2129

2230
steps:
23-
- uses: actions/checkout@v2
24-
- name: Set up Python 3.8
25-
uses: actions/setup-python@v1
31+
- uses: actions/checkout@v4
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v4
2634
with:
27-
python-version: 3.8
35+
python-version: ${{ matrix.python-version }}
2836

2937
- name: Install dependencies
3038
run: |
31-
python -m pip install --upgrade pip
32-
pip install -U setuptools wheel xlrd==1.2.0
39+
python -m pip install --upgrade pip==22.1.2
40+
pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
3341
pip install -e .[all]
3442
3543
# The unit tests, with coverage under linux
3644
- name: Unit tests (linux)
3745
if: (runner.os == 'Linux')
3846
run: |
3947
pip install pytest-cov
40-
pytest -m "not regression" --junitxml=junit/pytest.xml \
48+
pytest -m "not regression and not notebook" --junitxml=junit/pytest.xml \
4149
--cov=muse \
4250
--cov-branch \
43-
--cov-report=xml:coverage/coverage.xml
51+
--cov-report=xml
52+
53+
- name: Upload coverage to Codecov
54+
if: success() && (runner.os == 'Linux' && matrix.python-version == 3.9)
55+
uses: codecov/codecov-action@v3
4456

4557
- name: Unit tests (not linux)
4658
if: (runner.os != 'Linux')
47-
run: pytest -m "not regression"
59+
run: pytest -m "not regression and not notebook"
4860

4961
regression-tests:
5062
needs: qa
51-
runs-on: ubuntu-latest
63+
runs-on: ${{ matrix.os }}
64+
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
os: [ubuntu-latest, macos-latest, windows-latest]
69+
python-version: ["3.8", "3.9"]
5270

5371
steps:
54-
- uses: actions/checkout@v2
55-
- name: Set up Python 3.8
56-
uses: actions/setup-python@v1
72+
- uses: actions/checkout@v4
73+
- name: Set up Python ${{ matrix.python-version }}
74+
uses: actions/setup-python@v4
5775
with:
58-
python-version: 3.8
76+
python-version: ${{ matrix.python-version }}
5977

6078
- name: Install dependencies
6179
run: |
62-
python -m pip install --upgrade pip
63-
pip install -U setuptools wheel xlrd==1.2.0
80+
python -m pip install --upgrade pip==22.1.2
81+
pip install -U setuptools==62.6.0 wheel xlrd==1.2.0
6482
pip install -e .[all]
6583
6684
# The regression tests (with non coverage)
6785
- name: Regression tests
68-
run: pytest -m "regression"
86+
run: pytest tests/test_fullsim_regression.py
87+
88+
# If all tests pass, we try to build a wheel
89+
build-wheel:
90+
# needs: [regression-tests, unit-tests]
91+
name: Build source distribution
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- name: Build sdist
97+
run: |
98+
python -m pip install --upgrade build
99+
python -m build
100+
101+
- uses: actions/upload-artifact@v3
102+
with:
103+
path: dist/MUSE*
104+
105+
# And if we are pushing a tag, then we try to publish it
106+
publish-TestPyPI:
107+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
108+
needs: build-wheel
109+
name: Publish MUSE to TestPyPI
110+
runs-on: ubuntu-latest
111+
permissions:
112+
id-token: write
113+
114+
steps:
115+
116+
- name: Download sdist artifact
117+
uses: actions/download-artifact@v3
118+
with:
119+
name: artifact
120+
path: dist
121+
122+
- name: Display structure of downloaded files
123+
run: ls -R dist
124+
125+
- name: Publish package distributions to TestPyPI
126+
uses: pypa/gh-action-pypi-publish@release/v1
127+
with:
128+
repository-url: https://test.pypi.org/legacy/
129+
skip-existing: true
130+
131+
publish-PyPI:
132+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
133+
needs: publish-TestPyPI
134+
name: Publish MUSE to PyPI
135+
runs-on: ubuntu-latest
136+
permissions:
137+
id-token: write
138+
139+
steps:
140+
141+
- name: Download sdist artifact
142+
uses: actions/download-artifact@v3
143+
with:
144+
name: artifact
145+
path: dist
146+
147+
- name: Display structure of downloaded files
148+
run: ls -R dist
149+
150+
- name: Publish package distributions to PyPI
151+
uses: pypa/gh-action-pypi-publish@release/v1
152+
153+
build-standalone:
154+
needs: publish-PyPI
155+
name: Build standalone executables
156+
runs-on: ${{ matrix.os }}
157+
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
os: [ windows-latest ]
162+
python-version: [ "3.9" ]
163+
164+
steps:
165+
- uses: actions/checkout@v4
166+
- name: Set up Python ${{ matrix.python-version }}
167+
uses: actions/setup-python@v4
168+
with:
169+
python-version: ${{ matrix.python-version }}
170+
171+
- name: Install dependencies
172+
run: |
173+
python -m pip install --upgrade pip
174+
python -m pip install pyinstaller
175+
python -m pip install -e .[dev,gui]
176+
177+
- name: Build directory-based standalone
178+
run: pyinstaller muse_dir.spec --distpath standalone
179+
180+
- uses: actions/upload-artifact@v3
181+
with:
182+
path: standalone/MUSE*
183+
name: MUSE

0 commit comments

Comments
 (0)