Skip to content
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

Better promotion of correctly exporting a DataCube (or related) to valid JSON process representation #324

Closed
soxofaan opened this issue Aug 11, 2022 · 3 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Aug 11, 2022

Related to, triggered by: #155, #209, Open-EO/openeo-web-editor#271

When users are asked to share a process graph they should use DataCube.to_json instead of DataCube.flat_graph, DataCube.flatten or DataCube.graph:

  • the shared structure should have a toplevel {"process_graph": ...}
  • it should be serialized as valid JSON (double quotes, booleans true/false), not python dict representation (single quotes by default, booleans True/False)

Possible action points:

  • improve documentation: better promote correct way, more strongly discourage the wrong ways
  • is it possible to trigger warnings when normal users use the "flat_graph" methods (which are still used internally)?
@soxofaan
Copy link
Member Author

Another idea: also add DataCube.print_json, which might be a more user friendly solution in a notebook context than DataCube.to_json (which requires an additional print call to make the result usable)

soxofaan added a commit that referenced this issue Aug 12, 2022
…stronger for general use

Also add `to_json`/`print_json` usage docs
@soxofaan
Copy link
Member Author

@soxofaan
Copy link
Member Author

Will close this for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant