Jump to content

pull() of raw data (without default 15 min grid) fails


Go to solution Solved by Johannes Sikstrom,

Recommended Posts

Posted (edited)

Hi,

I'm having issues pulling raw samples without the default grid.

First I create a calculation one one truck. I search for one truck, and do a calculation push()

truck1034_signals = spy.search({
    "Path": "path >> to >> truck >> G52_TRC1034"
})

Payload_resamp_calc = spy.push(metadata=pd.DataFrame([{
    'Type': 'Signal',
    'Name': 'Payload Resamp',
    'Formula': "$p.resample($c.toNumber()).remove($l2.isNotEqualTo('KR_KID2'))",
    'Formula Parameters': {
        '$c': truck1034_signals[truck1034_signals['Name'] == 'CycleID'],
        '$p': truck1034_signals[truck1034_signals['Name'] == 'Payload'],
        '$l2': truck1034_signals[truck1034_signals['Name'] == 'LoadDestination'],
    }
}]), workbook='SPy Documentation Examples >> spy.pull')

Then i search for more trucks, in this case just 6 trucks for testing. (In reality its like 60 trucks i want to get.)

#this finds 6 trucks
truck_assets = spy.search({
    "Name": "G52_TRC103",
    "Path": "path >> to >> truck >> Hauling"
})

start=pd.Timestamp("2023-11-17 01:45", tz='CET')
end=pd.Timestamp("2023-11-17 03:15", tz='CET')

df = spy.pull(truck_assets,start=start, end=end, calculation=Payload_resamp_calc,header='Name')
df.head()

Running this with default grid works and gives this result:
image.png.26bdc5979ff4c77aaf13907c15b8d985.png

 

However, i want raw samples, not default grid of 15 min. When I ad the grid=None option to the pull i get this error:

df = spy.pull(truck_assets,start=start, end=end, calculation=Payload_resamp_calc,header='Name',grid=None)


SPy Error: Pull cannot include conditions when no signals are present with shape='samples' and grid=None

Why is it not working without the grid? 

I tried even for just one truck and still it does not work with the grid=None. Is it due to the calculation in some way?

Edited by Johannes Sikstrom
  • 2 weeks later...
  • Solution
Posted (edited)

Just for posterity:
Seeq/Mark identified this as a bug. I was given a temporary work around and the bug will be addressed in future version. The method in the first post was basically correct.

 

"This Development Request has been addressed in future Seeq version(s):
64.0.0, 59.3.5, 61.1.12, 60.3.7, 58.8.7, 63.0.5, 62.0.13
"  

Edited by Johannes Sikstrom
  • Like 1

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...