Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow path_like specification for filenames in batch submissions #2148

Open
gvnwst opened this issue Jan 8, 2025 · 1 comment
Open

Allow path_like specification for filenames in batch submissions #2148

gvnwst opened this issue Jan 8, 2025 · 1 comment
Assignees

Comments

@gvnwst
Copy link

gvnwst commented Jan 8, 2025

Currently, batch submissions for modesolver (and likely FDTD) require that the path used to specify download location is given as a string. At some point in the chain, <filename>.lower() is used, which causes failing errors when the supplied filename is not a string.

To improve robustness and allow more streamlined checks for things like extensions, validity of file location, etc, it would be nice to allow path-like objects to be specified (pathlib's Path?). I typically have a data directory where simulation files are stored, separate from where my script files are located/run.

My current solution is to generate the filename and do all my checks on a Path object, then convert to string before passing to the run commands.

The functions I'm referring to for modesolver and fdtd:

def run_batch(

def run(self, path: str = DEFAULT_DATA_PATH) -> SimulationDataType:

@yaugenst-flex
Copy link
Collaborator

Yes this is a good idea, we're tracking this internally already for better path handling in general.

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

No branches or pull requests

3 participants