Skip to content

Commit

Permalink
refactor(streams): replaces amplitude with value in variable name…
Browse files Browse the repository at this point in the history
…s in generator classes
  • Loading branch information
anupam-prasad committed Jun 10, 2021
1 parent b4a0118 commit 177b231
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions agentMET4FOF/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def _default_generator_function(self, time):
----------
time : Union[List, DataFrame, np.ndarray]
"""
amplitude = np.sin(2*np.pi*self.F*time)
return amplitude
value = np.sin(2*np.pi*self.F*time)
return value

def set_generator_function(
self, generator_function: Callable = None, sfreq: int = None, **kwargs: Any
Expand Down Expand Up @@ -218,11 +218,11 @@ def _next_sample_generator(self, batch_size: int = 1) -> Dict[str, np.ndarray]:
1)/self.sfreq
self._sample_idx += batch_size

amplitude: np.ndarray = self._generator_function(
value: np.ndarray = self._generator_function(
time, **self._generator_parameters
)

return {'quantities': amplitude, 'time': time}
return {'quantities': value, 'time': time}

def set_data_source(
self,
Expand Down Expand Up @@ -392,8 +392,8 @@ def __init__(self, sfreq=500, sine_freq=50):

def sine_wave_function(self, time, sine_freq):
"""A simple sine wave generator"""
amplitude = np.sin(2 * np.pi * sine_freq * time)
return amplitude
value = np.sin(2 * np.pi * sine_freq * time)
return value


class CosineGenerator(DataStreamMET4FOF):
Expand All @@ -420,8 +420,8 @@ def __init__(self, sfreq = 500, cosine_freq=5):

def cosine_wave_function(self, time, cosine_freq=50):
"""A simple cosine wave generator"""
amplitude = np.cos(2 * np.pi * cosine_freq * time)
return amplitude
value = np.cos(2 * np.pi * cosine_freq * time)
return value


def extract_x_y(message):
Expand Down

0 comments on commit 177b231

Please sign in to comment.