diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 73e16b80..30485f03 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 2.5.1 +current_version = 2.6.0 message = Bump version: {current_version} → {new_version} [skip ci] [bumpversion:file:pvnet/__init__.py] diff --git a/pvnet/__init__.py b/pvnet/__init__.py index 5f1e63d3..364191b4 100644 --- a/pvnet/__init__.py +++ b/pvnet/__init__.py @@ -1,2 +1,2 @@ """PVNet""" -__version__ = "2.5.1" +__version__ = "2.6.0" diff --git a/pvnet/data/utils.py b/pvnet/data/utils.py index e216a22d..198bbc9d 100644 --- a/pvnet/data/utils.py +++ b/pvnet/data/utils.py @@ -1,8 +1,7 @@ """Utils common between Wind and PV datamodules""" import numpy as np import torch -from ocf_datapipes.batch import unstack_np_batch_into_examples -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey, unstack_np_batch_into_examples from torch.utils.data import IterDataPipe, functional_datapipe diff --git a/pvnet/models/base_model.py b/pvnet/models/base_model.py index 452c79e3..0ddc9f1b 100644 --- a/pvnet/models/base_model.py +++ b/pvnet/models/base_model.py @@ -17,7 +17,7 @@ from huggingface_hub.file_download import hf_hub_download from huggingface_hub.hf_api import HfApi from huggingface_hub.utils._deprecation import _deprecate_positional_args -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from ocf_ml_metrics.evaluation.evaluation import evaluation from ocf_ml_metrics.metrics.errors import common_metrics diff --git a/pvnet/models/baseline/last_value.py b/pvnet/models/baseline/last_value.py index c86f9e54..cd4eda0b 100644 --- a/pvnet/models/baseline/last_value.py +++ b/pvnet/models/baseline/last_value.py @@ -1,6 +1,6 @@ """Persistence model""" -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey import pvnet from pvnet.models.base_model import BaseModel diff --git a/pvnet/models/baseline/single_value.py b/pvnet/models/baseline/single_value.py index 24dcd9f0..99b51700 100644 --- a/pvnet/models/baseline/single_value.py +++ b/pvnet/models/baseline/single_value.py @@ -1,6 +1,6 @@ """Average value model""" import torch -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn import pvnet diff --git a/pvnet/models/multimodal/deep_supervision.py b/pvnet/models/multimodal/deep_supervision.py index f86f0086..8013bf74 100644 --- a/pvnet/models/multimodal/deep_supervision.py +++ b/pvnet/models/multimodal/deep_supervision.py @@ -5,7 +5,7 @@ import torch import torch.nn.functional as F -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn import pvnet diff --git a/pvnet/models/multimodal/multimodal.py b/pvnet/models/multimodal/multimodal.py index f51a2f65..e711c9af 100644 --- a/pvnet/models/multimodal/multimodal.py +++ b/pvnet/models/multimodal/multimodal.py @@ -4,7 +4,7 @@ from typing import Optional import torch -from ocf_datapipes.utils.consts import BatchKey, NWPBatchKey +from ocf_datapipes.batch import BatchKey, NWPBatchKey from torch import nn import pvnet diff --git a/pvnet/models/multimodal/nwp_weighting.py b/pvnet/models/multimodal/nwp_weighting.py index 8fe3b430..b0b51823 100644 --- a/pvnet/models/multimodal/nwp_weighting.py +++ b/pvnet/models/multimodal/nwp_weighting.py @@ -2,7 +2,7 @@ from typing import Optional import torch -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn import pvnet diff --git a/pvnet/models/multimodal/site_encoders/encoders.py b/pvnet/models/multimodal/site_encoders/encoders.py index c7951b86..db8dd659 100644 --- a/pvnet/models/multimodal/site_encoders/encoders.py +++ b/pvnet/models/multimodal/site_encoders/encoders.py @@ -3,7 +3,7 @@ """ import torch -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn from pvnet.models.multimodal.linear_networks.networks import ResFCNet2 diff --git a/pvnet/models/multimodal/weather_residual.py b/pvnet/models/multimodal/weather_residual.py index c93ab7a3..ab2a1906 100644 --- a/pvnet/models/multimodal/weather_residual.py +++ b/pvnet/models/multimodal/weather_residual.py @@ -4,7 +4,7 @@ import torch import torch.nn.functional as F -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn import pvnet diff --git a/pvnet/models/utils.py b/pvnet/models/utils.py index c652735e..30a107ba 100644 --- a/pvnet/models/utils.py +++ b/pvnet/models/utils.py @@ -6,7 +6,7 @@ import numpy as np import torch -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey logger = logging.getLogger(__name__) diff --git a/pvnet/utils.py b/pvnet/utils.py index 2c01316c..33e26372 100644 --- a/pvnet/utils.py +++ b/pvnet/utils.py @@ -15,7 +15,8 @@ import yaml from lightning.pytorch.loggers import Logger from lightning.pytorch.utilities import rank_zero_only -from ocf_datapipes.utils.consts import BatchKey, Location +from ocf_datapipes.batch import BatchKey +from ocf_datapipes.utils import Location from ocf_datapipes.utils.geospatial import osgb_to_lon_lat from omegaconf import DictConfig, OmegaConf diff --git a/requirements.txt b/requirements.txt index 6f76e32d..d5eaf6de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ocf_datapipes==2.3.1 +ocf_datapipes>=3.0.0 ocf_ml_metrics numpy pandas diff --git a/scripts/hindcast.py b/scripts/hindcast.py index df8684ac..fd0951e4 100644 --- a/scripts/hindcast.py +++ b/scripts/hindcast.py @@ -10,9 +10,9 @@ import pandas as pd import torch import xarray as xr +from ocf_datapipes.batch import BatchKey from ocf_datapipes.load import OpenGSP from ocf_datapipes.training.pvnet import construct_sliced_data_pipeline -from ocf_datapipes.utils.consts import BatchKey from ocf_datapipes.utils.utils import stack_np_examples_into_batch from torchdata.dataloader2 import DataLoader2, MultiProcessingReadingService from torchdata.datapipes.iter import IterableWrapper diff --git a/scripts/save_concurrent_batches.py b/scripts/save_concurrent_batches.py index eaed5d37..4d628f36 100644 --- a/scripts/save_concurrent_batches.py +++ b/scripts/save_concurrent_batches.py @@ -23,12 +23,11 @@ import hydra import numpy as np import torch -from ocf_datapipes.batch import stack_np_examples_into_batch +from ocf_datapipes.batch import BatchKey, stack_np_examples_into_batch from ocf_datapipes.training.common import ( open_and_return_datapipes, ) from ocf_datapipes.training.pvnet import construct_loctime_pipelines, construct_sliced_data_pipeline -from ocf_datapipes.utils.consts import BatchKey from omegaconf import DictConfig, OmegaConf from sqlalchemy import exc as sa_exc from torch.utils.data import DataLoader diff --git a/tests/conftest.py b/tests/conftest.py index a2af6a46..7c7fec34 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ import torch import hydra -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from datetime import timedelta import pvnet diff --git a/tests/models/multimodal/site_encoders/test_encoders.py b/tests/models/multimodal/site_encoders/test_encoders.py index c3040173..acdc96ca 100644 --- a/tests/models/multimodal/site_encoders/test_encoders.py +++ b/tests/models/multimodal/site_encoders/test_encoders.py @@ -1,5 +1,5 @@ import torch -from ocf_datapipes.utils.consts import BatchKey +from ocf_datapipes.batch import BatchKey from torch import nn from pvnet.models.multimodal.site_encoders.encoders import ( diff --git a/tests/test_data/sample_batches/train/000000.pt b/tests/test_data/sample_batches/train/000000.pt index 5979f430..a291529f 100644 Binary files a/tests/test_data/sample_batches/train/000000.pt and b/tests/test_data/sample_batches/train/000000.pt differ diff --git a/tests/test_data/sample_batches/train/000001.pt b/tests/test_data/sample_batches/train/000001.pt index 23f8d414..5031a53b 100644 Binary files a/tests/test_data/sample_batches/train/000001.pt and b/tests/test_data/sample_batches/train/000001.pt differ