Robert Rhodes Posted August 16, 2023 Share Posted August 16, 2023 I am trying to push a curated dataframe of existing tags that was queried with a spy.search then dropna was done on "Estimated Sample Period" to remove stale tags. Any ideas on how to do this? I would also like to perform the formula function .convertUnits('eu') in the process. Any tips, trick, ideas would be appreciated. Link to comment Share on other sites More sharing options...
Seeq Team Kin How Posted August 17, 2023 Seeq Team Share Posted August 17, 2023 Hi Robert, Could you provide more details about the "dropna was done on "Estimated Sample Period" to remove stale tags" step? When you run the spy.pull() step, you can apply a calculation to the pull. See this document for more information. Link to comment Share on other sites More sharing options...
Robert Rhodes Posted August 17, 2023 Author Share Posted August 17, 2023 (edited) @Ken How, When I do spy.search and specify the estimate_sample_period for a day and if there is data on a signal it will come back with a timestamp, if it does not have data, it will return a NAT for that signal. After that step the dataframe.dropna(subset=['Estimated Sample Period']) can be used to remove NAT rows as well. Then I am left with a dataset of good tags that I want to insert into a Workbench after doing the convert. spy.search({ 'Name': 'Area ?_Compressor Stage', 'Datasource Name': 'Example Data' }, estimate_sample_period=dict(Start='2019-01-01', End='2019-01-30')) Edited August 17, 2023 by Robert Rhodes Link to comment Share on other sites More sharing options...
Seeq Team Kin How Posted August 18, 2023 Seeq Team Share Posted August 18, 2023 Hi Robert, After the spy.search and dropNA step, you can create a metadata to convert the unit of the selected signals and push it to Seeq workbench. #Search for tags and dropNA search_df = spy.search({ 'Name': 'Area ?_Compressor Stage', 'Datasource Name': 'Example Data' }, estimate_sample_period=dict(Start='2019-01-01', End='2019-01-30')) search_df = search_df.dropna(subset=['Estimated Sample Period']) # Create a copy of the search table so we can manipulate it formulas = search_df.copy() formulas #Create the metadata formulas['Name'] = formulas['Name'] + '_convertunit' formulas['Formula'] = '$signal.convertUnits(\'C\')' #For this example, I am converting the unit to DegC. formulas['Formula Parameters'] = '$signal=' + formulas['ID'] formulas.head() #Push the metadata to Seeq workbench spy.push(metadata = formulas[['Name', 'Formula', 'Formula Parameters']], worksheet='Unit Conversion') Link to comment Share on other sites More sharing options...
Robert Rhodes Posted August 18, 2023 Author Share Posted August 18, 2023 @Ken How, That solution is working like a charm, but there seems to be a limit of 10 signals once I open the workbook. Any ideas on if there is a limit on the push or should I be doing something different? Link to comment Share on other sites More sharing options...
Seeq Team Siti Tay Posted August 21, 2023 Seeq Team Share Posted August 21, 2023 Hi Robert, Right now the spy.push can only show 10 items in the display. The rest of the items are still pushed and searchable. A workaround to get more than ten pushed signals to display in the Worksheet is discussed in :Increase the number of displayed signals from 10 when spy.push is used Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now