PYIODE: support Path objects for filepath argument everywhere
Open
@yvdabb is already working on this.
Since May 24, 2024.
difficulty: low
enhancement
good first issue
python
- Dominant language
- C++
- Stars
- 2
- Forks
- 1
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 13
Description
@yvdabb You may want to work on this. First:
- import Path from pathlib in the main file
iode_python.pyx
Then, in every method/functions having a filename or a filepath argument in pyiode, you have to do:
- update the type hints of the argument
filename/filepath(something likefilename/filepath: Union[str, Path]) - update the accepted types for
filename/filepathin the list of Parameters in the function/method documentation (filename/filepath: str or Path) - in the body of the function/method, check that the type of the passed value for
filename/filepathis either str or Path (isisinstance(filename/filepath, (str, Path)) - if
filename/filepathis of type PATH (isinstance(filename/filepath, Path):), convert it to an absolute path as string (I think the method is 'resolve()') -> check documentation of pathlib - check if the file exist ->
if not file.exists(): raise ValueError(...)
See for example Variables.low_to_high() and Variables.high_to_low() methods
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.