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

Discuss format for parameters #7

Open
Stefan-Heimersheim opened this issue Aug 7, 2020 · 2 comments
Open

Discuss format for parameters #7

Stefan-Heimersheim opened this issue Aug 7, 2020 · 2 comments
Assignees

Comments

@Stefan-Heimersheim
Copy link
Collaborator

Do we want all parameters in a single dictionary or separate e.g. theory_params and bias_params?

  • If they are all in one dictionary we cannot (easily) give each function just the parameters it wants -- this is relevant if models complain if they get too many parameters
  • If they are separated it is difficult to handle parameters used by theory and bias model (are there any?)

Should a function care if it gets too many (i.e. wrong) parameters?

  • If they do they can check if any parameters are left over
  • Doesn't work well with single param dictionary, theory would need to give list of parameters it needs
  • Doesn't work well if different theory models require different parameters

Should parameters be keyword arguments (**kwargs) or dictionaries?

  • Keywords have stricter naming rules (you can have dictionary keys '100*theta_s', that can't be an argument)
  • Keywords allow you to know what parameters a function expects [but this is hard to use in an automated way!]
  • The likelihood could not distinguish keyword arguments meant for theory or bias model

We probably want to copy() (or deepcopy()) the dictionaries before we pass them to functions, especially if we reuse them. Otherwise an external function (e.g. theory_func) messing up parameters is very annoying to debug, in my experience ;)

@aewallwi
Copy link
Collaborator

It seems like we are going with dictionaries because it allows for us to more easily pass separate chunks of paramters (lets us distinguish between nuisance and astrophysical params for example).

We are going to leave parameter checking to the theory function (add a docstring warning the users).

@aewallwi
Copy link
Collaborator

Also add support for feeding parameters as a list or a dictionary.

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