flavio.citations module
Module variables
var set
var string
Functions
def clear(
self)
Clear the list of cited papers (including any default citations).
def clear(self): """Clear the list of cited papers (including any default citations).""" self._array[:] = [False]*len(self._array)
def register(
self, inspire_key)
Register a paper to be cited. The intended use is that this method should be called only when the referenced functionality is actually being used. Parameters
inspire_key : str The INSPIRE texkey for the paper to be cited
def register(self, inspire_key): """Register a paper to be cited. The intended use is that this method should be called only when the referenced functionality is actually being used. Parameters ---------- inspire_key : str The INSPIRE texkey for the paper to be cited """ try: self._array[self._all_citations[inspire_key]] = True except KeyError: from flavio.util import get_datapath yaml_path = get_datapath('flavio', 'data/citations.yml') raise KeyError( f'The inspire key must be contained in {yaml_path}. ' f'The key `{inspire_key}` was not found there.' )
def reset(
self)
Reset the list of cited papers back to only the default ones.
def reset(self): """Reset the list of cited papers back to only the default ones.""" self.clear() for inspire_key in self._initial_citations: self.register(inspire_key)