Open nasa-ddalle opened 1 year ago
Figured out that the issue was util.split_line()
not remembering which character opened the escaped string. So the '
at the end of "['hvanleer'
was closing the opening "
.
Should be fixed as of https://github.com/nasa/cape/commit/bfe4f556190e35f9b66f8acaa6a612294199d396
Here's my verification test:
>>> cape.util.split_line('"[\'hvanleer\', \'hvanleer\']"', ',', 1)
['"[\'hvanleer\', \'hvanleer\']"']
A little bit hard to read, but it would have been ['"[\'hvanleer\'', '\'hvanleer\']"']
before.
I think this version could still get tricked by the string "[\"hvanleer\", \"hvanleer\"]"
, so I'll add one more commit to fix that one.
Derek, everything seems to be working now. The only thing that's still amiss is that when running lineloads (pyfun --ll
) the top level databook/ll_<component_name>_line_loads.csv
files don't parse the lists/strings correctly. The actual line loads data inside databook/lineload/
look to be fine, however.
Another note: there is also an impact to databooks. On initial databook generation, all seems to be well. But if runs are appended to the databook, the column data no longer line up with the column titles.
@nasa-ddalle, has this been looked at or fixed for databooks?
Ok, I think this should finally be fixed. Patches applied to both main
and v1.1
branches.
Follow-on to #18
From @rbreslavsky:
One more comment on this. The databooks are all generated correctly now. However, when they are read back in (for carpet plots or other operations), lists of strings get split up into multiple parts. So for instance, if I have
"['hvanleer', 'hvanleer']"
in a cell, that gets split into two parts byutil.split_line()
.