Skip to content

Commit df806ee

Browse files
Sukhil PatelSukhil Patel
authored andcommitted
Remove datapipe references
1 parent eeebe67 commit df806ee

File tree

9 files changed

+15
-44
lines changed

9 files changed

+15
-44
lines changed

pvnet/data/site_datamodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
Can also be used with pre-made batches if `sample_dir` is set.
2626
2727
Args:
28-
configuration: Path to datapipe configuration file.
28+
configuration: Path to configuration file.
2929
sample_dir: Path to the directory of pre-saved samples. Cannot be used together with
3030
`configuration` or '[train/val]_period'.
3131
batch_size: Batch size.

pvnet/data/uk_regional_datamodule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class DataModule(BaseDataModule):
11-
"""Datamodule for training pvnet and using pvnet pipeline in `ocf_datapipes`."""
11+
"""Datamodule for training pvnet and using pvnet pipeline in `ocf-data-sampler`."""
1212

1313
def __init__(
1414
self,
@@ -25,7 +25,7 @@ def __init__(
2525
Can also be used with pre-made batches if `sample_dir` is set.
2626
2727
Args:
28-
configuration: Path to datapipe configuration file.
28+
configuration: Path to configuration file.
2929
sample_dir: Path to the directory of pre-saved samples. Cannot be used together with
3030
`configuration` or '[train/val]_period'.
3131
batch_size: Batch size.

pvnet/models/base_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def make_clean_data_config(input_path, output_path, placeholder="PLACEHOLDER"):
4242
"""Resave the data config and replace the filepaths with a placeholder.
4343
4444
Args:
45-
input_path: Path to input datapipes configuration file
45+
input_path: Path to input configuration file
4646
output_path: Location to save the output configuration file
4747
placeholder: String placeholder for data sources
4848
"""
@@ -81,7 +81,7 @@ def minimize_data_config(input_path, output_path, model):
8181
"""Strip out parts of the data config which aren't used by the model
8282
8383
Args:
84-
input_path: Path to input datapipes configuration file
84+
input_path: Path to input configuration file
8585
output_path: Location to save the output configuration file
8686
model: The PVNet model object
8787
"""
@@ -286,7 +286,7 @@ def save_pretrained(
286286
if isinstance(config, dict):
287287
(save_directory / CONFIG_NAME).write_text(json.dumps(config, indent=4))
288288

289-
# Save cleaned datapipes configuration file
289+
# Save cleaned configuration file
290290
if data_config is not None:
291291
new_data_config_path = save_directory / DATA_CONFIG_NAME
292292

pvnet/models/model_cards/pv_india_model_card_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023
3232

3333
### Preprocessing
3434

35-
Data is prepared with the `ocf_datapipes.training.pvnet_site` datapipe [2].
35+
Data is prepared with the `ocf_data_sampler/torch_datasets/datasets/site` Dataset [2].
3636

3737

3838
## Results
@@ -48,4 +48,4 @@ Trained on a single NVIDIA Tesla T4
4848
### Software
4949

5050
- [1] https://github.com/openclimatefix/PVNet
51-
- [2] https://github.com/openclimatefix/ocf_datapipes
51+
- [2] https://github.com/openclimatefix/ocf-data-sampler

pvnet/models/model_cards/pv_uk_regional_model_card_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023
3131

3232
### Preprocessing
3333

34-
Data is prepared with the `ocf_datapipes.training.pvnet` datapipe [2].
34+
Data is prepared with the `ocf_data_sampler/torch_datasets/datasets/pvnet_uk` Dataset [2].
3535

3636

3737
## Results
@@ -51,4 +51,4 @@ Trained on a single NVIDIA Tesla T4
5151
### Software
5252

5353
- [1] https://github.com/openclimatefix/PVNet
54-
- [2] https://github.com/openclimatefix/ocf_datapipes
54+
- [2] https://github.com/openclimatefix/ocf-data-sampler

pvnet/models/model_cards/wind_india_model_card_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023
3232

3333
### Preprocessing
3434

35-
Data is prepared with the `ocf_datapipes.training.windnet` datapipe [2].
35+
Data is prepared with the `ocf_data_sampler/torch_datasets/datasets/site` Dataset [2].
3636

3737

3838
## Results
@@ -48,4 +48,4 @@ Trained on a single NVIDIA Tesla T4
4848
### Software
4949

5050
- [1] https://github.com/openclimatefix/PVNet
51-
- [2] https://github.com/openclimatefix/ocf_datapipes
51+
- [2] https://github.com/openclimatefix/ocf-data-sampler

pvnet/models/multimodal/site_encoders/encoders.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import einops
66
import torch
7-
from ocf_datapipes.batch import BatchKey
87
from torch import nn
98

109
from pvnet.models.multimodal.linear_networks.networks import ResFCNet2
@@ -75,13 +74,13 @@ def __init__(
7574
)
7675

7776
def _calculate_attention(self, x):
78-
gsp_ids = x[BatchKey.gsp_id].squeeze().int()
77+
gsp_ids = x["gsp_id"].squeeze().int()
7978
attention = self._attention_network(gsp_ids)
8079
return attention
8180

8281
def _encode_value(self, x):
8382
# Shape: [batch size, sequence length, PV site]
84-
pv_site_seqs = x[BatchKey.pv].float()
83+
pv_site_seqs = x["pv"].float()
8584
batch_size = pv_site_seqs.shape[0]
8685

8786
pv_site_seqs = pv_site_seqs.swapaxes(1, 2).flatten(0, 1)
@@ -170,7 +169,6 @@ def __init__(
170169
self.input_key_to_use = input_key_to_use
171170
self.num_channels = num_channels
172171
self.num_sites_in_inference = num_sites_in_inference
173-
print(self.sequence_length, "SEQUENCE LENGTH")
174172

175173
if use_id_in_value:
176174
self.value_id_embedding = nn.Embedding(num_sites, id_embed_dim)

scripts/load_batches.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ocf_datapipes.utils.location import Location
1+
from ocf_data_sampler.select.location import Location
22
from pvnet.utils import SiteLocationLookup
33
import xarray as xr
44
import pytest

0 commit comments

Comments
 (0)