loop project file update does not work
Trying to run proj.config.update_projectfile() using m2l2 does not work.
File ./..loop3d already exists File ./..loop3d already exists
ValueError Traceback (most recent call last)
~/map2loop/map2loop/config.py in update_projectfile(self) 982 self.output_path, 983 self.bbox_3d, --> 984 self.proj_crs) 985 986 print("PROJECTFILE FOUND AT", self.loop_projectfile)
~/map2loop/map2loop/m2l_export.py in export_to_projectfile(loopFilename, tmp_path, output_path, bbox, proj_crs) 1790 "faultLog", 1791 data=faultEvents, -> 1792 verbose=False) 1793 if resp["errorFlag"]: 1794 print(resp["errorString"])
/opt/conda/lib/python3.7/site-packages/LoopProjectFile/LoopProjectFile.py in Set(filename, element, **kwargs) 200 elif element == "stratigraphicLog": response = ExtractedInformation.SetStratigraphicLog(root, **kwargs) 201 elif element == "stratigraphicLogAppend": response = ExtractedInformation.SetStratigraphicLog(root, append=True, **kwargs) --> 202 elif element == "faultLog": response = ExtractedInformation.SetFaultLog(root, **kwargs) 203 elif element == "faultLogAppend": response = ExtractedInformation.SetFaultLog(root, append=True, **kwargs) 204 elif element == "foldLog": response = ExtractedInformation.SetFoldLog(root, **kwargs)
/opt/conda/lib/python3.7/site-packages/LoopProjectFile/ExtractedInformation.py in SetFaultLog(root, data, append, verbose) 106 107 def SetFaultLog(root, data, append=False, verbose=False): --> 108 return SetEventLog(root, data, 'faultEventIndex', 'faultEvents', append, verbose) 109 110 def SetFoldLog(root, data, append=False, verbose=False):
/opt/conda/lib/python3.7/site-packages/LoopProjectFile/ExtractedInformation.py in SetEventLog(root, data, indexName, variableName, append, verbose) 97 index = elGroup.dimensions[indexName].size 98 for i in data: ---> 99 eventLocation[index] = i 100 index += 1 101 else:
src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.setitem()
src/netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable._put()
ValueError: structures must have the same size
This problem happens when there is a mismatch in the version of an existing Loop project file with the version of the module current being used. Even when a mismatch occurs this exception only happens when an underlying structure has changed.
I am adding a check for version mismatching which will inform the user and abort. I will also add an optional overwrite parameter that will overwrite the file if the version is different.