From 33e7d27d8b567e6c7b205d7c1222dfcc2a2c9678 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson <oscar.gustafsson@gmail.com> Date: Tue, 7 Feb 2023 09:22:36 +0100 Subject: [PATCH] Improve documentation for signal generators --- b_asic/signal_generator.py | 9 ++++++++- docs_sphinx/api/signal_generator.rst | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/b_asic/signal_generator.py b/b_asic/signal_generator.py index 7b25e586..58782b96 100644 --- a/b_asic/signal_generator.py +++ b/b_asic/signal_generator.py @@ -2,11 +2,18 @@ B-ASIC signal generators These can be used as input to Simulation to algorithmically provide signal values. +Especially, all classes defined here will act as a callable which accepts an integer +time index and returns the value at that time. + +It is worth noting that the standard basic arithmetic operations do work on these, +so one can, e.g., write ``0.5 * Step()`` to get a step input with height 0.5. +This is handled by a number of private generator classes. Check out the source code +if you want more information. """ from math import pi, sin from numbers import Number -from typing import Callable, Sequence +from typing import Sequence class SignalGenerator: diff --git a/docs_sphinx/api/signal_generator.rst b/docs_sphinx/api/signal_generator.rst index 0ca472ce..b8222319 100644 --- a/docs_sphinx/api/signal_generator.rst +++ b/docs_sphinx/api/signal_generator.rst @@ -2,5 +2,10 @@ ``b_asic.signal_generator`` *************************** +.. inheritance-diagram:: b_asic.signal_generator + :parts: 1 + :top-classes: b_asic.signal_generator.SignalGenerator + .. automodule:: b_asic.signal_generator :members: + :show-inheritance: -- GitLab