Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in use of stage_index in geolib\models\dstability\internal.py #148

Open
sweco-nlwkam opened this issue Sep 14, 2023 · 0 comments

Comments

@sweco-nlwkam
Copy link

I have found an issue when adding consolidations to soil layers in D-Stability using the function add_soil_layer_consolidations(). The error that I get is No soil layer loads found for scenario 1 stage 0.

I think the issue originates in the function has_soil_layer() in geolib\models\dstability\internal.py on line 2312. This function expects the stage_index to be the index of the list of all stages, while the stage_index that is passed is the index of the list of stages in the scenario.

To fix the issue, I think a conversion of the stage_index is needed. I managed to get the adding of the consolidation values to work by adding the following line of code in geolib\models\dstability\internal.py on line 2316:
stage_index = sum([len(scenario.Stages) for scenario in self.scenarios[:scenario_index]]) + stage_index
I am not sure to what extend this impacts other parts of geolib.

Can this be fixed in the next version? I am currently using d-geolib version 1.3.1

@sweco-nlwkam sweco-nlwkam changed the title Inconsistency in use of stage_index in dstability_model.py Inconsistency in use of stage_index in geolib\models\dstability\internal.py Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants