scripts/make_hdf.py
def make_hdf(
    idir: str,
    ofile: str
    ) -> None:
    """Process a directory of NetCDF RouteLink files to their CSV equivalents.
    
    Parameters
    ----------
    idir: str
        Input directory containing Routelink files in CSV format.
    ofile: str
        Output HDF5 file to store pandas.DataFrame
        
    Returns
    -------
    None
    """
    # Get list of files
    file_list = Path(idir).glob("*.csv")
    
    # Load data
    dfs = []
    for ifile in file_list:
        # Read file
        df = pd.read_csv(ifile, comment="#", dtype={"usgs_site_code": str}, 
            parse_dates=["time"])

        # Stowe data
        dfs.append(df)

    # Concat
    data = pd.concat(dfs, ignore_index=True)

    # Save
    data.to_hdf(ofile, key="data", format="table", complevel=1)
Process a directory of NetCDF RouteLink files to their CSV equivalents.
    
    Parameters
    ----------
    idir: str
        Input directory containing Routelink files in CSV format.
    ofile: str
        Output HDF5 file to store pandas.DataFrame
        
    Returns
    -------
    None
    
Process a directory of NetCDF RouteLink files to their CSV equivalents.
Parameters

str
Input directory containing Routelink files in CSV format.
ofile: str
Output HDF5 file to store pandas.DataFrame

Returns

None
Process a directory of NetCDF RouteLink files to their CSV equivalents . Parameters str Input directory containing Routelink files in CSV format . ofile : str Output HDF5 file to store pandas . DataFrame Returns None
def make_hdf(
    idir: str,
    ofile: str
    ) -> None:
    file_list = Path(idir).glob("*.csv")
    dfs = []
    for ifile in file_list:
        df = pd.read_csv(ifile, comment="#", dtype={"usgs_site_code": str}, 
            parse_dates=["time"])
        dfs.append(df)
    data = pd.concat(dfs, ignore_index=True)
    data.to_hdf(ofile, key="data", format="table", complevel=1)
def make_hdf ( idir : str , ofile : str ) -> None : file_list = Path ( idir ) . glob ( "*.csv" ) dfs = [ ] for ifile in file_list : df = pd . read_csv ( ifile , comment = "#" , dtype = { "usgs_site_code" : str } , parse_dates = [ "time" ] ) dfs . append ( df ) data = pd . concat ( dfs , ignore_index = True ) data . to_hdf ( ofile , key = "data" , format = "table" , complevel = 1 )
Process a directory of NetCDF RouteLink files to their CSV equivalents.
Process a directory of NetCDF RouteLink files to their CSV equivalents .
"""Process a directory of NetCDF RouteLink files to their CSV equivalents.
    
    Parameters
    ----------
    idir: str
        Input directory containing Routelink files in CSV format.
    ofile: str
        Output HDF5 file to store pandas.DataFrame
        
    Returns
    -------
    None
    """ # Get list of files # Load data # Read file # Stowe data # Concat # Save
idir
str
ofile
str