-
Notifications
You must be signed in to change notification settings - Fork 4
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
Empty path gets upgraded to pathlib.Path(".")
by FMModel
#703
Comments
Investigation by @tim-vd-aardweg: class CustomPath:
def __init__(self, path_str):
self.path_str = path_str
if path_str and path_str != '.':
self.path = Path(path_str)
elif path_str == '.':
self.path = Path('.')
else:
self.path = None # Represents an empty path
def __str__(self):
return self.path_str En daar moeten dan weer allemaal validators voor gemaakt worden voor pydantic en natuurlijk testjes toegevoegd worden. |
Describe the bug
When initializing an FMModel with empty paths (
""
), these are upgraded topathlib.Path(".")
, which results in a.
in the mdu file instead of an empty value.To Reproduce
The following code fails with
AssertionError
sincemdu.output.outputdir=WindowsPath(".")
. When generating a mdu file from scratch (mdu_clean
), the value is according to expectations.Related issues:
-999
: feat: Don't write keywords with None values #663.
: Don't write keywords with a None value to the files #661 (comment)Expected behavior
mdu.output.outputdir
to be an emtpy string (""
)Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: