Skip to content

Commit

Permalink
feat(MetrologicalGeneratorAgent): rewrote to default metrological gen…
Browse files Browse the repository at this point in the history
…erator agent for both streams
  • Loading branch information
anupam-prasad committed Mar 29, 2021
1 parent 54f4035 commit 52606d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions agentMET4FOF/metrological_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def custom_plot_function(self, data, sender_agent, **kwargs):
trace = go.Scatter()
return trace

class MetrologicalSineGeneratorAgent(MetrologicalAgent):
class MetrologicalGeneratorAgent(MetrologicalAgent):
"""An agent streaming a sine signal
Takes samples from an instance of :py:class:`MetrologicalSineGenerator` with sampling frequency `sfreq` and
Expand All @@ -221,14 +221,8 @@ def init_parameters(
Parameters
----------
sine_freq : float
the frequency of the
sfreq : int
the sampling frequency of the generated signal
value_unc : iterable of floats or float, optional
standard uncertainty(ies) of the quantity values. Defaults to 0.1.
time_unc : iterable of floats or float, optional
standard uncertainty of the time stamps. Defaults to 0.
signal : MetrologicalDataStreamMET4FOF
the underlying signal for the generator
"""
self._stream = signal
super().init_parameters()
Expand All @@ -246,4 +240,4 @@ def agent_loop(self):
"""
if self.current_state == "Running":
self.set_output_data(channel="default", data=self._stream.next_sample())
super().agent_loop()
super().agent_loop()
2 changes: 1 addition & 1 deletion agentMET4FOF/metrological_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def __init__(
ampl_arr: np.array = np.array([1]),
phase_ini_arr: np.array = np.array([0]),
intercept: float = 0,
device_id: str = "DataGenerator",
device_id: str = "MultiWaveDataGenerator",
time_name: str = "time",
time_unit: str = "s",
quantity_names: Union[str, Tuple[str, ...]] = ("Length", "Mass"),
Expand Down

0 comments on commit 52606d7

Please sign in to comment.