nickmckay / LiPD-utilities

Input/output and manipulation utilities for LiPD files in Matlab, R and Python
http://nickmckay.github.io/LiPD-utilities/
GNU General Public License v2.0
28 stars 9 forks source link

Tsid warnings at the validation step from the LiPD utilities #10

Closed khider closed 7 years ago

khider commented 7 years ago

Tsids error when using lipd.validate() but Tsids are being generated nonetheless ODP659.Tiedemann.1994.zip ODP659.Tiedemann.1994.xlsx

chrismheiser commented 7 years ago

Not reproducible

screen shot 2017-06-12 at 1 42 15 pm screen shot 2017-06-12 at 1 42 07 pm
chrismheiser commented 7 years ago

Kawahata.2009.zip

I created a file through Excel -> LiPD that gave me the error. File has TSids in JSON. { "TSid" : "PYTKXWTD3OW", "TakenAtDepth" : "Depth", "number" : 1, "variableName" : "sample type" }, { "TSid" : "PYTGN31D2ND", "TakenAtDepth" : "Depth", "number" : 2, "variableName" : "specific name" }, { "TSid" : "PYTIEZNZ4IP", "TakenAtDepth" : "Depth", "number" : 3, "variableName" : "sample #" },

Validator API shows missing 109 TSids

screen shot 2017-06-15 at 3 38 49 pm

Same file passes without the TSid warning on the website.

screen shot 2017-06-15 at 3 40 26 pm
chrismheiser commented 7 years ago

The issue is still elusive. I did the same steps as earlier and the warning no longer shows up. It seems like it triggers for the first validation of some files, but not again.

khider commented 7 years ago

Got the warning again. Screenshot and file attached screen shot 2017-06-19 at 4 41 49 pm GeoB1023-5.Kim.2002.xlsx

chrismheiser commented 7 years ago

I found what may be the issue. It's a sneaky one. I'll note the reasoning to make it known here in the issue tracker.

The process of converting an excel file into a LiPD file is:

  1. Parse and convert the excel data
  2. Write a LiPD file (using "manual" steps in the excel_main.py, NOT writeLipd()... )
  3. readLipd() - Read the LiPD file back into the workspace. (to gain the benefits of inferred calculations, structure updates, etc)

<< User validates file before TSids are added in step 4 >>

  1. writeLipd() - This is where TSids are created and stored in the LiPD file

The issue is between steps 3 and 4. The reason the bug only happens on the first validation is because that's the only time that the LiPD data in the workspace differs from the LiPD data in the file that's saved. The workspace data does not have TSids, while the file saved to the computer does have Tsids. If you were to restart the Python console and load in that LiPD file again, that would be the file that had TSids, and you wouldn't get the validation warning again.