satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Automatic list with overviews of inlcuded area definitions for the documentation

Open BENR0 opened this issue 1 year ago • 15 comments

Based on https://github.com/pytroll/pyresample/pull/450 this generates overviews for all AreaDefinitions included with Satpy and adds them to the resampling section.

I noticed that a quite large number of AreaDefinitions are included which make the section really long now. Some areas are not included because only AreaDefinitions currently have _repr_html_ (see PR above).

  • [x] Closes #1206
  • [x] Fully documented

BENR0 avatar Aug 05 '22 18:08 BENR0

Codecov Report

Merging #2167 (f766457) into main (1f97c0b) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2167   +/-   ##
=======================================
  Coverage   94.84%   94.84%           
=======================================
  Files         337      337           
  Lines       49571    49571           
=======================================
  Hits        47016    47016           
  Misses       2555     2555           
Flag Coverage Δ
behaviourtests 4.41% <ø> (ø)
unittests 95.46% <ø> (ø)

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

Impacted Files Coverage Δ
satpy/resample.py 79.31% <ø> (ø)

codecov[bot] avatar Aug 05 '22 18:08 codecov[bot]

This looks interesting. How easy would it be for users to use this feature to generate overviews of areas from their own local YAML files?

gerritholl avatar Aug 11 '22 10:08 gerritholl

@gerritholl Curently not that easy I guess. But could easily be refactored to be available to users I think.

BENR0 avatar Aug 11 '22 14:08 BENR0

@gerritholl Curently not that easy I guess. But could easily be refactored to be available to users I think.

Especially if it was in pyresample :wink:

mraspaud avatar Aug 12 '22 07:08 mraspaud

@mraspaud @gerritholl ok so where should this go in pyresample? Should I include it in https://github.com/pytroll/pyresample/pull/450 or make a separate PR?

BENR0 avatar Aug 12 '22 10:08 BENR0

Coverage Status

Coverage increased (+0.2%) to 94.948% when pulling 6edf540767498f79ec684661646eff94fb57d0b5 on BENR0:feat_automatic_area_def_overview into 5cc09e025e7fd134df16a07fce42333193407e65 on pytroll:main.

coveralls avatar Nov 15 '22 09:11 coveralls

Since this is based on the area html representation is has the same features (properties list/ foldable map). So this is how it looks like:

Folded

area_definitions_list_fold

Unfolded

area_definitions_list_unfold

BENR0 avatar Nov 18 '22 10:11 BENR0

There are some problems with building the documentation, but they seem to be because https://github.com/pytroll/pyresample/pull/450 needs to be merged and released first.

pnuu avatar Nov 23 '22 08:11 pnuu

There are some problems with building the documentation, but they seem to be because pytroll/pyresample#450 needs to be merged and released first.

Yes correct. Based on some discussions and ideas I had I am working on making this more useable/pretty so please wait with merging this even if https://github.com/pytroll/pyresample/pull/450 gets merged in the meantime.

BENR0 avatar Nov 28 '22 12:11 BENR0

Since there are quite a few AreaDefinitions in the yaml file I added a searchable table similar to the reader table with links to the definitions so the user does not have to scroll through the whole document. Currently this is still a bit messy since I just included the generation in the conf.py of the documentation for demonstration purposes. If this is wanted I will refactor this. It could be integrated into the generation function I already moved to pyresample but there on its own it would just generated a static table because the searching and sorting depends on the datatable css and js which is integrated in the satpy documentation.

Below you can see how it would look like. One think to note is that all the area definitions also appear in the toc tree which is not a huge deal but not that nice I guess. I think that has something to do with the toc maxdepth setting but I couldn't get that fixed somehow. So if somebody has an idea about that please share.

Apart from that I notice that there are two area definitions I think belong to DynamicAreaDefinitions?:

  • omerc_bb
  • laea_bb Right now these produce broken links in the table because obviously there can be no overview generated for those.

area_def_table

BENR0 avatar Dec 05 '22 14:12 BENR0

Just as a reminder for whoever is looking for a status update, this is waiting for completion of https://github.com/pytroll/pyresample/pull/450

mraspaud avatar Feb 02 '23 09:02 mraspaud

Pull Request Test Coverage Report for Build 5176646861

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.414%

Totals Coverage Status
Change from base Build 5141473420: 0.0%
Covered Lines: 47129
Relevant Lines: 49394

💛 - Coveralls

coveralls avatar Jun 05 '23 12:06 coveralls

https://github.com/pytroll/pyresample/pull/450 is now merged. Do we need a pyresample release before this can work?

mraspaud avatar Dec 13 '23 09:12 mraspaud

I think so because if I see correctly read the docs uses a conda installed pyresample to build the docs. While the table should build fine in either case it would be nice to have the area names in the yaml file fixed (even if there is no agreement on a file naming pattern yet) #2310.

BENR0 avatar Dec 13 '23 09:12 BENR0

You can add yourself to AUTHORS.md while you're at it :)

gerritholl avatar Dec 14 '23 11:12 gerritholl