Skip to content

Commit 0a4921b

Browse files
committed
fix: make transforms AsSet and AsTimeSeries serializable
closes #302
1 parent 1081bbd commit 0a4921b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

bayesflow/adapters/transforms/as_set.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ def inverse(self, data: np.ndarray, **kwargs) -> np.ndarray:
3333
return np.squeeze(data, axis=2)
3434

3535
return data
36+
37+
@classmethod
38+
def from_config(cls, config: dict, custom_objects=None) -> "AsSet":
39+
return cls()
40+
41+
def get_config(self) -> dict:
42+
return {}

bayesflow/adapters/transforms/as_time_series.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ def inverse(self, data: np.ndarray, **kwargs) -> np.ndarray:
3030
return np.squeeze(data, axis=2)
3131

3232
return data
33+
34+
@classmethod
35+
def from_config(cls, config: dict, custom_objects=None) -> "AsTimeSeries":
36+
return cls()
37+
38+
def get_config(self) -> dict:
39+
return {}

0 commit comments

Comments
 (0)