Skip to content
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

Cannot use Pathlike objects with from_file #204

Open
cjosey opened this issue Jun 26, 2024 · 1 comment
Open

Cannot use Pathlike objects with from_file #204

cjosey opened this issue Jun 26, 2024 · 1 comment

Comments

@cjosey
Copy link

cjosey commented Jun 26, 2024

The supported arguments to from_file and related is str. Passing a pathlib Path results in:

Traceback (most recent call last):
  File "[path]/process.py", line 8, in <module>
    tape = ENDFtk.tree.Tape.from_file(p)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: from_file(): incompatible function arguments. The following argument types are supported:
    1. (filename: str) -> ENDFtk.tree.Tape

Invoked with: PosixPath('[filename]')

Converting to str works just fine. I have no idea if it is possible to make this more user-friendly with the PyBind11 stuff.

@whaeck
Copy link
Member

whaeck commented Jun 26, 2024

Might be worthy of some investigation, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants