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

[FEAT] Re-defining a collection object is not possible #553

Open
mlubej opened this issue Nov 28, 2024 · 2 comments
Open

[FEAT] Re-defining a collection object is not possible #553

mlubej opened this issue Nov 28, 2024 · 2 comments

Comments

@mlubej
Copy link
Contributor

mlubej commented Nov 28, 2024

What is the problem? Please describe.

Once the SH collection, such a byoc collection, is defined, it cannot be redefined, this can be annoying, and I was wondering if there are special reasons for this

E.g.

import numpy as np
from sentinelhub import Band, DataCollection

col = DataCollection.define_byoc('some-byoc-id')

If I later decide to define also bands and do

# update the collection
col = DataCollection.define_byoc('some-byoc-id', bands = [Band(name='B01', units=('DN'), output_types=(np.int16))])

This fails with

ValueError: Data collection name `BYOC_some-byoc-id` is already taken by another data collection

While it could just drop the old definition and redefine it with the bands. Or perhaps give some warning or something. Right now we have to restart the notebook kernel, which is annoying.

@zigaLuksic
Copy link
Collaborator

The issue is that we never know which collection is already online, and in those cases you really cannot and should not redefine it.

@mlubej
Copy link
Contributor Author

mlubej commented Nov 28, 2024

The issue is that we never know which collection is already online, and in those cases you really cannot and should not redefine it.

But the official collections are already pre-defined and on collection definition a new collection is checked against existing ones, and then the new one is added. What if we never extend the enum, but always just check against the "official" ones?

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

No branches or pull requests

2 participants