3030EXCLUDED_FILE_NAMES = ["From_BayesFlow_1.1_to_2.0.ipynb" ]
3131
3232
33- def convert_notebooks_to_md (
34- src_dir : Path , dst_dir : Path , exclude_files : Sequence [str ] = ()
35- ) -> List [Path ]:
33+ def convert_notebooks_to_md (src_dir : Path , dst_dir : Path , exclude_files : Sequence [str ] = ()) -> List [Path ]:
3634 """
3735 Convert Jupyter notebooks (*.ipynb) to Markdown files.
3836
@@ -83,9 +81,7 @@ def convert_notebooks_to_md(
8381 return created
8482
8583
86- def collect_py_files (
87- root : Path , exclude_dirs : Sequence [str ] = (), exclude_files : Sequence [str ] = ()
88- ) -> List [Path ]:
84+ def collect_py_files (root : Path , exclude_dirs : Sequence [str ] = (), exclude_files : Sequence [str ] = ()) -> List [Path ]:
8985 """
9086 Collect Python source files from a directory, excluding specified folders and files.
9187
@@ -188,9 +184,7 @@ def main() -> None:
188184 tmp_full = Path (tmp_full )
189185
190186 # Convert notebooks, respecting file exclusions
191- example_mds = convert_notebooks_to_md (
192- EXAMPLES_DIR , tmp_examples , EXCLUDED_FILE_NAMES
193- )
187+ example_mds = convert_notebooks_to_md (EXAMPLES_DIR , tmp_examples , EXCLUDED_FILE_NAMES )
194188
195189 # ==== Compact bundle ====
196190 (tmp_compact / "examples" ).mkdir (parents = True , exist_ok = True )
@@ -206,9 +200,7 @@ def main() -> None:
206200 shutil .copy (md , tmp_full / "examples" / md .name )
207201
208202 if SRC_DIR .exists ():
209- for pyfile in collect_py_files (
210- SRC_DIR , EXCLUDED_DIR_NAMES , EXCLUDED_FILE_NAMES
211- ):
203+ for pyfile in collect_py_files (SRC_DIR , EXCLUDED_DIR_NAMES , EXCLUDED_FILE_NAMES ):
212204 rel = pyfile .relative_to (SRC_DIR )
213205 dest = tmp_full / "bayesflow" / rel
214206 dest .parent .mkdir (parents = True , exist_ok = True )
@@ -220,4 +212,4 @@ def main() -> None:
220212
221213
222214if __name__ == "__main__" :
223- main ()
215+ main ()
0 commit comments