sphuber / aiida-shell

AiiDA plugin that makes running shell commands easy.
MIT License
14 stars 7 forks source link

Output filenames starting with numbers cause an exception since they are not valid Python identifiers #92

Closed sphuber closed 6 months ago

sphuber commented 6 months ago

As reported in: https://github.com/sphuber/aiida-shell/pull/10#issuecomment-2107370882

sphuber commented 6 months ago

Thanks for reporting @bilke Is there a reason why you chose to replace the numbers with a particular prefix? If you are removing the numbers, why not just simply remove them, there is no real reason for a prefix, is there?

That being said, I think we actually should use a prefix but then also keep the leading numbers. If we remove the numbers, we could run into a situation where the files are no longer unique and we get clashes. For example, if the output files are 1file.txt and 2file.txt, if we replace the numbers with the prefix they would both become prefix_file.txt, which would be a problem.

bilke commented 6 months ago

Yes in my use case I have some hash as the filename and therefore would like to keep the leading number.