def merge_notebooks_function(path_to_notebooks='.',notebook_paths=['.\\Download_Data_Template.ipynb','.\\DeepBox.ipynb', '.\\Data_Curation.ipynb','.\\Liver_Model.ipynb'], notebook_output_path=os.path.join('.','Click_Me.ipynb')): ''' :param path_to_notebooks: Base_dir, rather unneeded :param notebook_paths: list of full paths to notebooks :param notebook_output_path: path to output notebook :return: ''' merged = merge_notebooks(base_dir=path_to_notebooks,file_paths=notebook_paths, verbose=True) with io.open(notebook_output_path, 'w', encoding='utf8') as fp: write_notebook(merged, fp) return None
# If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys import nbmerge #Merge example Notebooks into one notebook to keep the required structure new_nb = nbmerge.merge_notebooks( './', ('./examples.ipynb', '../examples/operational_AEP_analysis/operational_AEP_analysis.ipynb', '../examples/turbine_analysis/Turbine_Toolkit_Examples.ipynb', '../examples/turbine_analysis/EngieTurbineData_Example.ipynb')) nbmerge.write_notebook(new_nb, './examplesout.ipynb') sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.coverage',
# Merge example Notebooks into one notebook to keep the required structure new_nb = nbmerge.merge_notebooks( "./", ( "./examples.ipynb", "../examples/00_toolkit_examples.ipynb", "../examples/01_qc_data.ipynb", "../examples/02_plant_aep_analysis.ipynb", "../examples/02b_augmented_plant_aep_analysis.ipynb", "../examples/03_turbine_ideal_energy.ipynb", "../examples/04_electrical_losses.ipynb", "../examples/05_eya_gap_analysis.ipynb", ), ) nbmerge.write_notebook(new_nb, "./examplesout.ipynb") sys.path.insert(0, os.path.abspath("..")) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "sphinx.ext.autodoc", "sphinx.ext.coverage",
# full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # #import os # import sys # sys.path.insert(0, os.path.abspath('.')) # Prepare files import nbmerge new_nb = nbmerge.merge_notebooks('./',('../examples.ipynb','../Turbine_Toolkit_Examples.ipynb','../EngieTurbineData_Example.ipynb')) nbmerge.write_notebook(new_nb,'./out.ipynb') # -- Project information ----------------------------------------------------- project = 'test_project' copyright = '2019, sp' author = 'sp' # The short X.Y version version = '' # The full version, including alpha/beta/rc tags release = '1' # -- General configuration ---------------------------------------------------
from nbmerge import merge_notebooks, write_notebook import io, os base_path = r'K:\Morfeus\BMAnderson\NCC_AAPM\Code' file_names = ['Download_Data.ipynb','DeepBox.ipynb','Data_Curation.ipynb','Liver_Model.ipynb'] file_paths = [os.path.join(base_path,i) for i in file_names] merged = merge_notebooks(base_dir=base_path,file_paths=file_paths, verbose=True) with io.open(os.path.join(base_path,'Click_Me.ipynb'), 'w', encoding='utf8') as fp: write_notebook(merged, fp)