from pathlib import Path


def create_fake_raw_ephys_data_folder(session_path, populate=True):
    """create_fake_raw_ephys_data_folder creates raw_ephys_data folder
    can populate with empty files with expected names

    :param session_path: [description]
    :type session_path: [type]
    :param populate: [description], defaults to True
    :type populate: bool, optional
    :return: [description]
    :rtype: [type]
    """
    session_path = Path(session_path)
    raw_ephys_data_path = session_path / "raw_ephys_data"
    raw_ephys_data_path.mkdir(exist_ok=True, parents=True)
    if populate:
        file_list = [
            "probe00/_spikeglx_ephysData_g0_t0.imec0.sync.npy",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.lf.meta",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.ap.cbin",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.timestamps.npy",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.lf.cbin",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.ap.ch",
            "probe00/_spikeglx_ephysData_g0_t0.imec0.wiring.json",
            "probe00/_spikeglx_sync.times.probe00.npy",
            "probe00/_spikeglx_sync.channels.probe00.npy",
            "probe00/_spikeglx_sync.polarities.probe00.npy",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.sync.npy",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.lf.meta",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.timestamps.cbin",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.ap.cbin",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.lf.cbin",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.ap.ch",
            "probe01/_spikeglx_ephysData_g0_t0.imec1.wiring.json",
            "probe02/_spikeglx_ephysData_g0_t0.imec.ap.meta",  # 3A
            "probe02/_spikeglx_ephysData_g0_t0.imec.lf.meta",
            "probe02/_spikeglx_ephysData_g0_t0.imec.ap.bin",
            "probe02/_spikeglx_ephysData_g0_t0.imec.lf.bin",
            "_spikeglx_ephysData_g0_t0.nidq.sync.npy",
            "_spikeglx_ephysData_g0_t0.nidq.meta",
            "_spikeglx_ephysData_g0_t0.nidq.cbin",
            "_spikeglx_ephysData_g0_t0.nidq.ch",
            "_spikeglx_ephysData_g0_t0.wiring.json",
        ]
        for f in file_list:
            fpath = raw_ephys_data_path / Path(f)
            fpath.parent.mkdir(parents=True, exist_ok=True)
            fpath.touch()

    return session_path