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

Encapsulate "driver implementation" functions #8

Closed
soxofaan opened this issue Jul 16, 2019 · 1 comment
Closed

Encapsulate "driver implementation" functions #8

soxofaan opened this issue Jul 16, 2019 · 1 comment

Comments

@soxofaan
Copy link
Member

openeo-python-driver allows a plugable "DRIVER_IMPLEMENTATION_PACKAGE", but does this quite rudimentary at the moment. E.g:

i = importlib.import_module(os.getenv('DRIVER_IMPLEMENTATION_PACKAGE', "dummy_impl"))
getImageCollection = i.getImageCollection
get_layers = i.get_layers
try:
    create_process_visitor = i.create_process_visitor
except AttributeError as e:
    create_process_visitor = None
create_batch_job = i.create_batch_job
run_batch_job = i.run_batch_job
get_batch_job_info = i.get_batch_job_info
get_batch_job_result_filenames = i.get_batch_job_result_filenames

( https://github.com/Open-EO/openeo-python-driver/blob/314023137/openeo_driver/ProcessGraphDeserializer.py#L67 )

This approach of copy-pasting toplevel functions scales quite ugly and ruins code intelligence in your editor/IDE.

It would be cleaner to encapsulate this intermediate "API" e.g. as (abstract) classes that backends have to implement. This is more explicit API-wise, more self documenting and allows your IDE to be more helpful.

soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Jul 17, 2019
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Sep 17, 2019
… class

- add `CollectionCatalog`: a basic catalog implementation to manage collection metadata and entrypoint for the `load_collection` process
- replaces `get_layer`, `get_layers` and `getImageCollection` globals
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Sep 18, 2019
… class

- add `CollectionCatalog`: a basic catalog implementation to manage collection metadata and entrypoint for the `load_collection` process
- replaces `get_layer`, `get_layers` and `getImageCollection` globals
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Sep 18, 2019
soxofaan added a commit to soxofaan/openeo-geopyspark-driver that referenced this issue Sep 18, 2019
jdries added a commit that referenced this issue Sep 18, 2019
Extract better decoupled layer catalog (EP-3079/#8)
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Nov 19, 2019
soxofaan added a commit to soxofaan/openeo-geopyspark-driver that referenced this issue Nov 19, 2019
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 16, 2020
…fy API compliance

Introduce a `BatchJobMetadata` class to wrap batch job metadata in a 
container with stronger schema/typing that a free form dict
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 16, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 16, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 17, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 17, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 17, 2020
bump minor level of version to signal substantial refactor
of "backend implementation" handling in openeo_driver (Open-EO#8, Open-EO#34, EP-3352)
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 17, 2020
- it's cleaner to have a single toplevel package
- also add script to run flask app with dummy backend
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 17, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
…fy API compliance

Introduce a `BatchJobMetadata` class to wrap batch job metadata in a
container with stronger schema/typing that a free form dict
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
bump minor level of version to signal substantial refactor
of "backend implementation" handling in openeo_driver (Open-EO#8, Open-EO#34, EP-3352)
soxofaan added a commit to soxofaan/openeo-python-driver that referenced this issue Apr 20, 2020
- it's cleaner to have a single toplevel package
- also add script to run flask app with dummy backend
@soxofaan
Copy link
Member Author

done (as part of #34)

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