diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 7e2e0c3f..edfa4dc0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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 @@ -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 diff --git a/README.rst b/README.rst index fa29acac..50be80fd 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,10 @@ :target: https://rampdemand.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status +.. image:: https://coveralls.io/repos/github/RAMP-project/RAMP/badge.svg?branch=main +:target: https://coveralls.io/github/RAMP-project/RAMP?branch=main + + .. image:: https://github.com/RAMP-project/RAMP/blob/main/docs/source/_static/RAMP_logo_basic.png?raw=true :width: 300 diff --git a/docs/source/conf.py b/docs/source/conf.py index c30c43c8..cb331cbf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,9 +32,9 @@ def copy_readme(): idx = data.index( "To contribute changes please consult our `Contribution guidelines `_\n" ) - data[ - idx - ] = "To contribute changes please consult our `Contribution guidelines `_\n" + data[idx] = ( + "To contribute changes please consult our `Contribution guidelines `_\n" + ) with open("readme.rst", "w") as fp: fp.writelines(data) diff --git a/ramp/__init__.py b/ramp/__init__.py index 3f23af7e..d3753eb8 100644 --- a/ramp/__init__.py +++ b/ramp/__init__.py @@ -13,7 +13,6 @@ - random """ - from ramp._version import __version__ from ramp.core.core import UseCase, User, Appliance from ramp.core.utils import yearly_pattern, get_day_type diff --git a/ramp/core/core.py b/ramp/core/core.py index 1c2779ad..7e290969 100644 --- a/ramp/core/core.py +++ b/ramp/core/core.py @@ -42,7 +42,9 @@ def single_appliance_daily_load_profile(args): return args[0], app.daily_use -warnings.simplefilter('always', DeprecationWarning) + +warnings.simplefilter("always", DeprecationWarning) + class UseCase: def __init__( @@ -95,7 +97,6 @@ def __init__( self.daily_profiles = None self.random_seed = random_seed - self.appliances = [] self.users = [] if users is None: @@ -891,7 +892,10 @@ def Appliance( refer to Appliance class docs """ - warnings.warn("This function is deprecated and not supported since version v0.4.0. Instead use the add_appliance method.", DeprecationWarning) + warnings.warn( + "This function is deprecated and not supported since version v0.4.0. Instead use the add_appliance method.", + DeprecationWarning, + ) return self.add_appliance( number=number, diff --git a/setup.py b/setup.py index 055399da..1dffb354 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ version=__version__, packages=find_packages(), license="European Union Public License 1.2", - python_requires="<=3.10", + python_requires="<=3.11", package_data={"": ["*.txt", "*.dat", "*.doc", "*.rst", "*.xlsx", "*.csv"]}, install_requires=[ "pandas >= 1.3.3", diff --git a/tests/requirements.txt b/tests/requirements.txt index d3c960f9..8ba4d4e7 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,8 @@ pytest -scipy +mock +scipy==1.12.0 nbconvert ipykernel +coverage==7.4.4 +coveralls==4.0.0 -e . \ No newline at end of file