-
Notifications
You must be signed in to change notification settings - Fork 4
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
ENHANCEMENT: Change default name of output files #41
Comments
If anyone is interested, I have made some progress on this a while ago; it is in branch 41_descriptive_output_file_names. |
Hi Rastislav, I committed an updated version of your algorithm for checking if an output file already exists or not. Basically, I replaced the for:else loop by a while. Indeed, I disliked the fact that the number of file tested was hardcoded (100) that in the else condition a random number was tested. Also the existence checking is now only made at the basename level because anyway at this level we can not know which format the user will select. If you are OK with this, I can create a PR. |
I used the for else loop to avoid the edge case where there is a huge number of already existing files (thousands or even more), but if you think that is so unlikely as to be of no concern, then replacing the for loop with a while loop is fine, and I guess However, the reason why I have not opened a PR yet is that I have been wondering if there was a way to make the output file names for trajectory conversion more relevant. I have been able to at least include the name of the converter in the file name, but that is not much more useful than the default path, |
I think that we can reasonably think that the case where thousands or even more already existing files occurs should not be a problem. So I would keep my code. |
Perhaps we could add a new button to trajectory converter windows which, when clicked, would generate a meaningful file name (either keeping the name of the inputted trajectory, or <old_name>_<converter_name>, e.g. NaF_castep) and place it into the same directory as the currently inputted trajectory. What do you think? |
Actually, a more elegant solution would be to change the output file name when user select a new input file using the browse button (i.e. when they hit submit in the opened window). |
no that easy, that means that the |
Well, if it is not possible to link the two widgets, no matter; I will take look to see if there is a way. I think there could be a way to add a new button and preserve the generality of generation if we changed the code such that whether the button appears or not would be configured through the |
I implemented in 303bbc5 a mechanism for guessing the output filename for the converters. It was quite tricky but I think I did it quite nicely. Please review carefully. |
You have found a way, thank you! I have opened a PR and added some comments, but overall, this is great! |
Currently, the default name of output files of all analysis is
output_<trajectory>
where is the name of the trajectory file. This default name is highly undescriptive, requiring to be changed every time an analysis is performed because if it is not, the file will simply get overwritten. A better name would be<trajectory>_<analysis>
where is an abbreviated name of the analysis performed. Even better, MDANSE could also check if the default file name already exists, and if it does, add (1) etc at the end to prevent overwriting.The text was updated successfully, but these errors were encountered: