windnode / WindNODE_ABW

Region Anhalt-Bitterfeld-Wittenberg
GNU Affero General Public License v3.0
3 stars 0 forks source link

include notebooks into RTD documentation #78

Closed gplssm closed 3 years ago

gplssm commented 4 years ago

The Sphinx extension nbsphinx integrates notebooks in Sphinx docs. The normal workflow includes execution of a notebook. Because this takes too long for all scenarios of WindNODE_ABW, it is not an option. Execution can be bypassed and notebooks can rendered from executed notebooks. As the size and number of notebooks and changes made to these would grow the size of the repo, @nesnoj and I decided not to commit executed notebooks to this repo. Instead, we are thinking of creating a separate repo to only store executed notebooks. Git tags could help to manage versions.

Btw, Binder is not really an option because of computational limitations and the need to store the results data somewhere publicly accessible.

Tasks

gplssm commented 4 years ago

Updated tasks after some research, prototyping and re-thinking of it

gplssm commented 4 years ago

In general, the above ticked tasks are done. Some things done differently

In general, the NBs showing results for each scenario can be integrated into the documentation (see on the example of two NBs). But it might not work with all NBs. I we could run into problems because of resource limits of RTD, which limits each build to 15 min. First build failed because of other reason and the second try ran into the resource limits

I see two options to get around this

  1. Somehow reduce file size of ipynb dramatically (down to ~20...30 %)
  2. Use .html exports of NBs and include them statically (at least 140 mb -> 50 mb)
gplssm commented 4 years ago

I found 5 figures causing 5/6th of the file size

Executed notebooks (.ipynb) require 19 to 22 Mb disk space after removing these figures. Still, the docs build process fails on RTD.

nesnoj commented 4 years ago
* 7.2 Line Loading Distribution: 46 MB

Does the data or the plot itself consume that much space? I'd assume that the full data is stored somewhere in the plot JS? We could use a different renderer to make the largest plots static, e.g. svg, example (source):

import plotly.graph_objects as go
fig = go.Figure(
    data=[go.Bar(y=[2, 1, 3])],
    layout_title_text="A Figure Displayed with the 'svg' Renderer"
)
fig.show(renderer="svg")

Still, the docs build process fails on RTD.

Still because of the build time?