diff --git a/environment.yml b/environment.yml index 36a12961..5fefc45f 100644 --- a/environment.yml +++ b/environment.yml @@ -26,9 +26,6 @@ dependencies: - boto3 - moto - # Machine learning - - pytorch::pytorch # explicitly specify pytorch channel to prevent conda from using conda-forge for pytorch, and hence installing the CPU-only version. - # PV & Geospatial - pvlib - pyproj diff --git a/nowcasting_dataset/consts.py b/nowcasting_dataset/consts.py index f392d709..d3d65f8f 100644 --- a/nowcasting_dataset/consts.py +++ b/nowcasting_dataset/consts.py @@ -3,7 +3,6 @@ from typing import Union import numpy as np -import torch import xarray as xr # DEFAULT PATHS @@ -24,7 +23,7 @@ NWP_FILENAME = "gs://" + str(BUCKET / "NWP/UK_Met_Office/UKV_zarr") # Typing -Array = Union[xr.DataArray, np.ndarray, torch.Tensor] +Array = Union[xr.DataArray, np.ndarray] PV_SYSTEM_ID: str = "pv_system_id" PV_SYSTEM_ROW_NUMBER = "pv_system_row_number" PV_SYSTEM_X_COORDS = "pv_system_x_coords" diff --git a/nowcasting_dataset/data_sources/gsp/gsp_data_source.py b/nowcasting_dataset/data_sources/gsp/gsp_data_source.py index 8868eb1f..2fe0ff6b 100644 --- a/nowcasting_dataset/data_sources/gsp/gsp_data_source.py +++ b/nowcasting_dataset/data_sources/gsp/gsp_data_source.py @@ -11,7 +11,6 @@ import numpy as np import pandas as pd -import torch import xarray as xr import nowcasting_dataset.filesystem.utils as nd_fs_utils @@ -62,8 +61,7 @@ def __post_init__(self, image_size_pixels: int, meters_per_pixel: int): Set random seed and load data """ super().__post_init__(image_size_pixels, meters_per_pixel) - seed = torch.initial_seed() - self.rng = np.random.default_rng(seed=seed) + self.rng = np.random.default_rng() self.load() def check_input_paths_exist(self) -> None: diff --git a/nowcasting_dataset/data_sources/pv/pv_data_source.py b/nowcasting_dataset/data_sources/pv/pv_data_source.py index 2738286f..481e749c 100644 --- a/nowcasting_dataset/data_sources/pv/pv_data_source.py +++ b/nowcasting_dataset/data_sources/pv/pv_data_source.py @@ -12,7 +12,6 @@ import fsspec import numpy as np import pandas as pd -import torch import xarray as xr import nowcasting_dataset.filesystem.utils as nd_fs_utils @@ -49,8 +48,7 @@ class PVDataSource(ImageDataSource): def __post_init__(self, image_size_pixels: int, meters_per_pixel: int): """ Post Init """ super().__post_init__(image_size_pixels, meters_per_pixel) - seed = torch.initial_seed() - self.rng = np.random.default_rng(seed=seed) + self.rng = np.random.default_rng() self.load() def check_input_paths_exist(self) -> None: diff --git a/nowcasting_dataset/utils.py b/nowcasting_dataset/utils.py index a60fd08d..2924a9ab 100644 --- a/nowcasting_dataset/utils.py +++ b/nowcasting_dataset/utils.py @@ -9,7 +9,6 @@ import gcsfs import numpy as np import pandas as pd -import torch import xarray as xr import nowcasting_dataset @@ -117,8 +116,6 @@ def to_numpy(value): value = np.int32(value.timestamp()) elif isinstance(value, np.ndarray) and np.issubdtype(value.dtype, np.datetime64): value = value.astype("datetime64[s]").astype(np.int32) - elif isinstance(value, torch.Tensor): - value = value.numpy() return value