HOME


sh-3ll 1.0
DIR:/usr/local/lib/python3.6/site-packages/xarray/backends/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/xarray/backends/__pycache__/memory.cpython-36.pyc
3

���h��@sHddlZddlZddlmZddlmZddlmZGdd�de�Z	dS)	�N�)�Variable)�OrderedDict�)�AbstractWritableDataStorecsLeZdZdZd�fdd�	Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�Z
S)�InMemoryDataStorez�
    Stores dimensions, variables and attributes in ordered dictionaries, making
    this store fast compared to stores which save to disk.

    This store exists purely for internal testing purposes.
    Ncs<|dkrt�n||_|dkr"t�n||_tt|�j|�dS)N)r�
_variables�_attributes�superr�__init__)�self�	variables�
attributes�writer)�	__class__��6/tmp/pip-build-5_djhm0z/xray/xarray/backends/memory.pyrszInMemoryDataStore.__init__cCs|jS)N)r	)rrrr�	get_attrsszInMemoryDataStore.get_attrscCs|jS)N)r)rrrr�
get_variablesszInMemoryDataStore.get_variablesFcCs8t|jtj|�|j�}|jj|j�||j|<||jfS)N)	rZdims�npZ
empty_like�attrs�update�encodingr�data)r�k�vZcheck_encodingZnew_varrrr�prepare_variables
z"InMemoryDataStore.prepare_variablecCstj|�|j|<dS)N)�copy�deepcopyr	)rrrrrr�
set_attribute%szInMemoryDataStore.set_attributecCsdS)Nr)r�d�lrrr�
set_dimension)szInMemoryDataStore.set_dimension)NNN)F)�__name__�
__module__�__qualname__�__doc__rrrrrr"�
__classcell__rr)rrrs
r)
rZnumpyrZ
core.variablerZ
core.pycompatr�commonrrrrrr�<module>s