Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release v0.5.2 #150

Merged
merged 148 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
3cee920
Update python-pypi-test.yml
mohammadamint Mar 18, 2024
f142bfc
Update python-publish-pypi.yml
mohammadamint Mar 18, 2024
0c0f51e
Merge pull request #117 from RAMP-project/96-solving-the-testpypi-rel…
Bachibouzouk Mar 18, 2024
76e5342
Fix issue 114. Skip app if func_time or rand_time==0
Feb 29, 2024
1f87cc0
Add warning if appliance with func_time=0 is defined
Feb 29, 2024
d9fcb0a
Add tests and fix faulty func_time warning
Feb 29, 2024
8d5d504
Formatted code with black.
Mar 11, 2024
3d864d2
Remove comments about the issue number
Bachibouzouk Mar 14, 2024
0c65148
Check for raising of warning within the test function
Bachibouzouk Mar 14, 2024
a0346dd
Merge pull request #116 from JW-Kraft/fix/func_time_zero_error
Bachibouzouk Mar 19, 2024
898be3c
Implemented fix for duty cylce repetition issue 78 (https://github.co…
Feb 2, 2024
df3c22f
Implemented unit test for fix of issue 78 (https://github.com/RAMP-pr…
Feb 2, 2024
f92054d
Formatted code with black.
Mar 11, 2024
afe1d02
Move duty_cycle selection from update_daily_use to rand_switch_on_window
Bachibouzouk Mar 14, 2024
293242a
Compute total time before while loop
Bachibouzouk Mar 14, 2024
1355a16
Keep assignement to duty cycle 3 similar to past code
Bachibouzouk Mar 14, 2024
8f52080
Parameter to switch on/off continuous operation within duty_cycles
Bachibouzouk Mar 14, 2024
2e162de
Fix the duty cycle test
Bachibouzouk Mar 18, 2024
d5029ea
Make continuous_duty_cycle an Appliance attribute
Bachibouzouk Mar 18, 2024
21f6d40
Update example notebook for use of non continuous duty cycle
Bachibouzouk Mar 19, 2024
35428a4
Add continuous_use_duty_cycle to appliance attributes
Bachibouzouk Mar 19, 2024
3d34976
Update changelog
Bachibouzouk Mar 19, 2024
3819467
Fix old comparative tests script
Bachibouzouk Mar 19, 2024
5b42bdc
Prevent load from excel to throw error if new attribute not present
Bachibouzouk Mar 19, 2024
0564791
Remove unused line
Bachibouzouk Mar 26, 2024
03cb5cb
Merge pull request #111 from JW-Kraft/fix/duty-cycle-repetition
Bachibouzouk Mar 26, 2024
c5937c9
Round rand_peak_enlarge to be at least 1 to avoid empty peak_time_range
JW-Kraft Apr 16, 2024
96c987d
Merge pull request #132 from RAMP-project/fix/empty_peak_time_range
FLomb Apr 25, 2024
57b13ee
adding the paper files for JOSS
FLomb Dec 7, 2023
cd3ac19
Adding depreciation warning to Appliance method in User class
Mar 29, 2024
3388542
Enhance qualitative test user experience
Bachibouzouk Apr 10, 2024
724dda5
Adapt Testing guidelines
Bachibouzouk Apr 10, 2024
7f33a16
Modify switch_on test
Bachibouzouk Apr 10, 2024
9d28c32
Correct the sampling of coincident switch-on on peak
Bachibouzouk Apr 10, 2024
033c393
Fix running excel from command line
Bachibouzouk Apr 2, 2024
f592cff
Fix multi-year in cli
Bachibouzouk Apr 8, 2024
7703d0d
Add test for multi-year input in cli
Bachibouzouk Apr 8, 2024
0b90f45
Fix seasonality input of RAMP cli
Bachibouzouk Apr 8, 2024
0d72c6f
Fix small typo in core.py
FLomb Apr 12, 2024
79bccf0
Add issue templates
Bachibouzouk Apr 29, 2024
bc768cc
Link contributing guidelines within issue template
Bachibouzouk May 2, 2024
1dff6d9
Pull request template
Bachibouzouk May 2, 2024
2b1bddb
Update CONTRIBUTE.md
Bachibouzouk May 2, 2024
b9942cc
improving the readthedocs template
May 1, 2024
d8e34c8
fixing extra imports in conf.py of the previous themes
May 1, 2024
8397966
Fix rst title length
Bachibouzouk May 2, 2024
a411a62
Update conversion of notebook code
Bachibouzouk May 2, 2024
dc43cd6
Update the notebooks examples automatically upon RTD build
Bachibouzouk May 2, 2024
18b7420
Lint with black
Bachibouzouk May 2, 2024
ef006b8
Change documentation page title
Bachibouzouk May 2, 2024
8f064fc
Python=3.8 to be outdated as the prefered python version
Mar 29, 2024
5fb1872
User empty object print ValueError
Mar 29, 2024
1227ad5
Add _add_appliance_instance method to add an Appliance to a User
Bachibouzouk Apr 4, 2024
b3b495a
Fix comparison fonction of Appliance class
Bachibouzouk Apr 4, 2024
296ef55
Lint with black
Bachibouzouk Apr 4, 2024
4515baa
Fix test fixture
Bachibouzouk May 7, 2024
0277649
Link contribute section of README to CONTRIBUTE.md file
Bachibouzouk May 2, 2024
926deec
Copy README.rst from repo source and adapt link to contributing
Bachibouzouk May 2, 2024
e6b9731
Add CONTRIBUTING.md content to RTD in a dedicated section
Bachibouzouk May 2, 2024
d8285cd
exmples imrpvement - Simple Appliances
Mar 29, 2024
73909a6
exmples imrpvement - Fixed-Flatt appliances
Mar 29, 2024
332bbec
exmples imrpvement - occasional use
Mar 29, 2024
d6d081d
exmples imrpvement - cooking appliances
Mar 29, 2024
7b918dc
exmples improvement - thermal load
Mar 29, 2024
7222eb0
Update docs/notebooks/cooking_app.ipynb
mohammadamint Apr 9, 2024
6d78d90
Update docs/notebooks/fixed_flat_app.ipynb
mohammadamint Apr 9, 2024
c349a7f
Update docs/notebooks/simple_bulb.ipynb
mohammadamint Apr 9, 2024
8fa6a08
Update docs/notebooks/thermal_app.ipynb
mohammadamint Apr 9, 2024
9612562
Update docs/notebooks/simple_bulb.ipynb
mohammadamint Apr 9, 2024
321a5ae
Update docs/notebooks/simple_bulb.ipynb
mohammadamint Apr 9, 2024
9e8ba96
re-run example files
Apr 9, 2024
b1114a9
Improved fixed_cycle docs
FLomb Apr 11, 2024
d1cb327
Additional refinements
FLomb May 8, 2024
2c04462
Clean-up unwanted conda warning
FLomb May 8, 2024
88558a6
Simplified multi_cycle documentation
FLomb May 8, 2024
684af31
Update docs
Bachibouzouk May 8, 2024
6e3ba80
Add seed parameter to UseCase
Apr 4, 2024
884a797
Example file to demonstrate fixed random seed
Apr 11, 2024
f0bacef
Added myself to AUTHORS
Apr 12, 2024
04f22a5
Added Notebook demonstrating the random_seed functionality.
JW-Kraft May 8, 2024
2056417
Add coverage and coveralls to test requirements
Bachibouzouk Apr 29, 2024
8556519
Update workflow upon PR opening
Bachibouzouk Apr 29, 2024
2e26f03
Lint with black
Bachibouzouk May 8, 2024
6d8a196
Trigger jobs on joss-paper branch
Bachibouzouk May 8, 2024
c9f039b
Fix test setup
Bachibouzouk May 8, 2024
bef31c1
Add coveralls badge to readme
Bachibouzouk May 8, 2024
cb2f955
Remove deprecated code usage
Bachibouzouk May 6, 2024
307af07
Copy the appliance parameter docstrings to add_appliance docstring
Bachibouzouk May 6, 2024
1fd8891
Correct argument name typo
Bachibouzouk May 13, 2024
160b72f
Update the documentation
Bachibouzouk May 13, 2024
0fefa91
Explicit the arguments in methods the example files
Bachibouzouk May 13, 2024
652f6df
Freeze black version for CI and add jupyter linting
Bachibouzouk May 14, 2024
dcf5d74
Lint with black
Bachibouzouk May 14, 2024
3648b18
Update documentation notebooks
Bachibouzouk May 14, 2024
5c0e76a
Add ramp_convert .py to .xlsx files to command line
Bachibouzouk Apr 15, 2024
59159f3
Fix Windows bug for py to xlsx converter
Bachibouzouk May 13, 2024
5bbf9f7
Update documentation about ramp and ramp_convert commands
Bachibouzouk May 13, 2024
fee9966
Fix Windows path of .py to convert to .xlsx
Bachibouzouk May 13, 2024
b18b675
Lint with black
Bachibouzouk May 14, 2024
23e793f
Fix pandas deprecation warnings and update doc
Bachibouzouk May 15, 2024
15fcd9d
Add py to xlsx conversion fonction to the API doc
Bachibouzouk May 15, 2024
b27d0ff
Improve docstring
Bachibouzouk May 15, 2024
5bf3c91
Improve README section about conversion from py to xlsx
Bachibouzouk May 15, 2024
80c3ef2
Add test for command line conversion
Bachibouzouk May 15, 2024
5787a21
Code to reproduce JOSS figure
FLomb May 8, 2024
11cac97
Updated code based on new plotting functionality
FLomb May 8, 2024
d4c1c94
Custom line colours
FLomb May 14, 2024
ff3b187
Fix pandas deprecation warnings
Bachibouzouk May 15, 2024
8a59b6e
Update the figure generation with a fixed random seed
Bachibouzouk May 15, 2024
a610181
Lint with black
Bachibouzouk May 15, 2024
8acb318
Add pre-commit hooks configuration
Bachibouzouk May 15, 2024
6e90793
Update CONTRIBUTING.md with developper setup
Bachibouzouk May 15, 2024
4a2843c
Add multiplrocess to the install_requires in setup.py
Bachibouzouk May 15, 2024
7bf997b
Add black to dev requirements
Bachibouzouk May 15, 2024
3e4ca1d
Add test requirements to dev requirements
Bachibouzouk May 15, 2024
a54dc56
More literature and examples
FLomb May 22, 2024
fd23846
Updated figure
FLomb May 22, 2024
c633e19
add two authors
FLomb May 30, 2024
572dd70
Fix formating of certain citations
Bachibouzouk May 30, 2024
c939cf9
Add 2nd affiliation of author
Bachibouzouk May 31, 2024
75e2871
Add author orchid
Bachibouzouk May 31, 2024
85575fc
Editorial suggested changes to JOSS paper
AdamRJensen Jun 2, 2024
6e4699d
Update multi-cycle notebook
Bachibouzouk Jun 3, 2024
2b5eefb
Lint with black
Bachibouzouk Jun 3, 2024
c56b550
Fix failing test for appliance with 0 func_time
Bachibouzouk Jun 3, 2024
c0423c0
Merge pull request #149 from RAMP-project/joss-paper
Bachibouzouk Jun 4, 2024
2e2aa33
Update README.rst to clarify 'active development'
FLomb Jun 4, 2024
b34509f
Merge pull request #151 from RAMP-project/review/clarify-active-devel…
Bachibouzouk Jun 4, 2024
d8f3c35
Let the file to convert being added to system path also on posix
Bachibouzouk Jun 5, 2024
0c87d2c
Attemp to fix the online documentation
Bachibouzouk Jun 5, 2024
0922874
fix path issues in test_run.py
FLomb Jun 5, 2024
522b436
Set a user's appliance name by default if empty
Bachibouzouk Jun 5, 2024
ff026c9
Add appliances name to example files
Bachibouzouk Jun 5, 2024
14f1d61
Reselect a switch on even if falling outside duty cycle windows
Bachibouzouk Jun 5, 2024
4b4fce7
Fix fridge duty cycle
Bachibouzouk Jun 5, 2024
510c164
Extend duty_cycle window to upper bound
Bachibouzouk Jun 5, 2024
fb91034
Change duty_cycle selection method
Bachibouzouk Jun 5, 2024
2ea6532
Fix failing tests
Bachibouzouk Jun 5, 2024
fce9fc9
Merge pull request #153 from RAMP-project/fix/duty_cycle_selection
Bachibouzouk Jun 6, 2024
75cb11d
Minor docstring improvements
FLomb Jun 6, 2024
f25fbf4
Remove use of matplotlib join method in test_use
Bachibouzouk Jun 6, 2024
0fbb021
Fix contribution link
Bachibouzouk Jun 6, 2024
37c9d21
Remove contributing.md from docs/source
Bachibouzouk Jun 6, 2024
077ddbe
Merge pull request #152 from RAMP-project/fix/ramp_convert
Bachibouzouk Jun 7, 2024
0ec1e67
Update changelog
Bachibouzouk Jun 4, 2024
1e4cc7e
Bump version number
Bachibouzouk Jun 4, 2024
b31aaf8
Fix README formatting
Bachibouzouk Jun 4, 2024
9ddd6a4
Allow all python version below 3.12
Bachibouzouk Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug] Bug_short_description"
labels: bug
assignees: ''

---

Describe_the_bug

Checklist to make sure that the bug report ist complete:
- [ ] OS: *your_operating_system*, *your_distribution*
- [ ] RAMP version or Branch: *RAMP version* or *branch_name*, updated on *update_date*
- [ ] If applicable: Attach full error message
- [ ] If applicable: Share screenshots/images of your problem
- [ ] If applicable: Share used input data

<sub>*For more information on how to contribute, please check the [Contributing Guidelines](https://github.com/RAMP-project/RAMP/blob/main/CONTRIBUTING.md).*<sub>
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Custom issue template
about: If your issue is not a bug
title: ''
labels: ''
assignees: ''

---


Providing the following information will help RAMP developers assisting you:
- [ ] OS: *your_operating_system*, *your_distribution*
- [ ] RAMP version or Branch: *RAMP version* or *branch_name*, updated on *update_date*
- [ ] If applicable: Share used input data
-
<sub>*For more information on how to contribute, please check the [Contributing Guidelines](https://github.com/RAMP-project/RAMP/blob/main/CONTRIBUTING.md).*<sub>
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fix #Issue

**Changes proposed in this pull request**:
- Your_changes

<sub>*For more information on how to contribute, please check the [Contributing Guidelines](https://github.com/RAMP-project/RAMP/blob/main/CONTRIBUTING.md).*<sub>
19 changes: 15 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: RAMP tests

on:
push:
branches: [ "main", "development" ]
branches: [ "main", "development", "joss-paper"]
pull_request:
branches: [ "main", "development" ]
branches: [ "main", "development", "joss-paper"]

permissions:
contents: read
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
pip install black[jupyter]==24.4.2
- name: Lint with black
run: |
black . --check
Expand All @@ -37,4 +37,15 @@ jobs:
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest tests/
coverage run -m pytest tests/

- name: Check test coverage
run: |
coverage report -m

- name: Report to coveralls
run: |
coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALL_TOKEN }}
COVERALLS_SERVICE_NAME: github
5 changes: 4 additions & 1 deletion .github/workflows/python-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
build_and_deploy:
name: Build the release and deploy to test pypi
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@master
Expand All @@ -32,4 +35,4 @@ jobs:
with:
verbose: true
password: ${{ secrets.RAMP_PYPI_PW }}
repository_url: https://upload.pypi.org/legacy/
repository_url: https://upload.pypi.org/legacy/
5 changes: 4 additions & 1 deletion .github/workflows/python-pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
build_and_deploy:
name: Build the release and deploy to test pypi
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@master
Expand All @@ -39,4 +42,4 @@ jobs:
skip-existing: true
verbose: true
password: ${{ secrets.RAMP_TEST}}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exclude: '.git'
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.7"
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -23,4 +23,4 @@ sphinx:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/docs-requirements.txt
- requirements: docs/docs-requirements.txt
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Maria C.G. Hart, Leibniz Universität Hannover <[email protected]>
Francesco Sanvito, TU Delft <[email protected]>
Gregory Ireland, Reiner Lemoine Institut <[email protected]>
Sergio Balderrama, Universidad Mayor de San Simon <[email protected]>
Johann Kraft, Reiner Lemoine Institut <[email protected]>
44 changes: 40 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,45 @@ Release History
0.5.2 (dev)
-----------

**|new|** Addition of the 'coveralls' badge to the README

**|new|** Addition of a random-seed functionality to ensure reproducible results if needed

**|new|** If a `User` instance doesn't have any appliance, its `repr` method prints the user name, and number of users with a message to mention no appliances are assigned to the instance yet. Before it raised a `ValueError`.

**|new|** Documentation template was changed to sphinx wagtail theme to improve the navigation through the documentation sections

**|new|** Add issue templates for issue creation on github

**|new|** Automatic testing of the jupyter notebooks of the documentation, to make sure the examples are always running through

**|new|** Adding depreciation warning to back-compatibility `Appliance` method in `User` class to let users know they should use the `add_appliance` method instead.

**|new|** Introduction of an Appliance parameter to model productive use duty cycles: `continuous_use_duty_cycle`

**|changed|** Expanded and revised documentation, with a particular focus on more and clearer usage examples

**|changed|** Updated requirements for contributing, including pip dependencies specific to developers

**|changed|** Expanded test coverage

**|changed|** Updated .py example input files to match the latest formalism of the RAMP code

**|changed|** Python version was bumped from 3.8 to 3.10

**|changed|** Improved the way to run the quantitative tests and the instructions to do so

**|fixed|** Windows compatibility of path to convert .py to .xlsx

**|fixed|** `rand_peak_enlarge` is rounded to be at least 1 so that the `peak_time_range` is never empty

**|fixed|** Running .xlsx files form the command line

**|fixed|** Ignore profile of appliances if any of their functional time or randomly allocated time of use are 0

0.5.1 (2024-02-08)
-----------
------------------

**|fixed|** Plotting a cloud of profiles from the command line is fixed

0.5.0 (2023-12-06)
Expand Down Expand Up @@ -38,7 +75,7 @@ Release History
0.4.1 (2023-10-XX)
------------------

**|hotfix|** added option `-o` to the terminal command line interface to enable the user to provide output path to save ramp results. This option is also accessible to python users using `ofname` argument of the `ramp/ramp_run.py::run_usecase` or the `ramp/post_process/post_process.py::export_series` functions.
**|hotfix|** added option `-o` to the terminal command line interface to enable the user to provide output path to save ramp results. This option is also accessible to python users using `ofname` argument of the `ramp/ramp_run.py::run_usecase` or the `ramp/post_process/post_process.py::export_series` functions.

0.4.0 (2023-02-17)
------------------
Expand All @@ -57,7 +94,7 @@ Release History

**|fixed|** the way in which the random switch-on time is computed in the `stochastic_process` has been changed so that it is sampled with uniform probability from a concatenated set of functioning windows, rather than for each window separately (which led to short windows having higher concentration of switch-on events and demand peaks)

**|fixed|** the default value for the `peak_enlarg` parameter has been changed from the mistyped value of 0 to the intended value of 0.15
**|fixed|** the default value for the `peak_enlarg` parameter has been changed from the mistyped value of 0 to the intended value of 0.15

**|new|** added a paragraph describing the algorithm of RAMP

Expand Down Expand Up @@ -93,4 +130,3 @@ Release History
**|changed|** changed the way in which the probability of coincident switch-on of several identical appliances owned by a single user is computed. Now, it penalisse less the probability of maximum coincidence for off-peak events

**|fixed|** `s_peak` value is now set by default to 0.5, rather than 1. This fixes an unwanted behaviour in how the `random.gauss` function worked

52 changes: 45 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,40 @@ Some of the resources to look at if you're interested in contributing:

By contributing to RAMP, e.g. through opening a pull request or submitting a patch, you represent that your contributions are your own original work and that you have the right to license them, and you agree that your contributions are licensed under the EUROPEAN UNION PUBLIC LICENCE v. 1.2.

## Open an issue

[Open an issue](https://github.com/RAMP-project/RAMP/issues) to report a bug or for a feature request, please try to provide the information summarized below

- OS: *your_operating_system*, *your_distribution*
- RAMP version or Branch: *RAMP version* or *branch_name*, updated on *update_date*
- If applicable: Attach full error message
- If applicable: Share screenshots/images of your problem
- If applicable: Share used input data

## Submitting changes

To contribute changes:
- Fork the project on GitHub
- Follow the "Setup" steps below
- Create a feature branch (e.g. named "add-this-new-feature") to work on in your fork
- Add your name to the [AUTHORS](AUTHORS) file
- Commit your changes to the feature branch
- Push the branch to GitHub
- On GitHub, create a new pull request from the feature branch

### Setup

1. Create a virtual environment and install the dev dependencies with

pip install -r dev_requirements.txt

2. Install the pre-commit hooks with

pre-commit install

This will mainly make sure you can't commit if your code is not linted with black.
The pre-commit hook will check if your code is linted and if it is not it will simply lint it for you, you then only need to stage the changes made by the linter and commit again, as simple as that :)

### Pull requests

Before submitting a pull request, check whether you have:
Expand All @@ -44,18 +68,32 @@ Please try to write clear commit messages. One-line messages are fine for small

## Testing

We have a qualitative testing functionality that allows to compare the results arising from a modified version of the code against default ones, for the 3 reference input files provided within the code itself.
Testing is used by RAMP developers to make sure their new feature/bug fix is not breaking existing code. As RAMP is stochastic some tests are only qualitative, other unit tests are ran by GitHub Actions.

Before running the tests locally, you need to install the testing dependencies

```
pip install -r tests/requirements.txt
```

### Qualitative testing

The qualitative testing functionality allows to compare the results arising from a modified version of the code against default ones, for the 3 reference input files provided within the code itself.

To run the qualitative test, you'll have to run
```
python ramp/test/test_run.py
```
from the root level of this repository.

If you already ran this script, you will be asked if you want to overwrite the results files (if you decide not to, the results are not going to be regenerated from your latest code version). You should compare the results of your code and those saved from the latest stable version thanks to the image which is displayed after the script ran.

This functionality is accessible via `test/test_run.py`. To run the qualitative test, you'll have to go through the following steps:
1. run your modified code for the 3 reference input files for 30 days each. This will create 3 corresponding output files in the `results` folder
2. run `test/test_run.py` and visualise the comparison between the results of your code and those obtainable with the latest stable version

Ideally, the difference between reference and new results should be minimal and just due to the stochastic nature of the code. If more pronounced, it should be fully explainable based on the changes made to the code and aligned to the expectations of the developers (i.e. it should reflect a change in the output *wanted* and precisely *sought* with the commit in question).

### Unit tests

Install `pytest` (`pip install pytest`) and run `pytest tests/` form the root of the repository to run the unit tests
Run `pytest tests/` form the root of the repository to run the unit tests.

## Attribution

The layout and content of this document is partially based on [calliope](https://github.com/calliope-project/calliope/blob/master/CONTRIBUTING.md)'s equivalent document.
The layout and content of this document is partially based on [calliope](https://github.com/calliope-project/calliope/blob/master/CONTRIBUTING.md)'s equivalent document.
Loading
Loading