Skip to content

Conversation

@exowanderer
Copy link

[terms.py: Line 221] raises an AttributeError for kernels lacking the _has_jitter flag attribute.

Not all kernels include the flag attribute _has_jitter; and therefore, when multiplying 2 kernels that do not include the _has_jitter flag, the original version of this condition if k1._has_jitter or k2._has_jitter raises an AttributeError: "k1 does not have the attribute _has_jitter" (paraphrased).

By checking if the kernel k1 or k2 has the attribute _has_jitter at all, before checking if it will return True/False mitigates this AttributeError.

[terms.py: Line 221] raises an AttributeError for kernels lacking the `_has_jitter` flag attribute.

Not all kernels include the flag attribute `_has_jitter`; and therefore, when multiplying 2 kernels that do not include the `_has_jitter` flag, the original version of this condition `if k1._has_jitter or k2._has_jitter` raises an AttributeError: "`k1` does not have the attribute `_has_jitter`" (paraphrased).

By checking if the kernel `k1` or `k2` has the attribute `_has_jitter` at all, before checking if it will return True/False mitigates this AttributeError.
@dfm
Copy link
Owner

dfm commented Oct 7, 2020

I know it's been forever, but .....

Which terms wouldn't have that attribute? It's implemented as part of the base class: https://github.com/dfm/celerite/blob/main/celerite/terms.py#L35

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