diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2fb318d..3bd4563 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -15,7 +15,7 @@ jobs: verify: - name: Apply pre-commit hooks and launch tests + name: Pre-commit hooks and Tests runs-on: ubuntu-latest steps: - name: Checkout diff --git a/src/meteole/__init__.py b/src/meteole/__init__.py index efc260b..beaa6e6 100644 --- a/src/meteole/__init__.py +++ b/src/meteole/__init__.py @@ -3,10 +3,9 @@ from meteole._arome import AromeForecast from meteole._arpege import ArpegeForecast -from meteole._client import MeteoFranceClient from meteole._vigilance import Vigilance -__all__ = ["AromeForecast", "ArpegeForecast", "MeteoFranceClient", "Vigilance"] +__all__ = ["AromeForecast", "ArpegeForecast", "Vigilance"] __version__ = version("meteole") diff --git a/src/meteole/_vigilance.py b/src/meteole/_vigilance.py index 7bd8252..b6faf9e 100644 --- a/src/meteole/_vigilance.py +++ b/src/meteole/_vigilance.py @@ -5,13 +5,14 @@ import matplotlib.pyplot as plt import pandas as pd -from meteole import _client, const +from meteole import const +from meteole.client import MeteoFranceClient from meteole.errors import MissingDataError logger = logging.getLogger(__name__) -class Vigilance(_client.MeteoFranceClient): +class Vigilance(MeteoFranceClient): """Wrapper around the meteo-France API for the vigilance data. Ressources are: - textesvigilance diff --git a/src/meteole/_client.py b/src/meteole/client.py similarity index 100% rename from src/meteole/_client.py rename to src/meteole/client.py diff --git a/src/meteole/forecast.py b/src/meteole/forecast.py index fcdc5ed..a3674ee 100644 --- a/src/meteole/forecast.py +++ b/src/meteole/forecast.py @@ -4,7 +4,7 @@ import os import shutil import tempfile -from abc import abstractmethod +from abc import ABC, abstractmethod from pathlib import Path import pandas as pd @@ -12,13 +12,13 @@ import xmltodict from meteole import const -from meteole._client import MeteoFranceClient +from meteole.client import MeteoFranceClient from meteole.errors import MissingDataError logger = logging.getLogger(__name__) -class Forecast(MeteoFranceClient): +class Forecast(ABC, MeteoFranceClient): """ Provides a unified interface to query AROME and ARPEGE endpoints diff --git a/tests/test_core.py b/tests/test_core.py index a3a6fa8..d9c02cf 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2,7 +2,7 @@ import pytest -from meteole._client import MeteoFranceClient +from meteole.client import MeteoFranceClient def test_init_with_api_key(): @@ -19,7 +19,7 @@ def test_init_with_token(): assert api.application_id is None -@patch("meteole._client.MeteoFranceClient.connect") +@patch("meteole.client.MeteoFranceClient.connect") def test_init_with_application_id(mock_connect): api = MeteoFranceClient(application_id="dummy_app_id") assert api.application_id == "dummy_app_id" diff --git a/tests/test_forecast.py b/tests/test_forecast.py index 9bb089f..9da0f42 100644 --- a/tests/test_forecast.py +++ b/tests/test_forecast.py @@ -310,7 +310,7 @@ def test_validate_parameters(self, mock_get_capabilities): arpege_forecast._validate_parameters() @patch("meteole._arpege.ArpegeForecast.get_capabilities") - @patch("meteole._client.MeteoFranceClient.connect") + @patch("meteole.client.MeteoFranceClient.connect") def test_entry_point(self, mock_MeteoFranceClient_connect, mock_get_capabilities): territory = "EUROPE" arpege_forecast = ArpegeForecast(territory=territory)