Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# -*- coding: utf-8 -*-
import nbsphinx
import os
import sys
import starry
import re
import packaging
import urllib
from sphinx.ext import autodoc
# Hack `nbsphinx` to enable us to hide certain input cells in the
# jupyter notebooks. This works with nbsphinx==0.5.0
nbsphinx.RST_TEMPLATE = nbsphinx.RST_TEMPLATE.replace(
"{% block input -%}",
'{% block input -%}\n{%- if not "hide_input" in cell.metadata.tags %}',
)
nbsphinx.RST_TEMPLATE = nbsphinx.RST_TEMPLATE.replace(
"{% endblock input %}", "{% endif %}\n{% endblock input %}"
)
# Hack `nbsphinx` to prevent fixed-height images, which look
# terrible when the window is resized!
nbsphinx.RST_TEMPLATE = re.sub(
r"\{%- if height %\}.*?{% endif %}",
"",
nbsphinx.RST_TEMPLATE,
flags=re.DOTALL,
)
import os
import sys
import starry
import re
import packaging
import urllib
from sphinx.ext import autodoc
# Hack `nbsphinx` to enable us to hide certain input cells in the
# jupyter notebooks. This works with nbsphinx==0.5.0
nbsphinx.RST_TEMPLATE = nbsphinx.RST_TEMPLATE.replace(
"{% block input -%}",
'{% block input -%}\n{%- if not "hide_input" in cell.metadata.tags %}',
)
nbsphinx.RST_TEMPLATE = nbsphinx.RST_TEMPLATE.replace(
"{% endblock input %}", "{% endif %}\n{% endblock input %}"
)
# Hack `nbsphinx` to prevent fixed-height images, which look
# terrible when the window is resized!
nbsphinx.RST_TEMPLATE = re.sub(
r"\{%- if height %\}.*?{% endif %}",
"",
nbsphinx.RST_TEMPLATE,
flags=re.DOTALL,
)
# Hack the docstrings of the different base maps. This allows us
# to have a different docs page for radial velocity maps, reflected
# light maps, etc, even though those classes are instantiated via
# a class factory and don't actually exist in the starry namespace.