Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit e5b5d88

Browse files
Merge pull request #214 from openclimatefix/issue/153-use-fsspec
Issue/153 use fsspec
2 parents a5af07b + 859ca7c commit e5b5d88

File tree

14 files changed

+375
-527
lines changed

14 files changed

+375
-527
lines changed

notebooks/2021-09/2021-09-13/remove_hash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from nowcasting_dataset.cloud.gcp import get_all_filenames_in_path, rename_file
1+
from nowcasting_dataset.filesystem.gcp import get_all_filenames_in_path, rename_file
22
import random
33

44

nowcasting_dataset/cloud/aws.py

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

nowcasting_dataset/cloud/gcp.py

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

nowcasting_dataset/cloud/local.py

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

nowcasting_dataset/cloud/utils.py

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

nowcasting_dataset/dataset/datasets.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
from nowcasting_dataset import data_sources
1717
from nowcasting_dataset import utils as nd_utils
18-
from nowcasting_dataset.cloud.aws import aws_download_to_local
19-
from nowcasting_dataset.cloud.gcp import gcp_download_to_local
18+
from nowcasting_dataset.filesystem.utils import download_to_local
2019
from nowcasting_dataset.config.model import Configuration
2120
from nowcasting_dataset.consts import (
2221
GSP_YIELD,
@@ -189,17 +188,10 @@ def __getitem__(self, batch_idx: int) -> Batch:
189188
remote_netcdf_filename = os.path.join(self.src_path, netcdf_filename)
190189
local_netcdf_filename = os.path.join(self.tmp_path, netcdf_filename)
191190

192-
if self.cloud == "gcp":
193-
gcp_download_to_local(
194-
remote_filename=remote_netcdf_filename,
195-
local_filename=local_netcdf_filename,
196-
gcs=self.gcs,
197-
)
198-
elif self.cloud == "aws":
199-
aws_download_to_local(
191+
if self.cloud in ["gcp", "aws"]:
192+
download_to_local(
200193
remote_filename=remote_netcdf_filename,
201194
local_filename=local_netcdf_filename,
202-
s3_resource=self.s3_resource,
203195
)
204196
else:
205197
local_netcdf_filename = remote_netcdf_filename

0 commit comments

Comments
 (0)