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

Add coverage and coveralls to test requirements #136

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 14 additions & 3 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 Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def copy_readme():
idx = data.index(
"To contribute changes please consult our `Contribution guidelines <https://github.com/RAMP-project/RAMP/blob/main/CONTRIBUTING.md>`_\n"
)
data[
idx
] = "To contribute changes please consult our `Contribution guidelines <contributing.html>`_\n"
data[idx] = (
"To contribute changes please consult our `Contribution guidelines <contributing.html>`_\n"
)
with open("readme.rst", "w") as fp:
fp.writelines(data)

Expand Down
1 change: 0 additions & 1 deletion ramp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions ramp/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down Expand Up @@ -95,7 +97,6 @@ def __init__(
self.daily_profiles = None
self.random_seed = random_seed


self.appliances = []
self.users = []
if users is None:
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pytest
scipy
mock
scipy==1.12.0
nbconvert
ipykernel
coverage==7.4.4
coveralls==4.0.0
-e .
Loading