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

allow passing scalar numbers #58

Closed
mathause opened this issue May 23, 2023 · 3 comments · Fixed by #72
Closed

allow passing scalar numbers #58

mathause opened this issue May 23, 2023 · 3 comments · Fixed by #72

Comments

@mathause
Copy link
Collaborator

The following currently throws an error (TypeError: 'int' object is not iterable):

import filefinder
ff = filefinder.FileFinder("", "{num}", test_paths=["1", "2"])
ff.find_files(num=1)

the workaround is:

ff.find_files(num=[1])
@mathause
Copy link
Collaborator Author

I do wonder why this works for strings - it should not iterate the individual letters?

@mathause
Copy link
Collaborator Author

@mathause
Copy link
Collaborator Author

mathause commented Sep 29, 2023

Maybe:

if isinstance(value, str) or np.ndim(value) == 0:
    ...

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

Successfully merging a pull request may close this issue.

1 participant