SolarArbiter / solarforecastarbiter-api

HTTP API and database schema for the Solar Forecast Arbiter
https://api.solarforecastarbiter.org
MIT License
10 stars 6 forks source link

Validate data uploads have the same interval as interval_length #169

Closed alorenzo175 closed 5 years ago

alorenzo175 commented 5 years ago

closes #45

The offset issue could still be a problem e.g. I can upload data from 12:05 to 12:15 with 5 minute intervals just fine, but I can then upload data with timestamps 12:16, 12:21, 12:26, which will likely cause downstream problems. I can also always upload a single timestamp like 12:17:42.

wholmgren commented 5 years ago

What if we also compare the last time in the database to the first time in the upload?

alorenzo175 commented 5 years ago

would need something like /latest https://github.com/SolarArbiter/solarforecastarbiter-api/issues/168

and then data uploads would require 'write_values', 'read' and 'read_values' permissions on the object. Perhaps OK, perhaps not. I guess we could get creative and add a 'read_last_value' permission or something to restrict that a bit more.

wholmgren commented 5 years ago

The permission complication is gross. Would be better to add a new metadata field if necessary.

On Thu, Oct 3, 2019 at 9:36 AM Tony Lorenzo notifications@github.com wrote:

would need something like /latest #168 https://github.com/SolarArbiter/solarforecastarbiter-api/issues/168

and then data uploads would require 'write_values', 'read' and 'read_values' permissions on the object. Perhaps OK, perhaps not. I guess we could get creative and add a 'read_last_value' permission or something to restrict that a bit more.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SolarArbiter/solarforecastarbiter-api/pull/169?email_source=notifications&email_token=ABBOERYAXCW3FYLQNR7S2RTQMYNSHA5CNFSM4I5FLAX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAIZSHI#issuecomment-538024221, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBOER2TDCYAY32HT2ORWA3QMYNSHANCNFSM4I5FLAXQ .

alorenzo175 commented 5 years ago

We could also say that 'write_values' gives the necessary access to be able to actually write values. So read interval_length, and get the last timestamp in the series. I think I'm ok with this as long as it is documented.

wholmgren commented 5 years ago

Ok

On Thu, Oct 3, 2019 at 9:51 AM Tony Lorenzo notifications@github.com wrote:

We could also say that 'write_values' gives the necessary access to be able to actually write values. So read interval_length, and get the last timestamp in the series. I think I'm ok with this as long as it is documented.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SolarArbiter/solarforecastarbiter-api/pull/169?email_source=notifications&email_token=ABBOERYA4NPT7SKGIE7WFYLQMYPHJA5CNFSM4I5FLAX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAI26MY#issuecomment-538029875, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBOER2DMOXLKGYSCKDVROTQMYPHJANCNFSM4I5FLAXQ .

alorenzo175 commented 5 years ago

I think I'll allow the new timestamps to be some multiple of interval_length from the last timestamp. It's easier for users at the cost of maintaining a continuous timeseries in the database.

alorenzo175 commented 5 years ago

Too much of a pain for now. Some tests basically rely on data posted to both the demo and real api