Skip to content

Commit

Permalink
added __init__ for protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvanderschelling committed Dec 13, 2024
1 parent 37ef696 commit 1838767
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/f3dasm/_src/optimization/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def dfdx(self, x: np.ndarray) -> np.ndarray:

class ExperimentData(Protocol):

def __init__(self, domain: Domain, input_data: np.ndarray,
output_data: np.ndarray):
...

@property
def domain(self) -> Domain:
...
Expand Down Expand Up @@ -290,7 +294,6 @@ def _iterate(self, iterations: int, kwargs: Dict[str, Any],
new_samples = self.update_step()

# If new_samples is a tuple of input_data and output_data
# TODO: This doesn't work with a Protocol
if isinstance(new_samples, tuple):
new_samples = type(self.data)(
domain=self.data.domain,
Expand Down

0 comments on commit 1838767

Please sign in to comment.