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

Remove cloud from YAML config. #153 #281

Merged
merged 2 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions gcp.yaml

This file was deleted.

1 change: 0 additions & 1 deletion nowcasting_dataset/config/gcp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
general:
cloud: gcp
description: example configuration
name: example
input_data:
Expand Down
21 changes: 7 additions & 14 deletions nowcasting_dataset/config/model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""" Configuration model for the dataset """
from datetime import datetime
from typing import Optional
import logging

import git
from pathy import Pathy
Expand All @@ -21,25 +20,19 @@ class General(BaseModel):

name: str = Field("example", description="The name of this configuration file.")
description: str = Field(
"example configuration", description="Description of this confgiruation file"
)
cloud: str = Field(
"gcp",
description=(
"local, gcp, or aws. Deprecated. Will be removed when issue"
" https://github.com/openclimatefix/nowcasting_dataset/issues/153"
" is implemented"
),
"example configuration", description="Description of this configuration file"
)


class Git(BaseModel):
"""Git model"""

hash: str = Field(..., description="The git hash has for when a dataset is created.")
message: str = Field(..., description="The git message has for when a dataset is created.")
hash: str = Field(
..., description="The git hash of nowcasting_dataset when a dataset is created."
)
message: str = Field(..., description="The git message for when a dataset is created.")
committed_date: datetime = Field(
..., description="The git datestamp has for when a dataset is created."
..., description="The git datestamp for when a dataset is created."
)


Expand All @@ -55,7 +48,7 @@ class DataSourceMixin(BaseModel):
history_minutes: int = Field(
None,
ge=0,
description="how many historic minutes are used. "
description="how many historic minutes to use. "
"If set to None, the value is defaulted to InputData.default_history_minutes",
)

Expand Down
8 changes: 4 additions & 4 deletions scripts/prepare_ml_data.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env python3

"""Pre-prepares batches of data on Google Cloud Storage.
"""Pre-prepares batches of data.

Usage:

First, manually create the GCS directories given by the constants
First, manually create the directories given by the constants
DST_TRAIN_PATH and DST_VALIDATION_PATH, and create the
LOCAL_TEMP_PATH. Note that all files will be deleted from
LOCAL_TEMP_PATH when this script starts up.

Currently caluclating azimuth and elevation angles, takes about 15 mins for 2548 PV systems, for about 1 year
Currently caluclating azimuth and elevation angles, takes about 15 mins for 2548 PV systems,
for about 1 year.

"""
from nowcasting_dataset.filesystem import utils
Expand Down Expand Up @@ -75,7 +76,6 @@
LOCAL_TEMP_PATH = Path(config.process.local_temp_path).expanduser()

UPLOAD_EVERY_N_BATCHES = config.process.upload_every_n_batches
CLOUD = config.general.cloud # either gcp or aws

# Necessary to avoid "RuntimeError: receieved 0 items of ancdata". See:
# https://discuss.pytorch.org/t/runtimeerror-received-0-items-of-ancdata/4999/2
Expand Down
3 changes: 0 additions & 3 deletions scripts/validate_ml_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
maximum_batch_id_train,
f"gs://{DST_TRAIN_PATH}",
LOCAL_TEMP_PATH,
cloud="gcp",
configuration=config,
),
**dataloader_config,
Expand All @@ -60,7 +59,6 @@
maximum_batch_id_train,
f"gs://{DST_VALIDATION_PATH}",
LOCAL_TEMP_PATH,
cloud="gcp",
configuration=config,
),
**dataloader_config,
Expand All @@ -71,7 +69,6 @@
maximum_batch_id_train,
f"gs://{DST_TEST_PATH}",
LOCAL_TEMP_PATH,
cloud="gcp",
configuration=config,
),
**dataloader_config,
Expand Down
1 change: 0 additions & 1 deletion tests/config/nwp_size_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
general:
cloud: gcp
description: example configuration
name: example
git: null
Expand Down
1 change: 0 additions & 1 deletion tests/config/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
general:
cloud: gcp
description: example configuration
name: example
git: null
Expand Down