Skip to content

Commit

Permalink
STY: Added doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
aksharsarvesh committed Aug 26, 2024
1 parent 0ba9daa commit e3471c1
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion pydm/widgets/archiver_time_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ def __init__(
use_archive_data: Optional[bool] = True,
liveData: Optional[bool] = True,
color: Optional[str] = "green",

**kws
):
super(FormulaCurveItem, self).__init__(**kws)
Expand Down Expand Up @@ -461,6 +460,15 @@ def evaluate(self) -> None:
)

def set_up_eval(self, archive: bool) -> dict:
"""Because we are doing very similar evaluations for Archive and Live Data,
we are going to set up our data structures such that we can compute our evaluation
more easily. This function will (generally) be called twice, once with archive = True,
once with False
Parameters
----------------
archive: bool
Whether this is setting up for Archive Data or Live Data"""
pvIndices = dict()
for pv in self.pvs.keys():
pv_current_index = 0
Expand All @@ -479,6 +487,28 @@ def set_up_eval(self, archive: bool) -> dict:
def compute_evaluation(
self, formula: str, pvData: dict, pvValues: dict, pvIndices: dict, archive: bool
) -> np.ndarray:
"""This is where the actual computation takes place. We are going to go through
the data step by step and calculate our formula at each timestamp available
Parameters
----------------
formula: str
The formula to compute
pvData: dict
A dictionary containing all of the Archive or Live data for each curve
pvValues: dict
The value of each curve at the current timestep. At the start of this function,
each is set to their respective last seen values when the time is equal to the
latest start time of all of the curves.
pvIndices: dict
A dictionary storing where in each curve's data buffer we are currently at while calculating
archive: bool
Whether or not this is computing for the Archive or for Live"""

current_time = self.min_archiver_x
output = np.zeros((2, 0), order="f", dtype=float)
while True:
Expand Down

0 comments on commit e3471c1

Please sign in to comment.