nessai.proposal.utils

Utilities for proposal classes

Functions

check_proposal_kwargs(ProposalClass, kwargs[, strict])

Check the keyword arguments are correct for a proposal class.

get_region_sampler_proposal_class(proposal_class)

Get the proposal class for the standard region sampler.

Module Contents

nessai.proposal.utils.check_proposal_kwargs(ProposalClass, kwargs, strict=False)

Check the keyword arguments are correct for a proposal class.

Removes any keyword arguments that correspond to another class. Raises an error if the keyword arguments are unknown. For example if the class is FlowProposal, it will remove any keyword arguments that correspond to AugmentedFlowProposal but not raise an error.

Parameters:
ProposalClassType[FlowProposal]

Class to check the keyword arguments against.

kwargsdict

Dictionary of keyword arguments.

strictbool

Raise an error if any extra keyword arguments are provided even if they correspond to other proposals.

Returns:
dict

Dictionary of updated kwargs.

nessai.proposal.utils.get_region_sampler_proposal_class(proposal_class)

Get the proposal class for the standard region sampler.

Parameters:
proposal_classUnion[str, Proposal, None]

The name of the proposal class or the class itself. If not specified, defaults to nessai.proposal.flowpropsoal.FlowProposal.

Returns:
Proposal class