-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Get values from multiple tags at the same time. #74
Comments
I'll have to look into this type of call, especially in detecting whether the function was called as a method or statically. The recommended call is as follows: import PIconnect as PI
import pandas as pd
with PI.PIServer() as server:
tags = server.search(query)
pd.concat([tag.interpolated_values(start, end, interval) for tag in tags], axis = 1) The main advantage is that the context manager (called by the |
Yes, I do use the context manager in either case, so I should clarify the intent of my question... |
Ah now I see what your pointing at. That would actually be nice if some performance could be gained there. Looking at the AF SDK documentation it seems there is the concept of a |
Hugo, I am struggling to use it due to my poor python.
|
Backreference from #526: Requesting data for multiple points in a single query should use the same timestamps for all underlying tags. |
Backreference from #502: Possibly provide an option to simplify the returned value to a single point if only one point is requested. |
Hiya, So we have a working version of this using PIPointList and a wrapper built by us which returns search using PIPointList and its 3-4x faster for around 35 pitags. If needed I can share the code with you so you can integrate it? |
@niltecedu I was actually just implementing a PIPointList wrapper as well, but please share your version so we can take the best features of both implementations! |
Hi @Hugovdberg sorry for the late reply. I have uploaded our implementation to the repo here: (dead) We call the load_pidata file to load our data into a dataframe. New_pireader contains all of the functions to retrieve the data, you might see loads of hacky code to make it work however I found that was the only way. there's a new function in PI.py name search_list which returns a pipointlist. This is used in new_pireader to call the retrieve functions. This was all updated to use pythonnet 3 so there might be change in other places in our piconnect. I updated the older version, this all happened in november last year when the project wasn't updated for a while :P I don't think there is a way to call that search like yours. However we got a speed from 3x-10x while pulling the data, so it's definitely a very good addition. (sorry had to take down the repo for sensitive data reasons) |
Thanks for sharing, I was working on a wrapper around the PIPointList class that would allow it to be a drop in replacement for the list that's currently returned by |
So we tried to do that however the functions called by PIPointlist are different in comparision to PIPoint, that's why we decided to have a separate wrapper for it. |
Is there any way to loop through a list of Pi Points (over 300 in my case) from a Pi Server to determine which ones are stale or bad without having to pull their data individually and trending them? |
Hi |
Hi, Any update on this |
Hugo thanks for sharing your code. I have a feature request;
Description
tags is a list of PIPoint objects. The following code works for me;
my_single_data = PIconnect.PIData.PISeriesContainer.interpolated_values(tags[0],"2018-03-19 20:00:00","2018-03-19 20:02:00","00:00:30")
It would be nice if the function could take a list of PIPoints and return an array of data.
my_data_table = PIconnect.PIData.PISeriesContainer.interpolated_values(tags,"2018-03-19 20:00:00","2018-03-19 20:02:00","00:00:30")
The text was updated successfully, but these errors were encountered: