Hi Support,
The DFoundation version on my computer has been updated to version v21.1. An application using DFoundation shows an error since then. The application is able to perform a DFoundation analysis with DFoundationAnalysis from viktor.external.dfoundations but the parsing of the *.fod file with OutputFileParser from viktor.external.dfoundations gives the following error msg (I suspect it is because the OutputFileParser is not compatible with the v21 version, but how to solve it?):
File "/usr/src/app/app/applib/use_cases/fill_geotechnical_databases.py", line 302, in get_calculation_result_for_tension_piles
parser_results_for_interval = OutputFileParser(StringIO(fod_file_for_interval.getvalue().decode('UTF-8')))
File "viktor/external/dfoundations.pyx", line 2403, in viktor.external.dfoundations.OutputFileParser.__new__
' is not (yet) implemented for version 21.el type '1: Tension Piles (EC7-NL)
You are right, the output from our SDK does not currently support D-Foundations v21 (SDK Reference - D-Foundations | VIKTOR Documentation)
The quickest fix would probably be to keep a backup version of DFoundations v19 on your computer if possible, until the parser is updated for the latest versions.
Parsing the file yourself always remains an option but that could be quite time consuming.
Currently, they state that they support version 19.1 (Setup — geolib 0.1.6 documentation). Furthermore, they say that there might be small differences with newer versions of the D-series software, but because it is open-source you could probably adjust the code yourself if you run into errors.
Hi,
I have been trying to implement the GEOLib package into our applications. The generating of the input file and the calculation via the worker works fine. Also the output file seems correct. However I can’t get the file parser working. Here is the code I use:
File "/usr/src/app/app/applib/core_methods_and_classes/tension_piles_calculation.py", line 691, in geolibcalculation
parsed_file = df.parse(filename=path)
File "geolib/models/base_model.pyx", line 151, in geolib.models.base_model.BaseModel.parse
File "geolib/models/parsers.pyx", line 61, in geolib.models.parsers.BaseParserProvider.parse
File "geolib/models/dseries_parser.pyx", line 1146, in geolib.models.dseries_parser.DSerieParser.parse
File "geolib/models/dseries_parser.pyx", line 1147, in geolib.models.dseries_parser.DSerieParser.parse
File "geolib/models/dseries_parser.pyx", line 158, in geolib.models.dseries_parser.DSeriesStructure.parse_text
File "geolib/models/dseries_parser.pyx", line 98, in geolib.models.dseries_parser.DSeriesStructure.__init__
File "geolib/models/dseries_parser.pyx", line 158, in geolib.models.dseries_parser.DSeriesStructure.parse_text
File "geolib/models/dseries_parser.pyx", line 98, in geolib.models.dseries_parser.DSeriesStructure.__init__
File "geolib/models/dseries_parser.pyx", line 158, in geolib.models.dseries_parser.DSeriesStructure.parse_text
File "geolib/models/dseries_parser.pyx", line 75, in geolib.models.dseries_parser.DSeriesStructure.__init__
ValueError: Got more fields than defined on model DFoundationsInputStructure:
parser has {'user_classification_method'} fields and
model has set() fields not set.
it’s a bit of a guess because i cannot see where you create df or what it is, but the object you call .parse() on should be a GeoLib DFoundationsModel, try using:
parsed_file = DFoundationsModel().parse(path)
So it’s basically as if you are creating a new model, only based on an .fod so your newly created model will also have results
File "geolib/models/dseries_parser.pyx", line 158, in geolib.models.dseries_parser.DSeriesStructure.parse_text
File "geolib/models/dseries_parser.pyx", line 75, in geolib.models.dseries_parser.DSeriesStructure.__init__
ValueError: Got more fields than defined on model DFoundationsInputStructure:
parser has {'user_classification_method'} fields and
model has set() fields not set.
Seems a bit strange to me, this error seems to say: there are fields with values in this file that i do not know how to handle (the user_classification_method), but i think that’s weird because (probably) this is the same input you used to create a GeoLib DFoundationsModel with in the first place no?
Maybe we are missing something here, and there is another explanation, but it could be a bug in GeoLib? In any case, i think this is so specific to their package that it’s probably best to ask your question to them directly, you can do so on their github page: Issues · Deltares/GEOLib · GitHub
In the mean time, I’ll ask if anyone here has any suggestions and get back to you if we come up with something.
Good stuff, finding the issue and a workaround. Still seems a bit strange that there is a section in the .fod, which is based on a succesfully run .foi, that causes problems for the parser. I’ll follow your issue on the GeoLib gitlab with interest!