How to use the allensdk.config.manifest.Manifest.safe_mkdir function in allensdk

To help you get started, we’ve selected a few allensdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AllenInstitute / biophys_optimize / biophys_optimize / preprocess.py View on Github external
Parameters
    ----------
    grand_up, grand_down : array-like
        Series of voltages responses to positive (`grand_up`) and negative (`grand_down`) current pulses
    t : array-like
        Time values for `grand_up` and `grand_down`
    storage_directory : str
        Path to storage directory for files

    Returns
    -------
    upfile, downfile : str
        Paths to the saved files
    """
    Manifest.safe_mkdir(storage_directory)
    upfile = os.path.join(storage_directory, "upbase.dat")
    downfile = os.path.join(storage_directory, "downbase.dat")
    with open(upfile, 'w') as f:
        np.savetxt(f, np.column_stack((t, grand_up)))
    with open(downfile, 'w') as f:
        np.savetxt(f, np.column_stack((t, grand_down)))

    return upfile, downfile