Hi all,
I am also bumping into a similar issue. Has one of you found a solution yet?
I feel like I almost got it but there is an error I didn’t understand.
In my controller I have the following code:
def see_how_stix_works_here_in_viktor(self, params, **kwargs):
stix_file = params.stix_file_input #FileResource
# https://docs.viktor.ai/docs/guides/integrations/geolib/
temp_file = NamedTemporaryFile(suffix='.stix', delete=False,
mode='wb')
temp_file.write(stix_file.file.getvalue_binary())
temp_file.close()
path = Path(temp_file.name)
parsed_file = DStabilityModel().parse(path)
os.remove(temp_file.name)
print(parsed_file)
return parsed_file
This resulted in parsed_file = None
However, if I change
parsed_file = DStabilityModel().parse(path)
into
parsed_file = DStabilityModel()
parsed_file.parse(path)
print(parsed_file)
I can see the DStability-data, something like
filename=WindowsPath(‘…/AppData/Local/Temp/tmp2v2_z79z.stix’) datastructure=DStabilityStructure(waternets=[Waternet(Id=‘161’, ContentVersion=‘1’, PhreaticLineId=‘162’, HeadLines=[PersistableHeadLine(Id=‘162’, Label=‘PL1’, Notes=‘’, Points=[PersistablePoint(X=-95.0, Z=1.455), …
To me, this looks quite good. However, this outputis followed by an error, which is this: (this is the part I don’t understand anymore)
2022-06-30 11:56:46.640 ERROR : Exception is raised
Traceback (most recent call last):
File "viktor_connector\connector.pyx", line 400, in connector.Job.execute
File "viktor\core.pyx", line 1799, in viktor.core._handle_job
File "viktor\core.pyx", line 1783, in viktor.core._handle_job.non_view_result
AttributeError: 'DStabilityModel' object has no attribute '_serialize
What would be a solution to solve this error? Your help is very much appreciated btw, I am using GeoLib 0.1.6 and DStability 2020.03