-
Notifications
You must be signed in to change notification settings - Fork 42
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
CollectionMetadata -> CubeMetadata? #464
Comments
I think we should change it to:
By making |
ok, makes sense! |
Another reason for better abstraction: |
issue #464 moved general methods from CollectionMetadata to CubeMetadata only collection parsing specific methods are left in CollectionMetadata This only has a refactoring effect, no functional changes for now
openeo-python-client/openeo/metadata.py Lines 231 to 242 in 498c4c7
Currently functionality does not change due to this function. As this function checks the type and returns an object of the same class, functions like reduce_dimension (who use this function to update a metadata object) will still return a CollectionMetadata object if that was the original object.
Changing this to return a CubeMetadata changes functionality and fails some existing tests. An alternative is to provide an optional argument to set the expected returned class, however this feels more like a quick fix and might be confusing in the future. |
openeo-python-client/openeo/metadata.py
Lines 198 to 200 in cbd4053
"CollectionMetadata" got its name when data cubes where still called "ImageCollection" (instead of "DataCube"). But now that is getting a bit confusing: in openEO, "collections" is the source data one loads with
load_collection
, while "cubes" are the intermediate data structure one works with. So "CollectionMetadata" should better be called "CubeMetadata".Also, CollectionMetadata contains some specific dimension metadata parsing logic (cube:dimensions/eo:bands), which is closely tied to the STAC description of collections. I think it would be better to separate this from the essential cube metadata logic.
The text was updated successfully, but these errors were encountered: