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

Idea for function that gives a citation list for theory predictions #120

Closed
MJKirk opened this issue Oct 8, 2020 · 7 comments
Closed

Idea for function that gives a citation list for theory predictions #120

MJKirk opened this issue Oct 8, 2020 · 7 comments

Comments

@MJKirk
Copy link
Contributor

MJKirk commented Oct 8, 2020

So the basic idea is to allow people to easily cite the original theory papers for each observable they use in flavio.
My rough idea is to copy how all the experimental measurements have an inspire key, and add the same thing to the Observable class.

Roughly, the function would look like

def observable_citations(obs_list):
    return (flavio.Observable[o].inspire for o in obs_list)

and be defined as a top level function in flavio/functions.py

The couple of questions I'm thinking about are:

  1. Would it be nice to also allow giving a Likelihood instance instead of a list of observables for convenience? I'm thinking particularly in terms of a smelli GlobalLikelihood, you don't give a list of observables directly so the user would have to do extra work to get a list to then feed this function. Or is this too much complexity?
  2. Should it really be extended also to measurements as well, so for an observable you get both the theory papers it was calculated in and the experimental papers where measurements were reported?
@peterstangl
Copy link
Collaborator

As a first step, maybe adding an inspire method (or property) to the Observable class is already the most important thing. Then one could already get the citations for a given observable.

And then as a second step, one could think about whether it is actually necessary to include a function that loops over a list of observables, or if such a loop can be easily written by the user. If I think about writing a paper, I might want to have a citation after each observable that I describe there, so then I would not need a loop over a list of observables. And if I automatically generate a table with many measurements and predictions like in the appendix of the smelli paper, then I already have to write a python function that creates this table and I can just include the call to flavio.Observable[o].inspire there and also don't need a function that loops over the list. So I would actually think that adding the method to the Observable class is enough and looping over a list of observables (e.g. also those included in a likelihood) can be done by the user depending on the use case.

@DavidMStraub
Copy link
Contributor

Hi,

I don't think it makes too much sense attaching this to an Observable. After all swapping different Implementations is one of the core principles of the code; even parameter dictionaries (like form factor parameters) might need to be cited (or not).

Actually, a very nice package that I've come across in my current field of occupation has an elegant solution for this: a Citations class that keeps a list of _papers_to_cite. Keeping a global instance citations = Citations(), which can be reset, you simply call Citations.register(my_inspire_key) anywhere in the code where you use something citable.

At the end just do print_citations to get a bibliography.

That code is BSD-3 licensed so you can even just reuse it.

@DavidMStraub
Copy link
Contributor

... and then somebody only has to fix DavidMStraub/inspiretools#7 and everything becomes automatic 🚀

@peterstangl
Copy link
Collaborator

@DavidMStraub thanks, that's a very good idea!

In principle, with such an implementation, one could still think about adding a method to the Observable class with something like

def SM_citations(self, *args):
    Citations.reset()
    flavio.sm_prediction(self.name, *args)
    return Citations.inspire_list

which would just return what one has to cite for the SM prediction of a given observable and it would also work after changing implementations.

@DavidMStraub
Copy link
Contributor

Yes 👍

Although in that case I would rather use a new throwaway instance instead of resetting the global one.

@MJKirk
Copy link
Contributor Author

MJKirk commented Oct 12, 2020

Ooh, that way of doing things look quite elegant, and nice that we can copy the code (joys of open source!).
I'll get started on that then.

@MJKirk
Copy link
Contributor Author

MJKirk commented Nov 3, 2020

We can close this since work is now ongoing in the pull request

@MJKirk MJKirk closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants