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

Allow efac/log10_tneqad to be None in ndiag functions #379

Closed
wants to merge 1 commit into from

Conversation

mattpitkin
Copy link

In white_signals.py, the *_ndiag functions fail if they get passed None values. This happens, for example, if the white_noise_block in
enterprise_extensions has vary=False, and therefore efac/equad/ecorr are set to Constant parameters, which have default values of None.

The two potential fixes are the one in this PR, i.e., allow None values, which for efac_ndiag is equivalent to having efac=1.0, and set tneqad_ndiag to zeros if passed None. The other fix would be to specify values for the Constantsin thewhite_noise_block` in
enterprise_extensions, e.g.,:

        efac = parameter.Constant(1.0)
        equad = parameter.Constant(-np.inf)
        if inc_ecorr:
            ecorr = parameter.Constant(-np.inf)

  in the *_ndiag functions, if they get passed None values they fail.
  This happens, for example, if the white_noise_block in
enterprise_extensions https://github.com/nanograv/enterprise_extensions/blob/master/enterprise_extensions/blocks.py has vary=False, and therefore efac/equad/ecorr are set to Constant parameters,
which have default values of None.
@vallis
Copy link
Collaborator

vallis commented Mar 5, 2024

These functions expect numerical values, and they have even defaults for them. I am not sure it's appropriate to give them flow branches to handle None. (Doing so, among other things, may prevent code compilation in some frameworks.) I would prefer a fix in e_e.

@mattpitkin
Copy link
Author

@vallis No problem. I'll close this and submit a PR for enterprise_extensions.

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

Successfully merging this pull request may close these issues.

2 participants