Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib
/
python3.5
/
site-packages
/
joblib
/
__pycache__
/
File Content:
numpy_pickle.cpython-35.opt-1.pyc
��X�Z � @ s� d Z d d l Z d d l Z d d l Z d d l Z y d d l m Z Wn e k rd d Z Yn Xd d l m Z d d l m Z d d l m Z m Z d d l m Z m Z d d l m Z m Z d d l m Z d d l m Z d d l m Z d d l m Z m Z Gd d � d e � Z Gd d � d e � Z Gd d � d e � Z d d d d d � Z d d d d � Z d d d � Z d S)zFUtilities for fast persistence of big data, with optional compression.� N)�Path� )�_COMPRESSORS)�BinaryZlibFile)� Unpickler�Pickler)�_read_fileobject�_write_fileobject)�_read_bytes�BUFFER_SIZE)�load_compatibility)�NDArrayWrapper)�ZNDArrayWrapper)�_basestring�PY3_OR_LATERc @ sU e Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z d S)�NumpyArrayWrapperap An object to be persisted instead of numpy arrays. This object is used to hack into the pickle machinery and read numpy array data from our custom persistence format. More precisely, this object is used for: * carrying the information of the persisted array: subclass, shape, order, dtype. Those ndarray metadata are used to correctly reconstruct the array with low level numpy functions. * determining if memmap is allowed on the array. * reading the array bytes from a file. * reading the array using memorymap from a file. * writing the array bytes to a file. Attributes ---------- subclass: numpy.ndarray subclass Determine the subclass of the wrapped array. shape: numpy.ndarray shape Determine the shape of the wrapped array. order: {'C', 'F'} Determine the order of wrapped array data. 'C' is for C order, 'F' is for fortran order. dtype: numpy.ndarray dtype Determine the data type of the wrapped array. allow_mmap: bool Determine if memory mapping is allowed on the wrapped array. Default: False. Fc C s1 | | _ | | _ | | _ | | _ | | _ d S)z4Constructor. Store the useful information for later.N)�subclass�shape�order�dtype� allow_mmap)�selfr r r r r � r �/numpy_pickle.py�__init__@ s zNumpyArrayWrapper.__init__c C s� t d | j d � } | j j r>