DeDop / dedop-core

DeDop is a User Configurable Tool for Processing Delay Doppler Altimeter Data.
http://dedop.org/
GNU General Public License v3.0
13 stars 8 forks source link

User unable to process because the configurations have changed in the new installer #9

Closed hans-permana closed 6 years ago

hans-permana commented 7 years ago

This is a follow-up ticket from an issue reported by @cmray https://github.com/DeDop/dedop-core/issues/8

Scenario

Problem

A string of errors are thrown by DeDop Shell that say unknown parameters. Look at this (issue)[https://github.com/DeDop/dedop-core/issues/8] for more details on the error.

This problem occurred because there are parameter changes in the default configuration files of v0.5.2 and the processor does not support the old parameters anymore (from v0.5.1 or before). When a user installs a new version (with or without uninstalling the old one), the ~/.dedop directory stays unless when it is intentionally removed.

forman commented 7 years ago

To each of the three default configurations add an element __metainf__ as follows:

{
    "__metainf__": {
        "version": 1,
        "description": "<file description here>",
        "changelog": [
            {
                "version": 0, 
                 "parameters": [
                       ["param1", "*", "Is now of type Boolean"], 
                       ["param2", "+", "New parameter due to geo-location algorithm change"],
                       ["param3", "-", "Removed parameter due to geo-location algorithm change"]
                 ], 
                 "comment": "Introduced new geo-location algorithm"
            }
        ]
    },
    ...
}

The changelog entries are 3-element lists of the form [version: int*, params: List[Param], comment: str], with Param being a 3-element list [name: str, change: str, comment: str] where change can be +, -, or *(= modified). We need the Param entries to update old configuration files to new ones.

If we detect an old configuration in version v1 and the current version is v2 then we create the set of all parameter changes of all changelog entries for which it is true that v1 < version <= v2 and apply the changes to the old configuration.

mark-ep commented 7 years ago

I've added the __metinf__ block to the auxiliary files, and running dedop run with outdated files will now throw an error directing users to the dedop config upgrade command.