time data '11-11-2017' does not match format '%Y-%m-%d'

User avatar
Different Computers
Posts: 2609
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

time data '11-11-2017' does not match format '%Y-%m-%d'

Post by Different Computers »

This happened for the first time today, as far as I know.

Code: Select all

   Matplotlib Critical Error       [Chart Future weather] time data '11-11-2017' does not match format '%Y-%m-%d'
This might be related to changes in the WUnderground plugin, which is where the data originates.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by DaveL17 »

That's right. The Matplotlib plugin presently requires your data to be formatted in a specific way:
If you are successful, the plugin will generate simple CSV data files like the one to the right. The plugin expects a certain structure for the data files it uses, so if you choose to include your own CSV data, your files should contain the following:
  1. one header row with the first column as the observation timestamp and the second column as the observation to be charted (note that the header value of the data column will be used for chart legend labels),
  2. each timestamp formatted as YYYY-MM-DD HH:MM:S.S (standard datetime format: %Y-%m-%d %H:%M:%S.%f ), and
  3. each observation on its own row
By selecting the date format MM-DD-YYYY in the Weather Underground plugin, your date format won't match the required YYY-MM-DD format that Matplotlib expects. At some point, I'll revise the matplotlib plugin to be more agnostic about date formatting, but until then, I'd suggest going back to YYY-MM-DD in WU.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
Different Computers
Posts: 2609
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by Different Computers »

Thanks!

This must have been a change in WU, as I didn't mess with any of those options. In fact, I don't think I had ever even realized those date options existed.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by DaveL17 »

Yes - that was a new feature with v6.0.01. The default for WU is "DD-MM-YYYY' and in hindsight I should've made the default compatible with the required Matplotlib format. Sorry about that.

I'll change the WU default to be compatible for v6 (and the upcoming v7); although I acknowledge that doesn't help you now. :)
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
mclass
Posts: 317
Joined: Wed May 13, 2015 7:00 pm
Location: Melbourne, Australia

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by mclass »

Whilst not directly related to the Wunderground issue, I have today installed Matplotlib v0.7.05 on Indigo 7.1.1 running on OSX 10.11.6.

On creation of my first CSV Engine device I am getting the following error:

Code: Select all

 Matplotlib Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 433, in runConcurrentThread
  File "plugin.py", line 1077, in csv_refresh
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 325, in _strptime
ValueError: time data '' does not match format '%Y-%m-%d %H:%M:%S.%f'

   Matplotlib Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
I have tried different devices in the CSV engine, and the error continues.

It appears that time data is missing. Using datetime in terminal I get:

Code: Select all

datetime.datetime(2018, 9, 11, 15, 28, 36, 703497)
so it seems Python knows what's going on!!

Any suggestions?
TIA
mclass
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by DaveL17 »

mclass wrote: Any suggestions?
TIA
mclass
I wrote out an exceptionally well written and pithy reply stating that I needed a bit more information to understand the result you're seeing (and at least one other user reported) because I was unable to reproduce the error. Then I tried some more stuff and was able to reproduce the error.

So this is a much less well written yet still nominally pithy reply to say that I now see the error and will work on a solution. :D

TLDR;
It's not you. It's me.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by DaveL17 »

-= SITREP =-

Bug found and apparently exterminated. Look for v0.7.06 soon.

If you are so inclined, you can pull the latest repo from GitHub; a formal release will follow directly.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
mclass
Posts: 317
Joined: Wed May 13, 2015 7:00 pm
Location: Melbourne, Australia

Re: time data '11-11-2017' does not match format '%Y-%m-%d'

Post by mclass »

Hi Dave!

Thanks for the prompt response! Away from computer but will check it out asap.

(tried to keep this short and pithy )

mclass


Sent from my iPad using Tapatalk
Post Reply

Return to “Matplotlib Plugin”