Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
96129 views
�
�j�U��@sddlmZddljZddljZddlZddlZ	ddl
Z
ddlmZe
j
jdd�dd�Ze�dd�Zd	d
�Zddd
d�Zedddd��Zedd��Zedd��Zdd�Zdd�Zdddd�ZdS)�)�HTMLN)�contextmanagerz./codecCs�ddl}dddg}|j}|jd�}x4t|�D]&\}}t|�||kr@dSq@Wt|�d}||t||�kr�tdj|���nt|dd�}dS)Nr��.�z{Minimum FilterPy version supported is {}.{}.{}.
Please install a more recent version.
   ex: pip install filterpy --upgradei�)�filterpy�__version__�split�	enumerate�int�len�	Exception�format)r�min_version�v�tokens�i�r�c/projects/bc0fb916-c36a-47ed-9b82-acd90c187370/Kalman-and-Bayesian-Filters-in-Python/book_format.py�test_filterpy_version
s		rcCsdtjd<tjd�dS)N�
zfigure.figsize�equal)rr)�pylab�rcParams�plt�axisrrrr�
equal_axis%s
rcCsdtjd<dS)N��zfigure.figsize)rr)rrrrrr�
reset_axis*srrrcCs||ftjd<dS)Nzfigure.figsize)rr)�x�yrrr�set_figsize-sr"ccs0tjd}t||�dV|tjd<dS)z:Temporarily set the figure size using 'with figsize(a,b):'zfigure.figsizeN)rrr")r r!�sizerrr�figsize1s

r$ccs6tj�d}tjd|�dVtj|�dS)N�	precision)�np�get_printoptions�set_printoptions)r%�oldrrr�numpy_precision:sr*cos2tj�}tj||�dVtj|�dS)N)r&r'r()�args�kwargs�originalrrr�printoptionsAsr.cCs�g}xx|D]p}t|t�r4|jd�}n<t|t�rRt|�}nt|t�rpt|�}n|j|�q
W|S)Nzutf-8)�
isinstance�unicode�encode�list�_decode_list�dict�_decode_dict�append)�data�rv�itemrrrr3Hs
r3cCs�i}x�|j�D]�\}}t|t�r@|jd�}nt|t�ra|jd�}n<t|t�rt|�}nt|t�r�t|�}n|||<qW|S)Nzutf-8)�	iteritemsr/r0r1r2r3r4r5)r7r8�key�valuerrrr5Tsr5rz/styles/custom2.csscCs�tjddkr/tjt|d��}ntjt|d�dt�}tjj|�t	�t
jdd�t||d�j�}t
|�S)Nr�z/code/538.json�object_hook�suppressT�r)�sys�version_info�json�load�openr5rr�updaterr&r(�readr)�	directory�name�s�stylesrrr�
load_stylecsrL)�IPython.core.displayr�matplotlib.pylabr�matplotlib.pyplot�pyplotrrC�numpyr&rA�
contextlibr�path�insertrrrr"r$r*r.r3r5rLrrrr�<module>s&