-
Notifications
You must be signed in to change notification settings - Fork 7
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
Version numbering for files #96
Comments
Issue #46 is relevant here too. What I recommend is always saving the (hypothetical) version number of Potku for each file. When opening files (possibly in the future) it can be determined from the version number how to handle the file: version specific deserialization (good for small changes, difficult to maintain in the long term), falling back to defaults (when new features are added) or whether to warn or fail (compatibility is intentionally broken). The files can of course have their own version numbering, but this becomes only relevant if the files are used outside Potku. |
There should a way to save file compatibility information. Currently, there isn't a reliable way to tell which version of Potku was used to create/edit a request. This is problematic when there are backwards incompatible changes to file formats.
Types of files that are affected:
A simple solution would be to add a version field to files. It could use the date of the latest file format change for its value. The version field would then be checked whenever a file deserialized. If the version of the file doesn't match, the user can be warned about this with a proper message (e.g.
f"'.profile' settings file version '{file_format}' is not compatible with '{self.FILE_FORMAT}'."
).The text was updated successfully, but these errors were encountered: