-
Notifications
You must be signed in to change notification settings - Fork 303
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
Deprecate Scene.attrs property #1799
Comments
I totally agree. If the information isn't static, it should become a property. An empty dict for the user's metadata is a nice idea, too. |
Good idea with the seeing over this. I would try to mimic as much as possible the behaviour of |
Yes. I mention that in my last paragraph (I know, it is long). I'll try my best. |
Question: What should a Scene created from |
Nevermind, xarray keeps the attrs:
|
Next question, I kind of mention it in my original post, what should start_time/end_time/sensor_names be if there are no loaded datasets? Should it check with the readers or return None? If no readers, should it return |
This was technically closed back in #1797. |
Feature Request
Is your feature request related to a problem? Please describe.
I'm working on #1797 and I'm running into this annoyance where I'd like to get all the sensor names for the loaded datasets. Since there is already a
Scene.attrs["sensors"]
then I should just get it from that. However, this value is only set when the Scene is created. I propose deprecatingScene.attrs
as it is used right now (see below for details). It is not kept up to date and does not reflect the actual loaded data if there is any difference between the reader's metadata and the actual DataArray metadata.Currently the
.attrs
dictionary holds:sensor_names
property.Describe the solution you'd like
.attrs
..attrs
as an empty dictionary that users can add to (similar to xarray.Dataset), but does not change Satpy behavior at all and will only ever be used as extra metadata if it makes sense (ex. CF writer global attributes maybe?)..sensors
,.start_time
, and.end_time
properties on the Scene to get the equivalent metadata on-the-fly when it is requested. The values would be gathered by the loaded datasets and would not contact the reader's metadata at all.Describe any changes to existing user workflow
Are there any backwards compatibility concerns? Changes to the build process? Additional dependencies?
Additional context
Other options:
Scene.__getattr__
) that automatically generates the.attrs
metadata whenScene.attrs
is requested. Or make.attrs
a property (see mention of xarray below).__setitem__
,.load
,__delitem__
call.We have talked in other issues and meetings of making the
Scene
more like xarray's Dataset object. I think if this deprecation proposal is accepted that we avoid "magic" properties related to existing xarray interfaces like.attrs
(my point 2 above).The text was updated successfully, but these errors were encountered: