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

Jupyter integration: UI components for data discovery #170

Merged
merged 14 commits into from
Jan 29, 2021
Merged

Conversation

m-mohr
Copy link
Member

@m-mohr m-mohr commented Jan 20, 2021

This is the PR to show beautiful UI elements in Jupyter environments. (marketing mode off)

Currently, it supports Capabilties, Collections, Processes, File Formats, Service Types and UDF Runtimes. I'll likely try to implement Logs (GET .../logs) next.

This is still a bit experimental because I've re-implemented the technical basis to hopefully avoid issues between React and Vue, but has another issue out of my scope.

I'd appreciate a review from you guys as my Python programming skilly is still beginner-level. Please let me know anything that you think would be worth changing. Why does the build fail? I can't access your Jenkins...

Example:
image

@m-mohr m-mohr self-assigned this Jan 20, 2021
@jdries
Copy link
Collaborator

jdries commented Jan 21, 2021

The code itself looks fine. I'll have a look at failing tests.

@jdries
Copy link
Collaborator

jdries commented Jan 21, 2021

@m-mohr the problem seems to be that some methods return a List[dict], not a dict, for instance: list_processes, list_collections
So maybe this is a matter of creating also a VisualList?

@m-mohr
Copy link
Member Author

m-mohr commented Jan 21, 2021

@jdries I've added a VisualList. Multi inheritance doesn't seem to be the best entry point for a Python noob, but it seems to work in Jupyter... ;-)

Is there a way to run the tests locally? I couldn't find details in the docs.

@soxofaan
Copy link
Member

Is there a way to run the tests locally? I couldn't find details in the docs.

to run the test you need the dev dependencies (from https://github.com/Open-EO/openeo-python-client/blob/master/.travis.yml):

pip install .[dev]  --extra-index-url https://artifactory.vgt.vito.be/api/pypi/python-openeo/simple

and then you should be able to run the test suite with:

pytest

We indeed should document this somewhere better

@m-mohr m-mohr mentioned this pull request Jan 21, 2021
@m-mohr
Copy link
Member Author

m-mohr commented Jan 21, 2021

@soxofaan Thanks. Tests succeed now and I've created an issue to document the test procedure. So from my side this can be reviewed and merged.

We'll likely need to update the script URL again in some days/weeks, but that's only until we left beta/rc version numbers in vue-components again.

openeo/internal/jupyter.py Outdated Show resolved Hide resolved
openeo/internal/jupyter.py Outdated Show resolved Hide resolved
openeo/internal/jupyter.py Outdated Show resolved Hide resolved
openeo/internal/jupyter.py Outdated Show resolved Hide resolved
openeo/rest/connection.py Outdated Show resolved Hide resolved
openeo/internal/jupyter.py Outdated Show resolved Hide resolved
openeo/internal/jupyter.py Outdated Show resolved Hide resolved
@m-mohr
Copy link
Member Author

m-mohr commented Jan 21, 2021

but has another issue out of my scope.

I've implemented a workaround. This should be ready to go (but it seems TravisCI is acting up - I guess we need to migrate openEO CI at some point to GH Actions...)

# These classes are proxies to visualize openEO responses nicely in Jupyter
# To show the actual list or dict in Jupyter, use repr() or print()

SCRIPT_URL = 'https://cdn.jsdelivr.net/npm/@openeo/vue-components@2.0.0-rc.1/assets/openeo.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a todo note here

 TODO: get this script url dynamically e.g. from a https://editor.openeo.org/ quert or from a local config file, with hardcoded fallback?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. We could add it to a config file, but we can't and shouldn't get it through other means dynamically. The implementation is bound to the specific version and once we have a stable version 2.0.0 (in one or two weeks) it will be SCRIPT_URL = 'https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.js', which will cover always the latest version of the 2.x branch and then we won't change it any time soon again as 3.x would be breaking anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep this PR open until we have a 2.0.0 release.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or merge now? This will not be released immediately anyway, but it will make it available to other people testing on master?

Copy link
Member Author

@m-mohr m-mohr Jan 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdries Sure, I'm fine with that. Just released another RC for vue-components so that all recent changes are in. Feel free to merge at any time.

Copy link
Member Author

@m-mohr m-mohr Jan 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not be released immediately anyway

@jdries But four hours later 😂 👍

openeo/metadata.py Outdated Show resolved Hide resolved
@jdries jdries merged commit 6d04be4 into master Jan 29, 2021
@m-mohr m-mohr deleted the vue-components branch January 29, 2021 12:26
@m-mohr m-mohr linked an issue Jun 16, 2021 that may be closed by this pull request
11 tasks
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

Successfully merging this pull request may close these issues.

Further Jupyter integration
3 participants