NREL / rplexos

Other
18 stars 13 forks source link

Processing solution fails with other xml files present in the zipped solution #52

Closed jessemphillips closed 7 years ago

jessemphillips commented 7 years ago

For example, if binding contingencies diagnostics is also output as part of the solution, there will be another xml file in addition to the model solution. Processing the solution will produce an error like the following:

process_folder("name") Error: Error reading XML file into memory

The error occurs at line 32 of process_solution.R where grep("^Model.*xml$", zip.content$Name) returns the first chronological xml file (e.g. Model ( example ) BindingContingencies Diagnostics.xml). I suggest modifying the line 32 search to grep("^Model.*Solution.xml$", zip.content$Name) to ensure process_solution.R picks up the intended solution file instead of any diagnostic files that may be present.

danielsjf commented 7 years ago

@jessemphillips I checked one of our solutions with diagnostic files and I didn't get this error. The grep command is referring to the contents of the zip, not the contents of the solution. As far as I can see, the diagnostic files only exist in the folder and not in the zip. Therefore, they shouldn't cause the problem.

Could you give me a list of the filenames inside your solution file?

jessemphillips commented 7 years ago

Here is a screenshot of the contents of an example zip pulled from Connect. image

In here, the binding contingencies xml is placed inside the zip along with the solution xml. The grep command runs into an issue where it catches the binding contingencies xml first and the read-in fails due to the unexpected format of that file.