splitvar/splitvar.py
def splitbyvar(ds, vars=None, skipvars=['time'], verbose=False):
    """
    Given an xarray variable, split into separate variables
    """
    if vars is None:
        vars = set(ds.data_vars)
    newvars = set(vars).intersection(set(ds.data_vars))

    if skipvars is not None:
        for varname in skipvars:
            newvars.discard(varname)
            newvars.discard(varname.upper)
            newvars.discard(varname.lower)

    if verbose: 
        print("Splitting by variable, skipping: {}".format(newvars.difference(vars)))

    for var in newvars:
        yield var

    Given an xarray variable, split into separate variables
    
Given an xarray variable, split into separate variables
Given an xarray variable split into separate variables
def splitbyvar(ds, vars=None, skipvars=['time'], verbose=False):
    if vars is None:
        vars = set(ds.data_vars)
    newvars = set(vars).intersection(set(ds.data_vars))
    if skipvars is not None:
        for varname in skipvars:
            newvars.discard(varname)
            newvars.discard(varname.upper)
            newvars.discard(varname.lower)
    if verbose: 
        print("Splitting by variable, skipping: {}".format(newvars.difference(vars)))
    for var in newvars:
        yield var
def splitbyvar ( ds , vars = None , skipvars = [ 'time' ] , verbose = False ) : if vars is None : vars = set ( ds . data_vars ) newvars = set ( vars ) . intersection ( set ( ds . data_vars ) ) if skipvars is not None : for varname in skipvars : newvars . discard ( varname ) newvars . discard ( varname . upper ) newvars . discard ( varname . lower ) if verbose : print ( "Splitting by variable, skipping: {}" . format ( newvars . difference ( vars ) ) ) for var in newvars : yield var
Given an xarray variable, split into separate variables
Given an xarray variable split into separate variables
"""
    Given an xarray variable, split into separate variables
    """
ds
vars
skipvars
verbose