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

Add more reader metadata like long_name and description #887

Merged
merged 4 commits into from
Aug 30, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Aug 27, 2019

I'm creating this as a proof of concept and to continue the discussion from #876 and on slack. The idea is to provide additional human-readable metadata for readers so that they could be documented with more detail, not only in Satpy's documentation but by other applications too. For example, a GUI application using Satpy may want to give the user the option of what reader to use or what readers are available. Having a human-readable name would look "prettier" than the underscored reader name.

This PR, so far, adds short_name, long_name, and description to abi_l1b. The description is formatted as restructuredtext so it could theoretically be pasted to a restructuredtext document for the sphinx docs.

Other options:

  • Remove short_name. I'm not 100% sure on this since it essentially provides a human readable version of the name.
  • Separate resources dictionary mapping "hyperlink text" to a URL. We had talked about doing this for composites so it would be consistent with that and easier to do than typing a ton of URLs in to sentences in the description; especially in rst. This could also mean that the description could stay a plain string which would be nice for usage.

Thoughts?

@coveralls
Copy link

coveralls commented Aug 27, 2019

Coverage Status

Coverage increased (+0.03%) to 84.642% when pulling 48d757e on djhoese:feature-reader-long-name into 5d98f28 on pytroll:master.

@codecov
Copy link

codecov bot commented Aug 27, 2019

Codecov Report

Merging #887 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
- Coverage   84.62%   84.61%   -0.01%     
==========================================
  Files         169      169              
  Lines       24996    24996              
==========================================
- Hits        21153    21151       -2     
- Misses       3843     3845       +2
Impacted Files Coverage Δ
satpy/readers/avhrr_l1b_gaclac.py 90.14% <0%> (-1.41%) ⬇️
satpy/scene.py 90.47% <0%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d98f28...5ca6a71. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Aug 27, 2019

Codecov Report

Merging #887 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
- Coverage   84.62%   84.61%   -0.01%     
==========================================
  Files         169      169              
  Lines       24996    24996              
==========================================
- Hits        21153    21151       -2     
- Misses       3843     3845       +2
Impacted Files Coverage Δ
satpy/readers/avhrr_l1b_gaclac.py 90.14% <0%> (-1.41%) ⬇️
satpy/scene.py 90.47% <0%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d98f28...5ca6a71. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 27, 2019

Codecov Report

Merging #887 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
+ Coverage   84.62%   84.64%   +0.01%     
==========================================
  Files         169      171       +2     
  Lines       24996    25035      +39     
==========================================
+ Hits        21153    21190      +37     
- Misses       3843     3845       +2
Impacted Files Coverage Δ
satpy/readers/avhrr_l1b_gaclac.py 90.14% <0%> (-1.41%) ⬇️
satpy/scene.py 90.47% <0%> (-0.18%) ⬇️
satpy/composites/abi.py 100% <0%> (ø) ⬆️
satpy/tests/enhancement_tests/test_abi.py 100% <0%> (ø)
satpy/enhancements/abi.py 100% <0%> (ø)
satpy/tests/enhancement_tests/__init__.py 91.66% <0%> (+0.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d98f28...48d757e. Read the comment docs.

@sfinkens
Copy link
Member

sfinkens commented Aug 28, 2019

You could use the short name in a dropdown and the long name in titles. But maybe that is too much detail and only long name is sufficient.

@djhoese
Copy link
Member Author

djhoese commented Aug 28, 2019

For SIFT, the project manager wanted my version of the long_name in the drop down menu. So GOES-R ABI Level 1b.

@mraspaud
Copy link
Member

Could we make short_name optional ?

Also, maybe the documentation on how to implement a reader needs to be updated to include the new required fields.

@djhoese
Copy link
Member Author

djhoese commented Aug 29, 2019

Could we make short_name optional ?

Yes, I think this is reasonable. I think GUIs could probably resort to reader_info['name'].replace('_', ' ').upper() and that would probably work for 90% of these since most of them are acronyms for something.

Also, maybe the documentation on how to implement a reader needs to be updated to include the new required fields.

Yes, I was planning on it but was waiting for feedback first.

@djhoese djhoese requested a review from sjoro as a code owner August 29, 2019 21:32
Copy link
Collaborator

@sjoro sjoro left a comment

Choose a reason for hiding this comment

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

looks good to me

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, just a minor typo to fix.

satpy/etc/readers/seviri_l1b_native.yaml Outdated Show resolved Hide resolved
Copy link
Member

@sfinkens sfinkens left a comment

Choose a reason for hiding this comment

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

One minor thing, otherwise LGTM.

doc/source/dev_guide/custom_reader.rst Outdated Show resolved Hide resolved
@djhoese
Copy link
Member Author

djhoese commented Aug 30, 2019

I fixed the change @mraspaud wanted. Not waiting for re-approval...

@djhoese djhoese merged commit 5e11d50 into pytroll:master Aug 30, 2019
@djhoese djhoese deleted the feature-reader-long-name branch August 30, 2019 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update reader configuration with human-readable long names
5 participants