Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 3, 2023
1 parent f04dde6 commit 64060b1
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def field_type(field):
return ctype

class MystNbConfigDirective(_ConfigBase):

required_arguments = 1
option_spec = {
"sphinx": directives.flag,
Expand All @@ -197,7 +196,6 @@ def run(self):
text = self.table_header()
count = 0
for name, value, field in config.as_triple():

# filter by sphinx options
if "sphinx" in self.options and field.metadata.get("sphinx_exclude"):
continue
Expand Down Expand Up @@ -239,7 +237,6 @@ def run(self):
return node.children

class MystConfigDirective(_ConfigBase):

option_spec = {
"sphinx": directives.flag,
}
Expand All @@ -250,7 +247,6 @@ def run(self):
text = self.table_header()
count = 0
for name, value, field in config.as_triple():

# filter by sphinx options
if "sphinx" in self.options and field.metadata.get("sphinx_exclude"):
continue
Expand Down
3 changes: 0 additions & 3 deletions myst_nb/core/execute/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class NotebookClientInline(NotebookClientBase):
"""

def start_client(self):

self._tmp_path = None
if self.nb_config.execution_in_temp:
self._tmp_path = mkdtemp()
Expand Down Expand Up @@ -114,12 +113,10 @@ def close_client(self, exc_type, exc_val, exc_tb):
def code_cell_outputs(
self, cell_index: int
) -> tuple[int | None, list[NotebookNode]]:

cells = self.notebook.get("cells", [])

# ensure all cells up to and including the requested cell have been executed
while (not self._cell_error) and cell_index > self._last_cell_executed:

self._last_cell_executed += 1
try:
next_cell = cells[self._last_cell_executed]
Expand Down
1 change: 0 additions & 1 deletion myst_nb/core/nb_to_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def notebook_to_tokens(
# (required to collect all reference definitions, before assessing references).
block_tokens = [Token("nb_initialise", "", 0, map=[0, 0])]
for cell_index, nb_cell in enumerate(notebook.cells):

# skip empty cells
if len(nb_cell["source"].strip()) == 0:
continue
Expand Down
1 change: 0 additions & 1 deletion myst_nb/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ def _flush_markdown(start_line, token, md_metadata):
md_metadata: dict = {}

for token in tokens:

nesting_level += token.nesting

if nesting_level != 0:
Expand Down
1 change: 0 additions & 1 deletion myst_nb/core/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def render_nb_cell_code(self: SelfType, token: SyntaxTreeNode) -> None:

self.add_line_and_source_path(cell_container, token)
with self.current_node_context(cell_container, append=True):

# render the code source code
if not remove_input:
cell_input = nodes.container(
Expand Down
1 change: 0 additions & 1 deletion myst_nb/docutils_.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ def _render_nb_cell_code_outputs(
self.add_line_and_source_path_r(_nodes, token)
self.current_node.extend(_nodes)
elif output.output_type in ("display_data", "execute_result"):

# Note, this is different to the sphinx implementation,
# here we directly select a single output, based on the mime_priority,
# as opposed to output all mime types, and select in a post-transform
Expand Down
1 change: 0 additions & 1 deletion myst_nb/ext/glue/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class PasteRoleAny(RoleBase):
"""

def run(self) -> tuple[list[nodes.Node], list[nodes.system_message]]:

# check if this is a pending reference
doc_key = self.text.split("::", 1)
if len(doc_key) == 2:
Expand Down
3 changes: 0 additions & 3 deletions myst_nb/sphinx_.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ def _render_nb_cell_code_outputs(
self.add_line_and_source_path_r(_nodes, token)
self.current_node.extend(_nodes)
elif output.output_type in ("display_data", "execute_result"):

# Note, this is different to the docutils implementation,
# where we directly select a single output, based on the mime_priority.
# Here, we do not know the mime priority until we know the output format
Expand Down Expand Up @@ -504,9 +503,7 @@ class HideInputCells(SphinxPostTransform):
formats = ("html",)

def run(self, **kwargs):

for node in findall(self.document)(nodes.container):

if (
node.get("nb_element") == "cell_code"
and node.get("hide_mode")
Expand Down

0 comments on commit 64060b1

Please sign in to comment.