class pybamm.Citations[source]#

Entry point to citations management. This object may be used to record BibTeX citation information and then register that a particular citation is relevant for a particular simulation.

Citations listed in pybamm/CITATIONS.bib can be registered with their citation key. For all other works provide a BibTeX Citation to register().


>>> pybamm.citations.register("Sulzer2021")
>>> pybamm.citations.register("@misc{Newton1687, title={Mathematical...}}")
>>> pybamm.print_citations("citations.txt")
print(filename=None, output_format='text', verbose=False)[source]#

Print all citations that were used for running simulations. The verbose option is provided to print tags for citations in the output such that it can can be seen where the citations were registered due to the use of PyBaMM models and solvers in the code.


If a citation is registered manually, it will not be tagged.


This function will notify the user if a citation that has been previously registered is invalid or cannot be parsed.

  • filename (str, optional) – Filename to which to print citations. If None, citations are printed to the terminal.

  • verbose (bool, optional) – If True, prints the citation tags for the citations that have been registered. An example of the output is shown below.


pybamm.Citations.print(verbose=True) or pybamm.print_citations(verbose=True)

will append the following at the end of the list of citations:

Citations registered:

Marquis2019 was cited due to the use of SPM

Reads the citations in pybamm.CITATIONS.bib. Other works can be cited by passing a BibTeX citation to register().


Register a paper to be cited, one at a time. The intended use is that register() should be called only when the referenced functionality is actually being used.


Registering a BibTeX citation, with the same key as an existing citation, will overwrite the current citation.


key (str) –

  • The citation key for an entry in pybamm/CITATIONS.bib or

  • A BibTeX formatted citation

pybamm.print_citations(filename=None, output_format='text', verbose=False)[source]#

See Citations.print()