How to insert 10 min schedule for AMP using (batch) API push code?

How to insert 10 min schedule for AMP using (batch) API push code?

by Vesna Vidmar -
Number of replies: 2

Hi, Timo,

thank you for your work on code for API push.

We have updated OSCAR lib as you have recommended and we can confirm that new uploading has inserted Supervising organization and Schedules.

Our problem is that the Schedule upload works only for  1 hour. We cannot upload the schedule for 10 minutes.

Currently, we have changed only this part of the code for API upload:

```python

# default schedule . We overwrite values with values from the Excel sheet where available
default_schedule = {
"startMonth": 1, "endMonth": 12,
"startWeekday": 1, "endWeekday": 7,
"startHour": 0, "endHour": 23,
"startMinute": 0, "endMinute": 59,
"interval": 10*60, "international": True , "real-time" : True # we overwrite these with the values from Excel
}

```

We suspect further modification should be made on this part:

```python

def parseFrequency(x):
""" Extract schedule and return as seconds
Currently only hours are supported
"""
m=re.search('(\d+)\s+hour',x)
if m:
#
return int(m.group(1)) * 60 * 60 # we can only recognize hours at the moment in this code
else:
return None

```

Can you, please assist us with this problem?

Thank you very much,

Warm regards,

Vesna

In reply to Vesna Vidmar

Re: How to insert 10 min schedule for AMP using (batch) API push code?

by Luisa Ickes -
Hi Vesna,
you could write "else return 10*60" then you would get the 10 minutes if there is no hour information in the excel file. But Timo (currently sick) is also doing an update at the end of the week that is supporting minutes.
Hope that helps!
Luisa
In reply to Luisa Ickes

Re: How to insert 10 min schedule for AMP using (batch) API push code?

by Vesna Vidmar -
Hi, Luisa,
Timo has done great work on Web Tool. I can use it to make corrections for old stations and make correct upload of new stations.

Big thanks to the entire OSCAR/Surface team :)

Warm regards,
Vesna