B
    ú‹d§«  ã               @   sœ   d Z ddlZddlZddlZddlZddlZddlmZm	Z	 ddl
mZ ddlmZmZ ddlmZmZmZmZmZmZmZmZmZ dgZG d	d„ dƒZdS )
zˆ
The base `Sampler` class containing various helpful functions. All other
samplers inherit this class either explicitly or implicitly.

é    Né   )ÚResultsÚprint_fn)ÚUnitCube)Úsample_unifÚSamplerArgument)	Úget_seed_sequenceÚget_print_funcÚprogress_integrationÚIteratorResultÚ	RunRecordÚget_neff_from_logwtÚcompute_integralsÚ
DelayTimerÚ	_LOWL_VALÚSamplerc               @   s   e Zd ZdZd2dd„Zdd„ Zdd	„ Zd
d„ Zdd„ Zd3dd„Z	dd„ Z
dd„ Zdd„ Zedd„ ƒZedd„ ƒZedd„ ƒZd4dd„Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zddd)ejejd*d*d*df	d+d,„Zdddejdd*d*dd*dd-dfd.d/„Zd5d0d1„ZdS )6r   a8  
    The basic sampler object that performs the actual nested sampling.

    Parameters
    ----------
    loglikelihood : function
        Function returning ln(likelihood) given parameters as a 1-d `~numpy`
        array of length `ndim`.

    prior_transform : function
        Function transforming a sample from the a unit cube to the parameter
        space of interest according to the prior.

    npdim : int, optional
        Number of parameters accepted by `prior_transform`.

    live_points : list of 3 `~numpy.ndarray` each with shape (nlive, ndim)
        Initial set of "live" points. Contains `live_u`, the coordinates
        on the unit cube, `live_v`, the transformed variables, and
        `live_logl`, the associated loglikelihoods.

    update_interval : int
        Only update the bounding distribution every `update_interval`-th
        likelihood call.

    first_update : dict
        A dictionary containing parameters governing when the sampler should
        first update the bounding distribution from the unit cube to the one
        specified by the user.

    rstate : `~numpy.random.Generator`
        `~numpy.random.Generator` instance.

    queue_size: int
        Carry out likelihood evaluations in parallel by queueing up new live
        point proposals using (at most) this many threads/members.

    pool: pool
        Use this pool of workers to execute operations in parallel.

    use_pool : dict, optional
        A dictionary containing flags indicating where the provided `pool`
        should be used to execute operations in parallel.

    r   Fc             C   sÖ  || _ || _|| _|| _|| _|d d… \| _| _| _|rF|d | _nd | _t	| jƒ| _
tj| j
td| _tj| j
td| _|| _d | _d | _i | _|	| _| jd kr¬t| _n|	j| _|
| _|
 dd¡| _|
 dd¡| _|
 dd¡| _|
 dd¡| _| jr|| _nd| _g | _d	| _d	| _ d	| _!d| _"| j
| _#t$ %| j
d
 | j
 ¡| _&d| _'d| _(d| _)d| _*d| _+|| _,| dd| j
 ¡| _-| dd¡| _.d | _/d| _0t1| jƒg| _2d| _3d	| _4|| _5d| _6d | _7d | _8t9ƒ | _:d S )Né   )ÚdtypeÚprior_transformTÚloglikelihoodÚpropose_pointZupdate_boundr   r   g      ð?Fg        Ú Z	min_ncallé   Zmin_effg      $@);r   r   ÚnpdimÚncdimÚblobÚlive_uÚlive_vÚ	live_loglÚ
live_blobsÚlenÚnliveÚnpÚzerosÚintÚ
live_boundÚlive_itÚrstateÚscaleÚmethodÚkwargsÚpoolÚmapÚMÚuse_poolÚgetÚuse_pool_ptformZuse_pool_loglÚuse_pool_evolveZuse_pool_updateÚ
queue_sizeÚqueueÚnqueueÚunusedÚusedÚitÚncallÚmathÚlogÚdlvÚ
added_liveÚeffÚciteÚsave_samplesÚsave_boundsÚbound_update_intervalÚfirst_bound_update_ncallÚfirst_bound_update_effÚlogl_first_updateÚunit_cube_samplingr   ÚboundÚnboundÚncall_at_last_updateÚlogvol_initÚplateau_modeÚplateau_counterÚplateau_logdvolr   Ú	saved_run)Úselfr   r   r   Zlive_pointsZupdate_intervalZfirst_updater'   r2   r+   r.   r   rI   r   © rO   ú\/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/dynesty/sampler.pyÚ__init__G   sl    
zSampler.__init__c             C   s   t dƒ‚d S )NzShould be overriden)ÚRuntimeError)rN   ÚfnamerO   rO   rP   ÚsaveŸ   s    zSampler.savec             G   s   t dƒ‚d S )NzShould be overriden)rR   )rN   ÚargsrO   rO   rP   r   ¢   s    zSampler.propose_pointc             G   s   t dƒ‚d S )NzShould be overriden)rR   )rN   rU   rO   rO   rP   Úevolve_point¥   s    zSampler.evolve_pointc             O   s   t dƒ‚d S )NzShould be overriden)rR   )rN   rU   r*   rO   rO   rP   Úupdate_proposal¨   s    zSampler.update_proposalNc             C   s   t dƒ‚d S )NzShould be overriden)rR   )rN   ÚsubsetrO   rO   rP   Úupdate«   s    zSampler.updatec             C   s   || _ d | _t| _d S )N)Ú__dict__r+   r,   r-   )rN   ÚstaterO   rO   rP   Ú__setstate__®   s    zSampler.__setstate__c             C   s*   | j  ¡ }xdD ]}||kr||= qW |S )z#Get state information for pickling.)r-   r+   )rZ   Úcopy)rN   r[   ÚkrO   rO   rP   Ú__getstate__³   s
    


zSampler.__getstate__c          	   C   s  | j j| j| jfd| _| jrBt t|  	| j
t | j¡¡ƒ¡| _n t tt| j
t | j¡ƒƒ¡| _t dd„ | j t | j¡¡D ƒ¡| _tj| jtd| _tj| jtd| _g | _d| _d| _d| _d| _| j| _t| jƒg| _d| _d| _d| _d| _ d	| _!d	| _"t#ƒ | _$d	S )
zRe-initialize the sampler.)Úsizec             S   s   g | ]
}|j ‘qS rO   )Úval)Ú.0Ú_rO   rO   rP   ú
<listcomp>Ê   s    z!Sampler.reset.<locals>.<listcomp>)r   r   r   TFN)%r'   Úrandomr!   r   r   r0   r"   ÚarrayÚlistr-   r   Úasarrayr   r,   r   r   r#   r$   r%   r&   r3   r4   r5   r6   r7   r8   r   r   rF   rG   rE   r<   rJ   rK   rL   r   rM   )rN   rO   rO   rP   Úreset¼   s0     "zSampler.resetc          	   C   s|  i }x dD ]}t  | j| ¡||< q
W | jrøt ¡ ¼ t d¡ d| jfd| jd fd|d fd| j	fd	|d
 fd|d fg}x"dD ]}| 
d| || f¡ q„W xdD ]}| 
||| f¡ q¨W | 
dt  |d ¡f¡ | 
d|d f¡ W dQ R X ntdƒ‚| jrt| 
dt | j¡f¡ | 
dt j| jd tdf¡ | 
dt j| jd tdf¡ | 
dt  | jd ¡f¡ t|ƒS )zrSaved results from the nested sampling run. If bounding
        distributions were saved, those are also returned.)ÚncÚvÚidr7   ÚuÚlogwtÚloglÚlogvolÚlogzÚlogzvarÚhr   Úignorer!   Zniterr   r8   rj   r=   Zsamplesrk   r   )rl   r7   rm   Zsamples_)rn   ro   rp   rq   Zlogzerrrr   Úinformationrs   NzYou didn't save any samples!rF   Z
bound_iterÚ	bounditer)r   Zsamples_boundÚboundidxr(   )r"   rf   rM   r?   ÚwarningsÚcatch_warningsÚsimplefilterr!   r7   r=   ÚappendÚsqrtÚ
ValueErrorr@   r]   ÚdeepcopyrF   r$   r   )rN   Údr^   ÚresultsrO   rO   rP   r€   ä   s2    




zSampler.resultsc             C   s<   | j d }t|ƒdks&t t |¡¡r*dS tt |¡ƒS dS )a  
        Estimate the effective number of posterior samples using the Kish
        Effective Sample Size (ESS) where `ESS = sum(wts)^2 / sum(wts^2)`.
        Note that this is `len(wts)` when `wts` are uniform and
        `1` if there is only one non-zero element in `wts`.

        rn   r   N)rM   r    r"   ZisneginfÚmaxr   rh   )rN   rn   rO   rO   rP   Ún_effective  s    	
zSampler.n_effectivec             C   s   | j S )zw
        Return list of papers that should be cited given the specified
        configuration of the sampler.

        )r>   )rN   rO   rO   rP   Ú	citations  s    zSampler.citationsc       	      C   sÎ   |dkr| j }|| jk}|| j| j k}| j| jk }| jrB|rB|sj| jsL|sj| jrf| jdk	rf|| jksj|rÊ|tkr~| j	|k}nt
dƒ}| j|d}| jr¤| j |¡ |  jd7  _|| _| jrÊd| _|| _dS )z¼
        Here we update the bound depending on the situation
        The arguments are the loglstar and number of calls
        if force is true we update the bound no matter what
        N)rX   r   F)r8   rB   rA   rH   r=   rC   rE   rD   r   r   ÚslicerY   r@   rF   r{   rG   )	rN   Úloglstarr8   ÚforceZcall_check_firstZ
call_checkZefficiency_checkrX   rF   rO   rO   rP   Úupdate_bound_if_needed&  s*    



zSampler.update_bound_if_neededc             C   s”  | j dkr:t | j|k¡d f}t|d ƒdkr>tdƒ‚nd}| js–g }g }| j}x¨| j| j	k r’| j
|Ž \}}| |¡ | |¡ |  jd7  _qTW nf| jj| j	| j | jfd}t | j¡ddd…dd…f t | j	| j ¡dd…ddf  }t}| j	| _| j	dkrt| j| j	ƒ}n| jg}| jr0| j}	nt}	g }xFt| j	ƒD ]8}
| t||
 |||
 | j| j| j||
 | jd¡ qDW t|	||ƒƒ| _dS )	z7Sequentially add new live point proposals to the queue.Zunifr   z©No live points are above loglstar. Do you have a likelihood plateau ? It is also possible that you are trying to sample excessively around the very peak of the posteriorrO   r   )r`   N)rm   r…   Úaxesr(   r   r   Zrseedr*   )r)   r"   Znonzeror   r    rR   rE   rV   r4   r2   r   r{   r'   re   r   Úidentityr   r#   r   r   r1   r-   r,   Úranger   r(   r   r   r*   rg   r3   )rN   r…   rU   Zpoint_queueZ
axes_queuerV   Úpointrˆ   ZseedsZmapperÚirO   rO   rP   Ú_fill_queueP  sP    



 zSampler._fill_queuec             C   sT   | j dkr|  |¡ | j d¡\}}}}}|  jd7  _|  j d8  _ |||||fS )z0Grab the first live point proposal in the queue.r   r   )r4   r   r3   Úpopr6   )rN   r…   rm   rk   ro   rj   r   rO   rO   rP   Ú_get_point_value  s    

zSampler._get_point_valuec       	      C   s„   | j }d}xl|  |¡\}}}}}||7 }||7 }|dk	rR| jsR| j|| jdkd | jdkrj| j||d ||krP qW ||||fS )zjPropose points until a new point that satisfies the log-likelihood
        constraint `loglstar` is found.r   N)rY   )r8   )r8   r   rE   rW   r4   r‡   )	rN   r…   r8   Zncall_accumrm   rk   ro   rj   r   rO   rO   rP   Ú
_new_point  s    
zSampler._new_pointc             c   s˜  | j rtdƒ‚nd| _ t| jd ƒdkrp| jd d }| jd d }| jd d }| jd d }| jd	 d }nd
}d}d
}| j}d}| js²t dt | j	¡d | j	d   ¡}ndt 
dt | j¡ t | j| ¡  ¡}| j	| j }t ||d t 
dt |¡  |d  ¡ g¡}tj|dd }||7 }t | j¡}	t| jƒ}
| jsX| jd }nd}x4t| j	ƒD ]$}|	| }|| ||  }}| j|  ¡ }| j|  ¡ }| jr¾| j|  ¡ }nd}| j| }| j| }| j| }t|||||||ƒ\}}}}|}t d|
| | ¡}| jrL| j  t!|||||||||d|||| j"|d¡ d| j#|  | j$ | _%t&|||||||||d||||| j%|dV  qjW dS )z½Add the remaining set of live points to the current set of dead
        points. Instantiates a generator that will be called by
        the user. Returns the same outputs as :meth:`sample`.zIThe remaining live points have already been added to the list of samples!Trq   r   éÿÿÿÿrr   rs   ro   rp   g        gœu ˆ<ä7þg      ð?r   )ÚprependN)rl   rm   rk   ro   rp   rn   rq   rr   rs   rj   rw   r7   rv   r(   r   g      Y@)ÚworstÚustarÚvstarr…   rp   rn   rq   rr   rs   rj   r   Úworst_itrw   rv   r=   Ú
delta_logz)'r<   r}   r    rM   rI   rJ   r"   r:   Zaranger!   Úlog1prK   ÚexprL   ZconcatenateÚdiffZargsortr   r   rE   rG   rŠ   r   r]   r   r   r   r%   r&   r
   Ú	logaddexpr?   r{   Údictr(   r7   r8   r=   r   )rN   rq   rr   rs   r…   rp   ZlogvolsZnrestZdlvsZ	lsort_idxZloglmaxrv   rŒ   Úidxr;   r”   r•   Úold_blobÚloglstar_newrw   Zpoint_itrn   r—   rO   rO   rP   Úadd_live_points¿  s     

*





zSampler.add_live_pointsc             C   sB   | j r6d| _ | jr>x*dD ]}| j| | j d…= qW ntdƒ‚dS )zlRemove the final set of live points if they were
        previously added to the current set of dead points.F)rl   rm   rk   ro   rp   rn   rq   rr   rs   rj   rw   r7   rv   r(   Nz1No live points were added to the list of samples!)r<   r?   rM   r!   r}   )rN   r^   rO   rO   rP   Ú_remove_live_pointsF  s    
zSampler._remove_live_pointsg{®Gáz„?Tc
       %      #   s$  |dkrt j}|dkrt j}|ˆ _|ˆ _d}
ˆ jdksHtˆ jd ƒdkrdd}d}d}ˆ j}d}d}nJˆ jrv|	svˆ  	¡  ‡ fdd	„d
D ƒ\}}}}}t
 dt
 ˆ j¡| | ¡}d}d}xftt jƒD ]V}||krÖd}|
|krâd}t
 dt
 ˆ j¡| | ¡}|dk	r||k rd}||kr$d}|dk	r~t
 |¡s~ˆ j}||kr~|rpˆ jdd ˆ j}ˆ  	¡  dˆ _||kr~d}ˆ j ¡ dkrœt d¡ d}|rÊˆ jsÈt|||||d}ˆ j |¡ P t
 ˆ j¡}ˆ j| }ˆ j| }ˆ js6ˆ jˆ j| k ¡ }|dkr6dˆ _|ˆ _t
 dˆ jd  ¡| ˆ _ˆ jsFˆ j }nt
 !t
 "ˆ j| ¡ ¡ }|dksnt#‚||8 }ˆ j$|  %¡ }ˆ j&|  %¡ }ˆ j| }ˆ j'r´ˆ j(|  %¡ }nd}ˆ  )|¡\}}} }!|
|!7 }
ˆ  j*|!7  _*ˆ j'rð| j'}"nd}"t+|||||||ƒ\}#}}}|}ˆ j,s(ˆ j-d }$nd}$ˆ jrbˆ j t||||||#||||!||$ˆ j.|d¡ |ˆ j$|< |ˆ j&|< | ˆ j|< |$ˆ j|< ˆ jˆ j|< ˆ j'r¨|"ˆ j(|< dˆ j ˆ j* ˆ _/ˆ  jd7  _ˆ jrðˆ  jd8  _ˆ jdkrðdˆ _t0||||||#||||!||||$ˆ j/|dV  qÄW dS )a,  
        **The main nested sampling loop.** Iteratively replace the worst live
        point with a sample drawn uniformly from the prior until the
        provided stopping criteria are reached. Instantiates a generator
        that will be called by the user.

        Parameters
        ----------
        maxiter : int, optional
            Maximum number of iterations. Iteration may stop earlier if the
            termination condition is reached. Default is `sys.maxsize`
            (no limit).

        maxcall : int, optional
            Maximum number of likelihood evaluations. Iteration may stop
            earlier if termination condition is reached. Default is
            `sys.maxsize` (no limit).

        dlogz : float, optional
            Iteration will stop when the estimated contribution of the
            remaining prior volume to the total evidence falls below
            this threshold. Explicitly, the stopping criterion is
            `ln(z + z_est) - ln(z) < dlogz`, where `z` is the current
            evidence from all saved samples and `z_est` is the estimated
            contribution from the remaining volume. Default is `0.01`.

        logl_max : float, optional
            Iteration will stop when the sampled ln(likelihood) exceeds the
            threshold set by `logl_max`. Default is no bound (`np.inf`).

        n_effective: int, optional
            Minimum number of effective posterior samples. If the estimated
            "effective sample size" (ESS) exceeds this number,
            sampling will terminate. Default is no ESS (`np.inf`).

        add_live : bool, optional
            Whether or not to add the remaining set of live points to
            the list of samples when calculating `n_effective`.
            Default is `True`.

        save_bounds : bool, optional
            Whether or not to save past distributions used to bound
            the live points internally. Default is `True`.

        save_samples : bool, optional
            Whether or not to save past samples from the nested sampling run
            (along with other ancillary quantities) internally.
            Default is `True`.

        Returns
        -------
        worst : int
            Index of the live point with the worst likelihood. This is our
            new dead point sample.

        ustar : `~numpy.ndarray` with shape (npdim,)
            Position of the sample.

        vstar : `~numpy.ndarray` with shape (ndim,)
            Transformed position of the sample.

        loglstar : float
            Ln(likelihood) of the sample.

        logvol : float
            Ln(prior volume) within the sample.

        logwt : float
            Ln(weight) of the sample.

        logz : float
            Cumulative ln(evidence) up to the sample (inclusive).

        logzvar : float
            Estimated cumulative variance on `logz` (inclusive).

        h : float
            Cumulative information up to the sample (inclusive).

        nc : int
            Number of likelihood calls performed before the new
            live point was accepted.

        worst_it : int
            Iteration when the live (now dead) point was originally proposed.

        boundidx : int
            Index of the bound the dead point was originally drawn from.

        bounditer : int
            Index of the bound being used at the current iteration.

        eff : float
            The cumulative sampling efficiency (in percent).

        delta_logz : float
            The estimated remaining evidence expressed as the ln(ratio) of the
            current evidence.

        Nr   r   ro   g        gœu ˆ<ä7þgœu ˆ<ä7~c                s   g | ]}ˆ j | d  ‘qS )r‘   )rM   )rb   rc   )rN   rO   rP   rd   à  s   z"Sampler.sample.<locals>.<listcomp>)rs   rq   rr   rp   ro   FT)Úprint_progresszFWe have reached the plateau in the likelihood we are stopping sampling)rq   rr   rs   rp   ro   g      ð?)rl   rm   rk   ro   rp   rn   rq   rr   rs   rj   r7   rv   r(   r   g      Y@)r“   r”   r•   r…   rp   rn   rq   rr   rs   rj   r   r–   rw   rv   r=   r—   )1ÚsysÚmaxsizer?   r@   r7   r    rM   rI   r<   r¡   r"   r›   r   r   rŠ   Zisposinfr‚   Úadd_final_liveZptprx   Úwarnrœ   r{   Zargminr&   r%   rJ   ÚsumrK   r:   r!   rL   r;   r˜   r™   ÚAssertionErrorr   r]   r   r   r   r   r8   r
   rE   rG   r(   r=   r   )%rN   ÚmaxiterÚmaxcallÚdlogzÚlogl_maxr‚   Úadd_liver@   r?   Úresumer8   rs   rq   rr   rp   r…   r—   ZnplateauZstop_iterationsr7   Zcurrent_n_effectiveZadd_infor“   r–   rw   Zcur_dlvr”   r•   rŸ   rž   rm   rk   ro   rj   Znew_blobrn   rv   rO   )rN   rP   ÚsampleW  s   p















zSampler.sampleé<   c             C   sî  |dk	r2t  ¡  t  d¡ t  dt¡ W dQ R X |dkrV|rRd| jd  d }nd}|rn| jrnt  d¡ dS t||ƒ\}}|
dk	rŒt|ƒ}z<| j	}xpt
| j|||||	d|||d		ƒD ]L\}}||j7 }|rê| jd
 }||||||d |
dk	r¸| ¡ r¸|  |
¡ q¸W |r\| jd
 }xBt
|  ¡ ƒD ]2\}}||j7 }|r&|||||d
 ||d q&W t| jd | jd d\}}}}| ¡ | jd< | ¡ | jd< | ¡ | jd< | ¡ | jd< |
dk	rÈ|  |
¡ W d|dk	rÞ| ¡  | j ¡  X dS )aU  
        **A wrapper that executes the main nested sampling loop.**
        Iteratively replace the worst live point with a sample drawn
        uniformly from the prior until the provided stopping criteria
        are reached.

        Parameters
        ----------
        maxiter : int, optional
            Maximum number of iterations. Iteration may stop earlier if the
            termination condition is reached. Default is `sys.maxsize`
            (no limit).

        maxcall : int, optional
            Maximum number of likelihood evaluations. Iteration may stop
            earlier if termination condition is reached. Default is
            `sys.maxsize` (no limit).

        dlogz : float, optional
            Iteration will stop when the estimated contribution of the
            remaining prior volume to the total evidence falls below
            this threshold. Explicitly, the stopping criterion is
            `ln(z + z_est) - ln(z) < dlogz`, where `z` is the current
            evidence from all saved samples and `z_est` is the estimated
            contribution from the remaining volume. If `add_live` is `True`,
            the default is `1e-3 * (nlive - 1) + 0.01`. Otherwise, the
            default is `0.01`.

        logl_max : float, optional
            Iteration will stop when the sampled ln(likelihood) exceeds the
            threshold set by `logl_max`. Default is no bound (`np.inf`).

        n_effective: int, optional
            Minimum number of effective posterior samples. If the estimated
            "effective sample size" (ESS) exceeds this number,
            sampling will terminate. Default is no ESS (`np.inf`).
            This option is deprecated and will be removed in a future release.

        add_live : bool, optional
            Whether or not to add the remaining set of live points to
            the list of samples at the end of each run. Default is `True`.

        print_progress : bool, optional
            Whether or not to output a simple summary of the current run that
            updates with each iteration. Default is `True`.

        print_func : function, optional
            A function that prints out the current state of the sampler.
            If not provided, the default :meth:`results.print_fn` is used.

        save_bounds : bool, optional
            Whether or not to save past bounding distributions used to bound
            the live points internally. Default is *True*.

        checkpoint_file: string, optional
            if not None The state of the sampler will be saved into this
            file every checkpoint_every seconds

        checkpoint_every: float, optional
            The number of seconds between checkpoints that will save
            the internal state of the sampler. The sampler will also be
            saved in the end of the run irrespective of checkpoint_every.
        NÚoncezaThe n_effective option to Sampler.run_nested is deprecated and will be removed in future releasesgü©ñÒMbP?g      ð?g{®Gáz„?zAYou are resuming a finished static run. This will not do anythingT)	r©   rª   r«   r¬   r@   r?   r‚   r®   r­   r   )r«   r¬   )Úadd_live_itr«   r¬   ro   rp   )ro   rp   rn   rq   rr   rs   )rx   ry   Úfilterwarningsr¦   ÚDeprecationWarningr!   r<   r	   r   r8   Ú	enumerater¯   rj   r7   Zis_timerT   r    r   rM   ÚtolistÚcloser   Zhistory_save)rN   r©   rª   r«   r¬   r‚   r­   r¢   Ú
print_funcr@   Zcheckpoint_fileZcheckpoint_everyr®   ÚpbarÚtimerr8   r7   r€   rŒ   Z	new_logwtZnew_logzZnew_logzvarZnew_hrO   rO   rP   Ú
run_nested  sx    N









zSampler.run_nestedc             C   sz   |dkrt }t||ƒ\}}zH| j}| jd }x2t|  ¡ ƒD ]"\}}|r:|||||d dd q:W W d|dk	rt| ¡  X dS )ao  
        **A wrapper that executes the loop adding the final live points.**
        Adds the final set of live points to the pre-existing sequence of
        dead points from the current nested sampling run.

        Parameters
        ----------
        print_progress : bool, optional
            Whether or not to output a simple summary of the current run that
            updates with each iteration. Default is `True`.

        print_func : function, optional
            A function that prints out the current state of the sampler.
            If not provided, the default :meth:`results.print_fn` is used.

        Nr   g{®Gáz„?)r²   r«   )r   r	   r8   r7   rµ   r    r·   )rN   r¢   r¸   r¹   r8   r7   rŒ   r€   rO   rO   rP   r¥   0  s    
zSampler.add_final_live)r   F)N)NF)TN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rQ   rT   r   rV   rW   rY   r\   r_   ri   Úpropertyr€   r‚   rƒ   r‡   r   r   r   r    r¡   r"   Úinfr¯   r»   r¥   rO   rO   rO   rP   r      s\   - 
K
	((

*?"   3 )r¿   r£   rx   r9   r]   Únumpyr"   r€   r   r   Zboundingr   Zsamplingr   r   Úutilsr   r	   r
   r   r   r   r   r   r   Ú__all__r   rO   rO   rO   rP   Ú<module>   s   ,