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

Remove DataID attribute access #2396

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented Feb 20, 2023

Remove the __getattr__ implementation on DataID, that was implementing a deprecated way to access information from DataID objects. From now on, only key access is possible.

When a key attribute access is absent for a dataid, raise the correct
type of AttributeError.

Fixes pytroll#2395.
@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Merging #2396 (1a785e5) into main (5f2e3a1) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2396      +/-   ##
==========================================
+ Coverage   94.71%   94.73%   +0.02%     
==========================================
  Files         329      329              
  Lines       48739    48733       -6     
==========================================
+ Hits        46161    46166       +5     
+ Misses       2578     2567      -11     
Flag Coverage Δ
behaviourtests 4.41% <0.00%> (+<0.01%) ⬆️
unittests 95.36% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/dataset/dataid.py 95.39% <ø> (+0.16%) ⬆️
satpy/readers/abi_l2_nc.py 96.00% <100.00%> (ø)
satpy/readers/fci_l2_nc.py 99.45% <100.00%> (ø)
satpy/readers/seviri_l2_grib.py 92.47% <100.00%> (ø)
satpy/tests/test_dataset.py 100.00% <100.00%> (ø)
satpy/tests/test_dependency_tree.py 98.24% <100.00%> (ø)
satpy/writers/cf_writer.py 95.16% <0.00%> (ø)
satpy/resample.py 79.96% <0.00%> (+0.65%) ⬆️
satpy/_compat.py 69.38% <0.00%> (+4.08%) ⬆️
satpy/_config.py 95.55% <0.00%> (+4.44%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

coveralls commented Feb 20, 2023

Coverage Status

Coverage: 95.321% (+0.001%) from 95.319% when pulling 1a785e5 on gerritholl:did-attributeerror into 5f2e3a1 on pytroll:main.

satpy/dataset/dataid.py Outdated Show resolved Hide resolved
Remove the deprecated ability to access dataids by attribute.  Now only
key access is supported.
@gerritholl gerritholl changed the title Raise correct type of AttributeError for missing key Remove datait attribute access Mar 3, 2023
@gerritholl gerritholl changed the title Remove datait attribute access Remove DataID attribute access Mar 3, 2023
@mraspaud mraspaud added the enhancement code enhancements, features, improvements label Mar 6, 2023
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM!

@mraspaud mraspaud added this to the v0.41.0 milestone Mar 6, 2023
@mraspaud mraspaud merged commit b045d84 into pytroll:main Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataID.__getattr__ calls nonexisting method on parent class
5 participants