Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban authored May 10, 2021
1 parent 6caff36 commit 9431be0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eddymotion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ def predict(self, gradient, **kwargs):
class AverageDWModel:
"""A trivial model that returns an average map."""

__slots__ = ("_data",)
__slots__ = ("_data", "_gtab")

def __init__(self, gtab, **kwargs):
"""Implement object initialization."""
return # do nothing at initialization time
self._gtab = gtab

def fit(self, data, **kwargs):
"""Calculate the average."""
self._data = data.mean(-1)
self._data = data[..., self._gtab[..., 3] > 50].mean(-1)

def predict(self, gradient, **kwargs):
"""Return the average map."""
Expand Down

0 comments on commit 9431be0

Please sign in to comment.