firedrake_citations package

Module contents

class firedrake_citations.Citations[source]

Bases: dict

Entry point to citations management.

This singleton object may be used to record Bibtex citation information and then register that a particular citation is relevant for a particular computation. It hooks up with PETSc’s citation registration mechanism, so that running with -citations does the right thing.

Example usage:

Citations().add("key", "bibtex-entry-for-my-funky-method")

...

if using_funky_method:
    Citations().register("key")
add(key, entry)[source]

Add a paper to the database of possible citations.

Parameters:
  • key – The key to use.

  • entry – The bibtex entry.

classmethod print_at_exit()[source]

Print citations when exiting.

register(key)[source]

Register a paper to be cited so that PETSc knows about it.

Parameters:

key – The key of the relevant citation.

Raises:

KeyError if no such citation is found in the database.

Papers to be cited can be added using add().

Note

The intended use is that register() should be called only when the referenced functionality is actually being used.