Skip to content
Open
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
2 changes: 1 addition & 1 deletion tests/data/test_pvlive_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import MagicMock
from datetime import datetime
import pytz
from open_data_pvnet.scripts.fetch_pvlive_data import PVLiveData
from src.open_data_pvnet.scripts.fetch_pvlive_data import PVLiveData


@pytest.fixture
Expand Down
4 changes: 4 additions & 0 deletions tests/test_dwd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import pytest
from unittest.mock import Mock
from pathlib import Path
import sys
import pathlib

src_dir = pathlib.Path(__file__).parent.parent / 'src'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just put this once in the confest.py?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @peterdudfield help me clarify. I can't find the confest.py module to respond to this, kindly help me out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might have to make one?

btw, are you sure this is necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea

sys.path.insert(0, str(src_dir))
from open_data_pvnet.nwp.dwd import (
generate_variable_url,
fetch_dwd_data,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import pytest
from unittest.mock import patch
import sys
import pathlib

src_dir = pathlib.Path(__file__).parent.parent / 'src'
sys.path.insert(0, str(src_dir))

from open_data_pvnet.main import (
configure_parser,
load_env_and_setup_logger,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_met_office.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import pytest
from unittest.mock import Mock
import sys
import pathlib

src_dir = pathlib.Path(__file__).parent.parent / 'src'
sys.path.insert(0, str(src_dir))

from open_data_pvnet.nwp.met_office import (
generate_prefix,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import tomllib
import sys
import pathlib

src_dir = pathlib.Path(__file__).parent.parent / 'src'
sys.path.insert(0, str(src_dir))

import open_data_pvnet


Expand Down
4 changes: 4 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import yaml
import pandas as pd
from huggingface_hub.utils import EntryNotFoundError
import sys
import pathlib

src_dir = pathlib.Path(__file__).parent.parent / 'src'
sys.path.insert(0, str(src_dir))
from open_data_pvnet.utils.config_loader import load_config
from open_data_pvnet.utils.env_loader import load_environment_variables
from open_data_pvnet.utils.data_converters import convert_nc_to_zarr
Expand Down