# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/cli/netcdfy.ipynb.

# %% auto 0
__all__ = ['main']

# %% ../../nbs/cli/netcdfy.ipynb 1
from pathlib import Path
from fastcore.script import *
from ..configs import BASE_PATH
import papermill as pm
from ..utils import parametrize

# %% ../../nbs/cli/netcdfy.ipynb 2
@call_parse
def main(data:str,  # Path to dataset to encode
         nb_in:str, # Path to Jupyter noteboook (NetCDF handler) to execute
         nc_out:str,# Path to generated NetCDF4
        ):
    "Encode MARIS dataset as NetCDF using Jupyter Notebook handlers"
    print(f'Handler: {nb_in}')
    parametrize(nb_in)
    inter_nb = BASE_PATH / 'tmp' / '_output.ipynb'
    
    pm.execute_notebook(
        nb_in,
        inter_nb,
        parameters=dict(fname_in=data, fname_out=nc_out))
