regolith/tools.py
def filter_publications(citations, authors, reverse=False, bold=True):
    """Filter publications by the author(s)

    Parameters
    ----------
    citations : 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
    bold : bool, optional
        If True put latex bold around the author(s) in question
    """
    pubs = []
    for pub in citations:
        if len(set(pub['author']) & authors) == 0:
            continue
        pub = deepcopy(pub)
        if bold:
            bold_self = []
            for a in pub['author']:
                if a in authors:
                    bold_self.append('\\textbf{' + a + '}')
                else:
                    bold_self.append(a)
            pub['author'] = bold_self
        else:
            pub = deepcopy(pub)
        pubs.append(pub)
    pubs.sort(key=doc_date_key, reverse=reverse)
    return pubs
Filter publications by the author(s)

    Parameters
    ----------
    citations : 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
    bold : bool, optional
        If True put latex bold around the author(s) in question
    
Filter publications by the author(s)
Parameters

citations : 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
bold : bool, optional
If True put latex bold around the author(s) in question
Filter publications by the author ( s ) Parameters citations : 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 bold : bool optional If True put latex bold around the author ( s ) in question
def filter_publications(citations, authors, reverse=False, bold=True):
    pubs = []
    for pub in citations:
        if len(set(pub['author']) & authors) == 0:
            continue
        pub = deepcopy(pub)
        if bold:
            bold_self = []
            for a in pub['author']:
                if a in authors:
                    bold_self.append('\\textbf{' + a + '}')
                else:
                    bold_self.append(a)
            pub['author'] = bold_self
        else:
            pub = deepcopy(pub)
        pubs.append(pub)
    pubs.sort(key=doc_date_key, reverse=reverse)
    return pubs
def filter_publications ( citations , authors , reverse = False , bold = True ) : pubs = [ ] for pub in citations : if len ( set ( pub [ 'author' ] ) & authors ) == 0 : continue pub = deepcopy ( pub ) if bold : bold_self = [ ] for a in pub [ 'author' ] : if a in authors : bold_self . append ( '\\textbf{' + a + '}' ) else : bold_self . append ( a ) pub [ 'author' ] = bold_self else : pub = deepcopy ( pub ) pubs . append ( pub ) pubs . sort ( key = doc_date_key , reverse = reverse ) return pubs
Filter publications by the author(s)
Parameters
Filter publications by the author ( s ) Parameters
"""Filter publications by the author(s)

    Parameters
    ----------
    citations : 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
    bold : bool, optional
        If True put latex bold around the author(s) in question
    """
citations
authors
reverse
bold