Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Avoid redundancy in Workflow JSON #283

Closed
forman opened this issue Jul 6, 2017 · 2 comments
Closed

Avoid redundancy in Workflow JSON #283

forman opened this issue Jul 6, 2017 · 2 comments
Assignees
Milestone

Comments

@forman
Copy link
Member

forman commented Jul 6, 2017

Expected behavior

When serializing a workflow to JSON, Cate should not generate input entries for operations steps whose input values are either not given or are equal to the operation input's default value.

Actual behavior

Input entries are always generated for every input. For example a step that invokes read_netcdf with just the file input will look like::

            {
                "id": "p",
                "op": "cate.ops.io.read_netcdf",
                "input": {
                    "file": {
                        "value": "this/is/the/path/to/my/file"
                    },
                    "drop_variables": {},
                    "decode_cf": {},
                    "normalize": {},
                    "decode_times": {},
                    "engine": {}
                },
                "output": {
                    "return": {}
                }
            },

This forces incompatibilities if an operation's input name or type changes in the future. For example, I just renamed the harmonize input into normalize for operation open_dataset`. Now all "old" workspaces don't work anymore.

Steps to reproduce the problem

  1. Create a workspace
  2. Add some step with multiple defaults, e.g. read_netcdf
  3. Save workspace myspace
  4. Inspect myspace/.cate-workspace/workflow.json

Specifications

Cate 0.9.0dev3

@forman
Copy link
Member Author

forman commented Jul 7, 2017

When Save Workspace is called from GUI, source inputs now erased in JSON. Workspace is corrupted and cannot be reopened.

@forman
Copy link
Member Author

forman commented Jul 7, 2017

Should also drop ".return" prefix of source values.

@forman forman closed this as completed in f2cb456 Jul 7, 2017
forman added a commit to CCI-Tools/cate-desktop that referenced this issue Jul 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant