plan-be / plan-be/iode

PYIODE: support Path objects for filepath argument everywhere

Open
#555 1 comment 0 reactions 2 assignees View on GitHub

@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 like filename/filepath: Union[str, Path])
  • update the accepted types for filename/filepath in 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/filepath is either str or Path (isisinstance(filename/filepath, (str, Path))
  • if filename/filepath is 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.