regolith/tools.py
def filter_projects(projects, authors, reverse=False):
    """Filter projects by the author(s)

    Parameters
    ----------
    projects : list of dict
        The publication citations
    authors : set of str
        The authors to be filtered against
    reverse : bool, optional
        If True reverse the order, defaults to False
    """
    projs = []
    for proj in projects:
        team_names = set(gets(proj['team'], 'name'))
        if len(team_names & authors) == 0:
            continue
        proj = dict(proj)
        proj['team'] = [x for x in proj['team'] if x['name'] in authors]
        projs.append(proj)
    projs.sort(key=id_key, reverse=reverse)
    return projs
Filter projects by the author(s)

    Parameters
    ----------
    projects : list of dict
        The publication citations
    authors : set of str
        The authors to be filtered against
    reverse : bool, optional
        If True reverse the order, defaults to False
    
Filter projects by the author(s)
Parameters

projects : list of dict
The publication citations
authors : set of str
The authors to be filtered against
reverse : bool, optional
If True reverse the order, defaults to False
Filter projects by the author ( s ) Parameters projects : list of dict The publication citations authors : set of str The authors to be filtered against reverse : bool optional If True reverse the order defaults to False
def filter_projects(projects, authors, reverse=False):
    projs = []
    for proj in projects:
        team_names = set(gets(proj['team'], 'name'))
        if len(team_names & authors) == 0:
            continue
        proj = dict(proj)
        proj['team'] = [x for x in proj['team'] if x['name'] in authors]
        projs.append(proj)
    projs.sort(key=id_key, reverse=reverse)
    return projs
def filter_projects ( projects , authors , reverse = False ) : projs = [ ] for proj in projects : team_names = set ( gets ( proj [ 'team' ] , 'name' ) ) if len ( team_names & authors ) == 0 : continue proj = dict ( proj ) proj [ 'team' ] = [ x for x in proj [ 'team' ] if x [ 'name' ] in authors ] projs . append ( proj ) projs . sort ( key = id_key , reverse = reverse ) return projs
Filter projects by the author(s)
Parameters
Filter projects by the author ( s ) Parameters
"""Filter projects by the author(s)

    Parameters
    ----------
    projects : list of dict
        The publication citations
    authors : set of str
        The authors to be filtered against
    reverse : bool, optional
        If True reverse the order, defaults to False
    """
projects
authors
reverse