nowcasting_dataset icon indicating copy to clipboard operation
nowcasting_dataset copied to clipboard

`PVDataSource` should only correct PVOutput.org timezone on "legacy" PVOutput.org data

Open JackKelly opened this issue 3 years ago • 1 comments
trafficstars

Since PRs https://github.com/openclimatefix/pvoutput/pull/102 and https://github.com/openclimatefix/PVConsumer/pull/11, our PVConsumer code will convert datetimes to UTC. But nowcasting_dataset assumes that PVOutput.org data is in Europe/London timezone (see these two lines of code in nowcasting_dataset). Somehow, nowcasting_dataset needs to know if the PVOutput.org is already in UTC, or if it still needs to be converted from localtime to UTC.

Context

  • https://github.com/openclimatefix/pvoutput/issues/14
  • https://github.com/openclimatefix/pvoutput/pull/102
  • https://github.com/openclimatefix/PVConsumer/pull/11
  • https://github.com/openclimatefix/PVConsumer/issues/8

Implementation

Perhaps the easiest solution might be to convert the PVOutput.org data we currently have on disk to UTC, and then remove these two lines from nowcasting_dataset.

Or, perhaps a better solution would be to modify pvoutput so it explicitly sets the timezone to UTC on all the datetimes (see https://github.com/openclimatefix/pvoutput/issues/14#issuecomment-1070456676). Then nowcasting_dataset would only assume PVOutput.org data needs converting from Europe/London timezone to UTC if the timestamps lack an explicit UTC offset.

JackKelly avatar Mar 17 '22 07:03 JackKelly

perhaps #563 could be done first

peterdudfield avatar Apr 11 '22 14:04 peterdudfield