IEA-Task-43 / digital_wra_data_standard

IEA Task 43: pre-construction energy estimate data standard repository
BSD 3-Clause "New" or "Revised" License
58 stars 16 forks source link

load_demo_schema.ipynb - ValueError when "date_to": null #253

Closed SebAgain closed 5 months ago

SebAgain commented 8 months ago

Describe the bug When I run the Jupyter file "load_demo_schema.ipynb" (from "Tools" Folder) using following json file "demo_data/iea43_wra_data_model.json", I have a ValueError in the chapter "More details on each measurement point"

To Reproduce Steps to reproduce the behavior:

  1. Run Jupyter file "load_demo_schema.ipynb"
  2. Go to "More details on each measurement point" Section to see the ValueError

Expected behavior It seems that the "null" value in the json file for the "date_to" property is converted to "2100-12-31" by the Jupyter file and causes a ValueError.

Screenshots Capture2 Capture3

stephenholleran commented 8 months ago

Hi @SebAgain,

Thanks for reaching out!

I'm afraid I can't replicate your error. It seems to be a pd.to_datetime() issue alright in that it is not able to recognize the "2100-12-31" as the format "%Y-%m-%dT%H:%M:%S". I wonder is it a Pandas version issue? It does require at least v1.0. My pandas and numpy versions are: image

The code is meant to use the date "2100-12-31" as a placeholder for a None date. See cell 8. This is then removed when displaying the table. In the Notebook, this is what the result should look like. image

SebAgain commented 8 months ago

Hi @stephenholleran and thank you for your quick reply.

With Pandas version 1.5.3 it works ! The issue is with Pandas version 2.2.0.

I hadn't understood that the note "Requires Pandas Version +1.0" meant that the Pandas version also had to be <2.0.

stephenholleran commented 8 months ago

I hadn't understood that the note "Requires Pandas Version +1.0" meant that the Pandas version also had to be <2.0.

It doesn't. I think we need to modify this to make it work with Pandas v2.0+. Thanks for discovering.