Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theory citation function #123

Merged
merged 43 commits into from
Mar 6, 2021
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2f1a4d6
Copy over PyBaMM citations code
MJKirk Oct 14, 2020
1258016
Minimal working version of citations function
MJKirk Oct 14, 2020
175e973
A initial citation reference for testing
MJKirk Oct 14, 2020
03dad12
Add SM_citations function to Observable class
MJKirk Oct 22, 2020
51bb4dc
Merge _reset method into constructor
MJKirk Oct 22, 2020
d7af776
Add docstring to SM_citations
MJKirk Oct 22, 2020
1655c95
Copy over the PyBaMM citation test class
MJKirk Oct 22, 2020
11742ce
Revert "Merge _reset method into constructor"
MJKirk Oct 22, 2020
eb2af7e
Rejig the print functions to return a list
MJKirk Oct 22, 2020
2d65acb
Add some tests of the citation functionality
MJKirk Oct 22, 2020
758f472
Fix typo in docstring
MJKirk Oct 23, 2020
c6d8aaf
Citations for B->Xgamma
MJKirk Oct 23, 2020
3fef0d9
Citations for meson mixing
MJKirk Oct 23, 2020
12faac5
Add citations for W and Z observables
MJKirk Oct 23, 2020
6300904
Improve theory citation function
MJKirk Nov 3, 2020
6a6c277
Add citations for beta decay
MJKirk Nov 3, 2020
f1a23e6
Fix failing test
MJKirk Nov 3, 2020
95f1783
Citations for mu and tau decays
MJKirk Nov 4, 2020
074e34b
Citations for quark mass conversions
MJKirk Dec 1, 2020
33fa535
Citations for K decays
MJKirk Dec 1, 2020
c497a62
Add D decay form factor citations
MJKirk Dec 2, 2020
6b78f82
Add a bunch of b decay citations
MJKirk Dec 3, 2020
9c3a247
Add bvll citations
MJKirk Dec 3, 2020
88ba5cc
Add B -> P formfactor citations
MJKirk Dec 3, 2020
734b8bc
Add B -> gamma formfactor citations
MJKirk Dec 3, 2020
30379ea
Add citations for B->V formfactors
MJKirk Dec 4, 2020
8e2db8c
Small change to docstrings
MJKirk Dec 7, 2020
5b1264c
Add citations for Higgs stuff
MJKirk Dec 7, 2020
8cf8daf
Adds citations for B->llgamma
MJKirk Feb 4, 2021
6739d65
Fix indentation
MJKirk Feb 4, 2021
d966413
Move copyright notice to appropriate file
MJKirk Feb 9, 2021
680ef72
Give citations instance a unique name
MJKirk Feb 9, 2021
4a6ad9d
Correct docstring
MJKirk Feb 9, 2021
3bbd204
Fix code typo
MJKirk Feb 9, 2021
2c6b08d
Improve internals of the citation class
MJKirk Feb 9, 2021
a09f169
Remove tex citation string method, add properties
MJKirk Feb 11, 2021
c2e173c
Add convenience `register_citation` method
MJKirk Feb 11, 2021
21ba0b0
use multiprocessing.Array
peterstangl Feb 19, 2021
91c6ba5
raise meaningful error meassge if inspire key not in YAML
peterstangl Feb 19, 2021
7e8487f
Add docstrings for the main methods
MJKirk Feb 22, 2021
eac872c
Update and add tests
MJKirk Feb 22, 2021
9fbf6e3
Update tests
MJKirk Feb 23, 2021
13f3946
improve regexp in `extract_citations` function
peterstangl Feb 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 22 additions & 2 deletions flavio/test_citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,35 @@ def test_citations(self):
self.assertIn("Straub:2018kue", citations.set)
flavio.sm_prediction("DeltaGamma_s")
self.assertIn("Beneke:2003az", citations.set)
citations.register("fakename:2020abc")
self.assertIn("fakename:2020abc", citations.set)
citations.reset()
self.assertNotIn("Beneke:2003az", citations.set)
self.assertNotIn("fakename:2020abc", citations.set)
self.assertIn("Straub:2018kue", citations.set)

def test_register(self):
def test_clear_citations(self):
citations = flavio.citations
citations.register("fakename:2020abc")
self.assertIn("fakename:2020abc", citations.set)
citations.clear()
self.assertNotIn("fakename:2020abc", citations.set)
self.assertNotIn("Straub:2018kue", citations.set)

def test_theory_citations(self):
DGs_citations = flavio.Observable["DeltaGamma_s"].theory_citations()
self.assertNotIn("Straub:2018kue", DGs_citations)
self.assertIn("Beneke:2003az", DGs_citations)

def test_bad_inspirekey(self):
with self.assertRaises(KeyError):
flavio.citations.register("bad:inspirekey")
MJKirk marked this conversation as resolved.
Show resolved Hide resolved

def test_multithread(self):
obs = ("DeltaGamma_s", "m_W")
flavio.citations.reset()
flavio.sm_covariance(obs, threads=1)
cites_singlethread = flavio.citations.set
flavio.citations.reset()
flavio.sm_covariance(obs, threads=4)
cites_multithread = flavio.citations.set
self.assertSetEqual(cites_singlethread, cites_multithread)