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
29 stars 9 forks source link

collapseTs omitting some data #44

Closed chrismheiser closed 5 years ago

chrismheiser commented 5 years ago

Issue submitted by Jessica via e-mail.

If I take a folder containing 2 lipd files, extract the time series (ts_list), and collapse the time series, then the new lipd files (two of them again) have lost some of the header information. This happens even when I don't add a new time series to ts_list. (Side note: when I do add a new time series to ts_list it does show up in the new lipd file after I use collapseTs.) Thus, it looks to me like collapseTs does not perfectly reverse the process of extractTs because header information is lost in one or both of these transformations. If this is intentional, then I'll need to add header information back into the new lipd files by grabbing it from the old lipd files. Let me know if this doesn't make sense and I'll use code to show you what I mean.

Tested it out and I was able to reproduce it as shown below. The following keys do not get collapsed properly: studyName, proxy, investigator, description. This may be true for other keys, but this is all that showed in this test.

screen shot 2018-10-23 at 2 53 03 pm