Repository: wright-group/WrightTools

Issue:
citation convention
We should have a clear way to cite WrightTools. Will this be done once it is published in the initial paper?

Discussion:

Patch:
diff --git a/WrightTools/CITATION b/WrightTools/CITATION
new file mode 100644
index 0000000..d78d71d
--- /dev/null
+++ b/WrightTools/CITATION
@@ -0,0 +1,8 @@
+@misc{WrightTools,
+  author =       {Blaise J. Thompson and Kyle F. Sunden and Darien J. Morrow and Nathan Andrew
+                  Neff-Mallon and Kyle J. Czech and Daniel D. Kohler and Tom Parker and Rachel
+                  Swedin},
+  doi =          {10.5281/zenodo.1198904},
+  title =        {WrightTools},
+}
+
diff --git a/WrightTools/__citation__.py b/WrightTools/__citation__.py
new file mode 100644
index 0000000..d8ff1c6
--- /dev/null
+++ b/WrightTools/__citation__.py
@@ -0,0 +1,11 @@
+"""Define WrightTools citation."""
+
+import pathlib
+
+__all__ = ["__citation__"]
+
+here = pathlib.Path(__file__).parent
+
+with here / "CITATION" as f:
+    # remove extra whitespace
+    __citation__ = " ".join(f.read_text().split())
diff --git a/WrightTools/__init__.py b/WrightTools/__init__.py
index 9973485..e561ca0 100644
--- a/WrightTools/__init__.py
+++ b/WrightTools/__init__.py
@@ -7,6 +7,7 @@
 
 import sys as _sys
 
+from .__citation__ import *
 from .__version__ import *
 from .__wt5_version__ import *
 from . import artists
diff --git a/docs/publications.rst b/docs/publications.rst
index 8eae2be..c40ee7d 100644
--- a/docs/publications.rst
+++ b/docs/publications.rst
@@ -1,7 +1,33 @@
 .. _publications:
 
+Citing WrightTools
+==================
+
+When publishing research which used WrightTools, please provide credit to WrightTools
+developers through citation or acknowledgement.
+
+.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1198904.svg
+   :target: https://doi.org/10.5281/zenodo.1198904
+
+BibTex citation:
+
+::
+
+  @misc{WrightTools,
+    author =       {Blaise J. Thompson and Kyle F. Sunden and Darien J. Morrow and Nathan Andrew
+                    Neff-Mallon and Kyle J. Czech and Daniel D. Kohler and Tom Parker and Rachel
+                    Swedin},
+    doi =          {10.5281/zenodo.1198904},
+    title =        {WrightTools},
+  }
+
+Also see ``WrightTools.__citation__``.
+
+In addition to the main WrightTools citation, each released version of WrightTools has its own
+DOI through zenodo. Refer there to cite a particular version: `<https://zenodo.org/record/1198904>`_.
+
 Publications
-============
+------------
 
 The following publications were enabled, to some extent, by WrightTools.
 The authors of these publications have volunteered to appear on this page.


Test patch:
diff --git a/tests/citation.py b/tests/citation.py
new file mode 100644
index 0000000..f92306f
--- /dev/null
+++ b/tests/citation.py
@@ -0,0 +1,7 @@
+"""Test citation."""
+
+import WrightTools as wt
+
+
+def test_existence():
+    assert wt.__citation__