You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When generating a dummy ext file like so:
importosimporthydrolib.core.dflowfmashcdfm# inputmodel_name='abc'dir_base=r'P:\archivedprojects\11209231-003-bes-modellering\hydrodynamica\hackathon\preprocessing\ModelBuilderOutput_JV2\Bonaire.pli'dir_output=os.path.expanduser(r"~\Downloads\test_pdrive_bug")
path_style='unix'# windows / unix, making relative paths only works when path_style is equal to os# make dirsos.makedirs(dir_output, exist_ok=True)
file_pli=os.path.join(dir_base, 'Maracaibo_bnd.pli')
ext_new=hcdfm.ExtModel()
ForcingModel_object=hcdfm.ForcingModel()
file_bc=os.path.join(dir_output, f'{model_name}.bc')
ForcingModel_object.save(filepath=file_bc)
# generate hydrolib-core Boundary object to be appended to the ext fileboundary_object=hcdfm.Boundary(quantity='waterlevelbnd', #the FM quantity for tide is also waterlevelbndlocationfile=file_pli,
forcingfile=ForcingModel_object)
ext_new.boundary.append(boundary_object)
#save new ext fileext_file_new=os.path.join(dir_output, f'{model_name}_new.ext')
ext_new.save(filepath=ext_file_new,path_style=path_style)
This is a bit inconvenient since the P drive does not exist on unix, it is lowercase p instead. Of course, the C-path will also not be found on unix, but this can be ignored since it is just a dummy for this testcase.
Describe the solution you'd like
Do uppercase drive letters exist in unix at all? If not, we might make them lowercase automatically. However, I realize the entire path is case-sensitive in unix, so it has to also be provided case-sensitive. It seems it is possible to convert these automatically, but it might be cumbersome to implement. Furthermore, it does not correct the drive letter.
Describe alternatives you've considered
Alternatively, the user would supply the correctly-cased path, which of course is error-prone.
The text was updated successfully, but these errors were encountered:
veenstrajelmer
changed the title
Lowercase drive letters in case of path_style="unix"
Construct correctly-cased path in case of path_style="unix"Aug 21, 2024
Is your feature request related to a problem? Please describe.
When generating a dummy ext file like so:
This results in an ext file with:
This is a bit inconvenient since the
P
drive does not exist on unix, it is lowercasep
instead. Of course, the C-path will also not be found on unix, but this can be ignored since it is just a dummy for this testcase.Describe the solution you'd like
Do uppercase drive letters exist in unix at all? If not, we might make them lowercase automatically. However, I realize the entire path is case-sensitive in unix, so it has to also be provided case-sensitive. It seems it is possible to convert these automatically, but it might be cumbersome to implement. Furthermore, it does not correct the drive letter.
Describe alternatives you've considered
Alternatively, the user would supply the correctly-cased path, which of course is error-prone.
The text was updated successfully, but these errors were encountered: