Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion notebooks/tutorial/CNN-Model-Training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8364,7 +8364,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
34 changes: 0 additions & 34 deletions notebooks/tutorial/ENSO Prediction.ipynb

This file was deleted.

120 changes: 120 additions & 0 deletions notebooks/tutorial/ENSO Tutorial/1 Tech Test.ipynb

Large diffs are not rendered by default.

2,087 changes: 2,087 additions & 0 deletions notebooks/tutorial/ENSO Tutorial/ENSO Gridded MLP.ipynb

Large diffs are not rendered by default.

2,397 changes: 2,397 additions & 0 deletions notebooks/tutorial/ENSO Tutorial/ENSO_Forecast.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,054 changes: 0 additions & 1,054 deletions notebooks/tutorial/ENSO_Forecast.ipynb

This file was deleted.

2 changes: 1 addition & 1 deletion notebooks/tutorial/MLX-Demo-Custom-Arch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ def __getitem__(self, idx: Any):
return super().__getitem__(idx)




class TemporalRetrieval(SequenceRetrieval):
"""
Retrieve a sequence of samples from `SequenceRetrieval`,
Expand All @@ -453,6 +455,12 @@ def __init__(
merge_kwargs: Optional[dict[str, Any]] = None,
delta_unit: Optional[str] = None,
):
'''
Args:
samples: number of samples to fetch (negative for n-back, positive for n-forward)
delta_unit: e.g. "month" or "hour"
concat: whether to contact or merge
'''
super().__init__(samples, merge_function=merge_function, concat=concat, merge_kwargs=merge_kwargs)

def map_to_tuple(mod):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,32 @@ def unnormalise(self, sample):
class Deviation(xarrayNormalisation):
"""Deviation Normalisation"""

def __init__(self, mean: FILE, deviation: FILE):
def __init__(self, mean: FILE | xr.Dataset | xr.DataArray| float, deviation: FILE | xr.Dataset | xr.DataArray | float):
'''
Each argument take take a Dataset, DataArray, float or file object.

Args:
mean: mean values to subtract
deviation: deviation value to divide by
'''
super().__init__()
self.record_initialisation()
self.mean = self.open_file(mean)
self.deviation = self.open_file(deviation)

if isinstance(mean, xr.Dataset):
self.mean = mean
if isinstance(mean, xr.DataArray):
self.mean = mean
elif isinstance(mean, float):
self.mean = mean
else:
self.mean = self.open_file(mean)

if isinstance(deviation, xr.Dataset):
self.deviation = deviation
elif isinstance(deviation, float):
self.deviation = deviation
else:
self.deviation = self.open_file(deviation)

def normalise(self, sample):
return (sample - self.mean) / self.deviation
Expand All @@ -169,6 +190,7 @@ def denormalise(self, sample):
return (sample * self.deviation) + self.mean



class Division(xarrayNormalisation):
"""Division based Normalisation"""

Expand All @@ -185,6 +207,8 @@ def denormalise(self, sample):
return sample * self.division_factor




@BackwardsCompatibility(Division)
def TemporalDifference(*a, **k): ...

Expand Down