-
Notifications
You must be signed in to change notification settings - Fork 395
Open
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityHandle this with default priorityT: MaintenanceWork to keep up the quality of the code and documentation.Work to keep up the quality of the code and documentation.
Description
#2920 introduced the stringify_path function in order to support os.PathLike objects, such as pathlib.Path, to be passed as filenames:
nest-simulator/pynest/nest/lib/hl_api_helper.py
Lines 151 to 173 in 0d9715d
| def stringify_path(filepath): | |
| """ | |
| Convert path-like object to string form. | |
| Attempt to convert path-like object to a string by coercing objects | |
| supporting the fspath protocol to its ``__fspath__`` method. Anything that | |
| is not path-like, which includes bytes and strings, is passed through | |
| unchanged. | |
| Parameters | |
| ---------- | |
| filepath : object | |
| Object representing file system path. | |
| Returns | |
| ------- | |
| filepath : str | |
| Stringified filepath. | |
| """ | |
| if isinstance(filepath, os.PathLike): | |
| filepath = filepath.__fspath__() # should return str or bytes object | |
| return filepath |
This function is only necessary because of the SLI layer between PyNEST and the NEST kernel, and should be removed once NEST is free of SLI.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityHandle this with default priorityT: MaintenanceWork to keep up the quality of the code and documentation.Work to keep up the quality of the code and documentation.
Type
Projects
Status
To do