Skip to content

Commit 0dccd31

Browse files
committed
Latest changes
1 parent aed30c0 commit 0dccd31

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

nbmodular/cell2func.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,9 @@ def __init__(
12601260
test_write=False,
12611261
pipe_name=None,
12621262
restrict_inputs=False,
1263-
api=True,
1264-
keep_original_in_documentation=False,
1263+
include_magic=False,
1264+
include_in_code=True,
1265+
include_in_docs=True,
12651266
**kwargs,
12661267
):
12671268
"""
@@ -1406,8 +1407,11 @@ def __init__(
14061407
self.code_cells_path = Path(code_cells_path)
14071408
self.code_cells_path.mkdir(parents=True, exist_ok=True)
14081409

1409-
self.api = api # do we need this?
1410-
self.keep_original_in_documentation = keep_original_in_documentation
1410+
# do we need this?
1411+
self.include_magic = include_magic
1412+
self.include_in_code = include_in_code
1413+
self.include_in_docs = include_in_docs
1414+
14111415
self.restrict_inputs = restrict_inputs
14121416
self.current_function = Bunch()
14131417

@@ -1546,10 +1550,9 @@ def __init__(
15461550
self.export_always = export_always
15471551

15481552
self.default_restrict_inputs = self.restrict_inputs
1549-
self.default_api = self.api
1550-
self.default_keep_original_in_documentation = (
1551-
self.keep_original_in_documentation
1552-
)
1553+
self.default_include_magic = include_magic
1554+
self.default_include_in_code = include_in_code
1555+
self.default_include_in_docs = include_in_docs
15531556

15541557
self.parser = argparse.ArgumentParser(
15551558
description="Arguments to `function` magic cell."

nbmodular/export.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,21 @@ def __init__(
280280
log_level="INFO",
281281
from_notebook=False,
282282
restrict_inputs=False,
283-
api=True,
283+
include_magic=False,
284+
include_in_code=True,
285+
include_in_docs=True,
284286
):
285287
nb = read_nb(path) if nb is None else nb
286288
super().__init__(nb)
287289
self.logger = create_or_get_logger(logger_name, log_level)
288290
self.logger.info(f"Analyzing code from notebook {path}")
289291
self.cell_processor = CellProcessor(
290-
path=path, run=from_notebook, restrict_inputs=restrict_inputs, api=api
292+
path=path,
293+
run=from_notebook,
294+
restrict_inputs=restrict_inputs,
295+
include_magic=include_magic,
296+
include_in_code=include_in_code,
297+
include_in_docs=include_in_docs,
291298
)
292299
self.cell_processor.change_file_name = False
293300
self.cell_processor.set_run_tests(False)

0 commit comments

Comments
 (0)