Skip to content

Commit

Permalink
Revert "Add model perturbation example (#5)"
Browse files Browse the repository at this point in the history
This reverts commit a0f501b.
  • Loading branch information
NickGeneva authored Apr 12, 2024
1 parent a0f501b commit f951b95
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 425 deletions.
12 changes: 4 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<!-- markdownlint-disable MD024 -->
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2024-xx-xx
## [0.1.0] - 2024-04-XX

### Added

- Initial Release of earth2studio
- SFNO model `sfno_73ch_small`.

### Changed

### Deprecated
Expand All @@ -21,9 +23,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security

### Dependencies

## [0.1.0] - 2024-04-22

### Added

- Initial Release of earth2studio
2 changes: 1 addition & 1 deletion earth2studio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.1.0"
__version__ = "0.1.0a0"
22 changes: 7 additions & 15 deletions earth2studio/data/gfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,29 +206,27 @@ def modifier(x: np.array) -> np.array:

return gfsda

@classmethod
def _validate_time(cls, times: list[datetime]) -> None:
"""Verify if date time is valid for GFS based on offline knowledge
def _validate_time(self, times: list[datetime]) -> None:
"""Verify if date time is valid for GFS
Parameters
----------
times : list[datetime]
list of date times to fetch data
"""
for time in times:
if not time.hour % 6 == 0 or not time.minute == 0 or not time.second == 0:
if not time.hour % 6 == 0:
raise ValueError(
f"Requested date time {time} needs to be 6 hour interval for GFS"
)
# To update search "gfs." at https://noaa-gfs-bdp-pds.s3.amazonaws.com/index.html
# They are slowly adding more data
if time < datetime(year=2021, month=2, day=17):
if time < datetime(year=2021, month=2, day=20):
raise ValueError(
f"Requested date time {time} needs to be after February 17th, 2021 for GFS"
f"Requested date time {time} needs to be after February 20th, 2021 for GFS"
)

# if not self.available(time):
# raise ValueError(f"Requested date time {time} not available in GFS")
if not self.available(time):
raise ValueError(f"Requested date time {time} not available in GFS")

def _fetch_index(self, time: datetime) -> dict[str, tuple[int, int]]:
"""Fetch GFS atmospheric index file
Expand Down Expand Up @@ -333,12 +331,6 @@ def available(
_ds = np.timedelta64(1, "s")
time = datetime.utcfromtimestamp((time - _unix) / _ds)

# Offline checks
try:
cls._validate_time([time])
except ValueError:
return False

s3 = boto3.client(
"s3", config=botocore.config.Config(signature_version=UNSIGNED)
)
Expand Down
2 changes: 1 addition & 1 deletion examples/02_ensemble_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Simple ensemble inference workflow.
This example will demonstrate how to run a simple inference workflow to generate a
ensemble forecast using one of the built in models of Earth-2 Inference
simple ensemble forecast using one of the built in models of Earth-2 Inference
Studio.
In this example you will learn:
Expand Down
Loading

0 comments on commit f951b95

Please sign in to comment.