-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Add meta properties for application specific console paths #165
Conversation
I tried the following: from pathlib import Path
from geolib import DStabilityModel
_path_stix = Path(r"C:\Users\hauth\.....\abc.stix")
model = DStabilityModel()
model.serialize(_path_stix)
print(model.custom_console_path) # returns None
model.custom_console_path = r"C:\Program Files (x86)\Deltares\D-GEO Suite\D-Stability 2024.01\bin" # Value error It returns the error below. How can i manually set the console path? Traceback (most recent call last): |
@MatthiasHauthDeltares The custom_console_path is an evaluated property so cannot be set directly, the value is retrieved from the meta properties (or from the geolib.env file) DSTABILITY_CONSOLE_PATH. Can you try setting that one? |
I don't quite get how you set a meta property. I only see a method |
@MatthiasHauthDeltares Oops, the docs incorrectly specified there would be a meta property available on the model objects, I've added a set_meta_property for your convenience now: from pathlib import Path dm = DStabilityModel() Though note that meta properties are defined globally in your runtime and not per model, which is a bit ugly, so setting it on a model will change it for all models in your script |
# Conflicts: # geolib/models/dsettlement/dsettlement_model.py
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
This PR closes #149 |
This PR closes #164 |
This pr will allow the user to set env properties for console paths per application, overriding the default search paths of CONSOLE_FOLDER.
Setting for example DSTABILITY_CONSOLE_FOLDER to "C:\Program Files (x86)\Deltares\D-GEO Suite\D-Stability 2023.01\bin\D-Stability Console.exe" will let GEOLib use the system installed version of D-Stability without requiring a local copy in the CONSOLE_FOLDER