Jump to content

Pushing Multiple Conditions in Single spy.push


Go to solution Solved by Mark Derbecker,

Recommended Posts

I am using Seeq DataLab to pull in data from multiple processing units running in parallel. I am assessing the states of each of these units, and building a set of capsules for when each individual unit is running. I then am pushing these capsules as a condition back into a workbook.

I am able to successfully achieve this using a for loop and using separate data pushes for each unit. I find that the time for the data to push back to the Workbook takes the longest, and was curious to see if I could do one large push of Conditions for all unit ops at once, rather than having to do separate pushes for each unit? I have done this for multiple Signals in the past, but cannot find documentation for a way to do it with multiple Conditions.

Below is a concatenated version of the code I am currently running using the for loops:

for index in range(len(state)):

...
     capsule_bounds = pd.DataFrame({'Capsule Start': start_list, 'Capsule End': end_list, 'Batch ID': batch_id_list})

     spy.push(data=capsule_bounds,
                     metadata=pd.DataFrame([{
                                       'Name': 'Unit '+[index]+' Condition',
                                       'Type': 'Condition',
                                       'Maximum Duration': max_dur}]),
                     replace={'Start': start_time, 'End':  end_time},
                     workbook=workbook_id)

Link to comment
Share on other sites

  • Seeq Team
  • Solution
Posted (edited)

Hi Ryan,

In the latest versions of SPy (use v190.2 or later) you can supply a "Condition" column in your "data" DataFrame that corresponds to an index entry in your "metadata" DataFrame, and this combination will allow you to push multiple conditions in spy.push() call. It should be faster because SPy will push the conditions in parallel.

Take a look at the docs here for more info:

https://python-docs.seeq.com/user_guide/spy.push.html#pushing-condition-and-capsule-data

Edited by Mark Derbecker
Link to comment
Share on other sites

Thank you, Mark. Read through the docs but missed that paragraph when reading through. Knowing that it was in there helped me find it - and your solution sped up the data push, as expected.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...