Skip to content

Commit

Permalink
refactor(metrological_streams): replaces amplitude with value in …
Browse files Browse the repository at this point in the history
…variable names
  • Loading branch information
anupam-prasad committed Jun 10, 2021
1 parent 5246065 commit b4a0118
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions agentMET4FOF/metrological_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ def _next_sample_generator(self, batch_size: int = 1) -> np.ndarray:
)
self._sample_idx += batch_size

_amplitude: np.ndarray = self._generator_function(
_value: np.ndarray = self._generator_function(
_time, **self._generator_parameters
)
_time_unc, _value_unc = self._generator_function_unc(_time, _amplitude)
_time_unc, _value_unc = self._generator_function_unc(_time, _value)

return np.concatenate((_time, _time_unc, _amplitude, _value_unc), axis=1)
return np.concatenate((_time, _time_unc, _value, _value_unc), axis=1)

@property
def value_unc(self) -> Union[float, Iterable[float]]:
Expand Down Expand Up @@ -272,9 +272,9 @@ def __init__(

def _sine_wave_function(self, time, sine_freq):
"""A simple sine wave generator"""
amplitude = np.sin(np.multiply(2 * np.pi * sine_freq, time))
amplitude += np.random.normal(0, self.value_unc, amplitude.shape)
return amplitude
value = np.sin(np.multiply(2 * np.pi * sine_freq, time))
value += np.random.normal(0, self.value_unc, value.shape)
return value


class MetrologicalMultiWaveGenerator(MetrologicalDataStreamMET4FOF):
Expand Down

0 comments on commit b4a0118

Please sign in to comment.