Skip to content

Commit d37abe2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5d48a53 commit d37abe2

8 files changed

Lines changed: 0 additions & 15 deletions

File tree

docs/conf.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def field_type(field):
177177
return ctype
178178

179179
class MystNbConfigDirective(_ConfigBase):
180-
181180
required_arguments = 1
182181
option_spec = {
183182
"sphinx": directives.flag,
@@ -197,7 +196,6 @@ def run(self):
197196
text = self.table_header()
198197
count = 0
199198
for name, value, field in config.as_triple():
200-
201199
# filter by sphinx options
202200
if "sphinx" in self.options and field.metadata.get("sphinx_exclude"):
203201
continue
@@ -239,7 +237,6 @@ def run(self):
239237
return node.children
240238

241239
class MystConfigDirective(_ConfigBase):
242-
243240
option_spec = {
244241
"sphinx": directives.flag,
245242
}
@@ -250,7 +247,6 @@ def run(self):
250247
text = self.table_header()
251248
count = 0
252249
for name, value, field in config.as_triple():
253-
254250
# filter by sphinx options
255251
if "sphinx" in self.options and field.metadata.get("sphinx_exclude"):
256252
continue

myst_nb/core/execute/inline.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class NotebookClientInline(NotebookClientBase):
3434
"""
3535

3636
def start_client(self):
37-
3837
self._tmp_path = None
3938
if self.nb_config.execution_in_temp:
4039
self._tmp_path = mkdtemp()
@@ -114,12 +113,10 @@ def close_client(self, exc_type, exc_val, exc_tb):
114113
def code_cell_outputs(
115114
self, cell_index: int
116115
) -> tuple[int | None, list[NotebookNode]]:
117-
118116
cells = self.notebook.get("cells", [])
119117

120118
# ensure all cells up to and including the requested cell have been executed
121119
while (not self._cell_error) and cell_index > self._last_cell_executed:
122-
123120
self._last_cell_executed += 1
124121
try:
125122
next_cell = cells[self._last_cell_executed]

myst_nb/core/nb_to_tokens.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def notebook_to_tokens(
3737
# (required to collect all reference definitions, before assessing references).
3838
block_tokens = [Token("nb_initialise", "", 0, map=[0, 0])]
3939
for cell_index, nb_cell in enumerate(notebook.cells):
40-
4140
# skip empty cells
4241
if len(nb_cell["source"].strip()) == 0:
4342
continue

myst_nb/core/read.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ def _flush_markdown(start_line, token, md_metadata):
242242
md_metadata: dict = {}
243243

244244
for token in tokens:
245-
246245
nesting_level += token.nesting
247246

248247
if nesting_level != 0:

myst_nb/core/render.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def render_nb_cell_code(self: SelfType, token: SyntaxTreeNode) -> None:
192192

193193
self.add_line_and_source_path(cell_container, token)
194194
with self.current_node_context(cell_container, append=True):
195-
196195
# render the code source code
197196
if not remove_input:
198197
cell_input = nodes.container(

myst_nb/docutils_.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def _render_nb_cell_code_outputs(
301301
self.add_line_and_source_path_r(_nodes, token)
302302
self.current_node.extend(_nodes)
303303
elif output.output_type in ("display_data", "execute_result"):
304-
305304
# Note, this is different to the sphinx implementation,
306305
# here we directly select a single output, based on the mime_priority,
307306
# as opposed to output all mime types, and select in a post-transform

myst_nb/ext/glue/roles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class PasteRoleAny(RoleBase):
2929
"""
3030

3131
def run(self) -> tuple[list[nodes.Node], list[nodes.system_message]]:
32-
3332
# check if this is a pending reference
3433
doc_key = self.text.split("::", 1)
3534
if len(doc_key) == 2:

myst_nb/sphinx_.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ def _render_nb_cell_code_outputs(
262262
self.add_line_and_source_path_r(_nodes, token)
263263
self.current_node.extend(_nodes)
264264
elif output.output_type in ("display_data", "execute_result"):
265-
266265
# Note, this is different to the docutils implementation,
267266
# where we directly select a single output, based on the mime_priority.
268267
# Here, we do not know the mime priority until we know the output format
@@ -504,9 +503,7 @@ class HideInputCells(SphinxPostTransform):
504503
formats = ("html",)
505504

506505
def run(self, **kwargs):
507-
508506
for node in findall(self.document)(nodes.container):
509-
510507
if (
511508
node.get("nb_element") == "cell_code"
512509
and node.get("hide_mode")

0 commit comments

Comments
 (0)