Skip to content

Commit

Permalink
Remove datapipe references (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukh-P authored Feb 14, 2025
1 parent b7338a6 commit f290696
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 41 deletions.
2 changes: 1 addition & 1 deletion pvnet/data/site_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
Can also be used with pre-made batches if `sample_dir` is set.
Args:
configuration: Path to datapipe configuration file.
configuration: Path to configuration file.
sample_dir: Path to the directory of pre-saved samples. Cannot be used together with
`configuration` or '[train/val]_period'.
batch_size: Batch size.
Expand Down
4 changes: 2 additions & 2 deletions pvnet/data/uk_regional_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


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

def __init__(
self,
Expand All @@ -25,7 +25,7 @@ def __init__(
Can also be used with pre-made batches if `sample_dir` is set.
Args:
configuration: Path to datapipe configuration file.
configuration: Path to configuration file.
sample_dir: Path to the directory of pre-saved samples. Cannot be used together with
`configuration` or '[train/val]_period'.
batch_size: Batch size.
Expand Down
6 changes: 3 additions & 3 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def make_clean_data_config(input_path, output_path, placeholder="PLACEHOLDER"):
"""Resave the data config and replace the filepaths with a placeholder.
Args:
input_path: Path to input datapipes configuration file
input_path: Path to input configuration file
output_path: Location to save the output configuration file
placeholder: String placeholder for data sources
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ def minimize_data_config(input_path, output_path, model):
"""Strip out parts of the data config which aren't used by the model
Args:
input_path: Path to input datapipes configuration file
input_path: Path to input configuration file
output_path: Location to save the output configuration file
model: The PVNet model object
"""
Expand Down Expand Up @@ -286,7 +286,7 @@ def save_pretrained(
if isinstance(config, dict):
(save_directory / CONFIG_NAME).write_text(json.dumps(config, indent=4))

# Save cleaned datapipes configuration file
# Save cleaned configuration file
if data_config is not None:
new_data_config_path = save_directory / DATA_CONFIG_NAME

Expand Down
4 changes: 2 additions & 2 deletions pvnet/models/model_cards/pv_india_model_card_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023

### Preprocessing

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


## Results
Expand All @@ -48,4 +48,4 @@ Trained on a single NVIDIA Tesla T4
### Software

- [1] https://github.com/openclimatefix/PVNet
- [2] https://github.com/openclimatefix/ocf_datapipes
- [2] https://github.com/openclimatefix/ocf-data-sampler
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023

### Preprocessing

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


## Results
Expand All @@ -51,4 +51,4 @@ Trained on a single NVIDIA Tesla T4
### Software

- [1] https://github.com/openclimatefix/PVNet
- [2] https://github.com/openclimatefix/ocf_datapipes
- [2] https://github.com/openclimatefix/ocf-data-sampler
4 changes: 2 additions & 2 deletions pvnet/models/model_cards/wind_india_model_card_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The model is trained on data from 2019-2022 and validated on data from 2022-2023

### Preprocessing

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


## Results
Expand All @@ -48,4 +48,4 @@ Trained on a single NVIDIA Tesla T4
### Software

- [1] https://github.com/openclimatefix/PVNet
- [2] https://github.com/openclimatefix/ocf_datapipes
- [2] https://github.com/openclimatefix/ocf-data-sampler
1 change: 0 additions & 1 deletion pvnet/models/multimodal/site_encoders/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def __init__(
self.input_key_to_use = input_key_to_use
self.num_channels = num_channels
self.num_sites_in_inference = num_sites_in_inference
print(self.sequence_length, "SEQUENCE LENGTH")

if use_id_in_value:
self.value_id_embedding = nn.Embedding(num_sites, id_embed_dim)
Expand Down
27 changes: 0 additions & 27 deletions scripts/load_batches.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ocf_datapipes.utils.location import Location
from ocf_data_sampler.select.location import Location
from pvnet.utils import SiteLocationLookup
import xarray as xr
import pytest
Expand Down

0 comments on commit f290696

Please sign in to comment.