Replies: 2 comments 7 replies
-
|
Without thinking super deeply, there seem to be two ways:
Inverting non-monotonic functions is hard. There's lots of kwargs — domain, minimizers, etc — that need to be handled carefully. It seems to me for this reason that option 2, where these details are handled once, is best. However, there should be a means to support method-specific speedups. I think that a dict-cache by function will suffice. So the Cosmology API should cover some aspects of this caching process: the storage, registration, (de-registration ?). So a summary of the API additions are: def redshift_at_value(func: Callable[[Redshift], ReturnArray], val: ReturnArray, ...) -> : ...
INVERSE_METHODS: Mapping[FunctionType, FunctionType] # <- read only
def register_inverse_method(...):What do you think? |
Beta Was this translation helpful? Give feedback.
-
|
On a related note, we should also have an API for interpolated cosmologies. Within a monotonic region this is easily invertible to find the redshift. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can we provide inverse distance functions (= redshift at which distance equals x) in the cosmology API?
CC: @nstarman
Beta Was this translation helpful? Give feedback.
All reactions