Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 672559c

Browse files
committed
fix one part of test
1 parent b7bdbd8 commit 672559c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

ocf_datapipes/load/configuration.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
import fsspec
22
from pathy import Pathy
3+
import logging
34
from pyaml_env import parse_config
45
from torchdata.datapipes import functional_datapipe
56
from torchdata.datapipes.iter import IterDataPipe
67

78
from ocf_datapipes.config.model import Configuration
89

10+
logger = logging.getLogger(__name__)
11+
912

1013
@functional_datapipe("open_config")
1114
class OpenConfigurationIterDataPipe(IterDataPipe):
1215
def __init__(self, configuration_filename: str):
1316
self.configuration_filename = configuration_filename
1417

1518
def __iter__(self):
19+
logger.debug(f'Going to open {self.configuration_filename}')
1620
with fsspec.open(self.configuration_filename, mode="r") as stream:
1721
configuration = parse_config(data=stream)
1822

23+
logger.debug(f'Converting to Configuration ({configuration})')
1924
configuration = Configuration(**configuration)
2025

2126
while True:

tests/production/test_pp_production.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
from ocf_datapipes.production.power_perceiver import power_perceiver_production_datapipe
22
from ocf_datapipes.utils.consts import BatchKey
33

4+
import ocf_datapipes
5+
import os
6+
47

58
def test_pp_production_datapipe():
6-
pp_dp = power_perceiver_production_datapipe(
7-
"/home/jacob/Development/ocf_datapipes/tests/config/test.yaml"
8-
)
9+
10+
filename = os.path.join(os.path.dirname(ocf_datapipes.__file__), "../tests/config/test.yaml")
11+
12+
pp_dp = power_perceiver_production_datapipe(filename)
13+
914
batch = next(iter(pp_dp))
1015

1116
assert len(batch[BatchKey.hrvsatellite_time_utc]) == 4

0 commit comments

Comments
 (0)