Skip to content

Commit

Permalink
fix: make transforms AsSet and AsTimeSeries serializable
Browse files Browse the repository at this point in the history
closes #302
  • Loading branch information
vpratz committed Feb 11, 2025
1 parent 1081bbd commit 0a4921b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bayesflow/adapters/transforms/as_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ def inverse(self, data: np.ndarray, **kwargs) -> np.ndarray:
return np.squeeze(data, axis=2)

return data

@classmethod
def from_config(cls, config: dict, custom_objects=None) -> "AsSet":
return cls()

def get_config(self) -> dict:
return {}
7 changes: 7 additions & 0 deletions bayesflow/adapters/transforms/as_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ def inverse(self, data: np.ndarray, **kwargs) -> np.ndarray:
return np.squeeze(data, axis=2)

return data

@classmethod
def from_config(cls, config: dict, custom_objects=None) -> "AsTimeSeries":
return cls()

def get_config(self) -> dict:
return {}

0 comments on commit 0a4921b

Please sign in to comment.