a
    iDf4                     @  s  d dl mZ d dlZd dlZd dlmZ d dlmZmZ d dlm	Z	 d dl
mZmZmZ d dlZd dl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 d d	lmZ d d
lm Z m!Z! d dl"m#Z# d dl$m%Z%m&Z&m'Z' d dl(m)Z) d dl*m+Z+ d dl,m-Z- d dl.m/Z/m0Z0 d dl1m2Z2 d dl3m4Z4 zd dl5Z5W n e6yH   dZ5Y n0 erld dl7m8Z8m9Z9 eedf Z:h dZ;de<de<de<de<dd e<dd d e<dd d d dZ=dddddd d!Z>g d"Z?e?d#g Z@eAg d$ZBd%d&d'd(d)ZCd*d+ ZDd%d%d,d-d.ZEd%d%d,d/d0ZFd%d%d1d2d3ZGd%d4d,d5d6ZHd%d7d,d8d9ZId%d%d:d;d<d=d>ZJd?d%d%d?d@dAdBZKd?d%d%d?dCdDdEZLdd%dFd:d?d<dGdHZMdIdJ ZNdKdL ZOd%d?d,dMdNZPd%dOd,dPdQZQd%dRd,dSdTZRd%dUdVdWZSd%dRd,dXdYZTdZdUd[d\ZUd%dUd]d^ZVd%dUd_d`ZWd%dUdadbZXdd&d?dddedfZYdd&d?dddgdhZZdidj Z[d%d:d&dkdldmZ\d%d%d,dndoZ]d%d%d?dpdqdrZ^d?dUdsdtZ_dudv Z`d?d;d?dwdxdyZaddzdFdFd{d|d}d~dZbddzdFdFd{d&d|dddZcdzd%d%d;dzd}ddZddddFdFd{dd}ddZeddzdFd{ddddZfddzdFd{d&ddddZgdzd%d;dzdddZhdddFd{ddddZiG dd deZjG dd deZkdS )    )annotationsN)Hashable)datetime	timedelta)partial)TYPE_CHECKINGCallableUnion)OutOfBoundsDatetimeOutOfBoundsTimedelta)SerializationWarningVariableCoderlazy_elemwise_funcpop_tosafe_setitemunpack_for_decodingunpack_for_encoding)indexing)contains_cftime_datetimesis_np_datetime_like)asarray)first_n_itemsformat_timestamp	last_item)nanosecond_precision_timestamp)emit_user_level_warning)Variable)T_ChunkedArrayget_chunked_array_type)is_chunked_array)is_duck_dask_array)
CFCalendarT_DuckArray>   proleptic_gregorianstandardZ	gregorian   g     @@g    .Ag    eA<      nsusmssmhDi  i@B i l    $'- l    `;P )microsecondsmillisecondssecondsminuteshoursdays)r5   r4   r3   r2   r1   r0   nanoseconds)r5   r4   r3   r2   r1   r0   r6   strbool)calendarreturnc                 C  s   |   tv S N)lower_STANDARD_CALENDARS)r9    r>   `/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/xarray/coding/times.py_is_standard_calendarZ   s    r@   c              
   C  s   t | jrdS t| } |  }|  }zt|tj t|tj W nX tj	j
y\   Y dS  ty } z*|jd dkrW Y d }~dS  W Y d }~nd }~0 0 dS d S )NTFr   zyear 0 is out of range)r   dtypenpr   minmaxconvert_time_or_go_backpd	Timestamperrorsr
   
ValueErrorargs)timesZtminZtmaxerrr>   r>   r?   _is_numpy_compatible_time_range^   s    

rM   )unitsr:   c                 C  s4   |   } | ds|  d} dddddddd|  S )	Nr,   r)   r*   r+   r-   r.   r/   )r6   r0   r1   r2   r3   r4   r5   )r<   endswithrN   r>   r>   r?   _netcdf_to_numpy_timeunitr   s    

rQ   c                 C  s   dddddddd|  S )	Nr6   r0   r1   r2   r3   r4   r5   r(   r>   rP   r>   r>   r?   _numpy_to_netcdf_timeunit   s    rR   )ref_dater:   c                 C  s|   t d| }|r| S t d| }|s2td|  dd | D \}}t|d| }d|  d| d	}t|t |S )
Nz	.*\d{4}.*z	(\d+)(.*)z'invalid reference date for time units: c                 s  s   | ]
}|V  qd S r;   r>   .0r,   r>   r>   r?   	<genexpr>       z&_ensure_padded_year.<locals>.<genexpr>04dz!Ambiguous reference date string: z. The first value is assumed to be the year hence will be padded with zeros to remove the ambiguity (the padded reference date string is: zb). To remove this message, remove the ambiguity by padding your reference date strings with zeros.)rematchrI   groupsintwarningswarnr   )rS   Zmatches_yearZmatches_start_digitsZref_yearZeverything_elseZref_date_paddedZwarning_msgr>   r>   r?   _ensure_padded_year   s    	r_   ztuple[str, str]c                 C  sD   t d| }|std|  dd | D \}}t|}||fS )Nz(.+) since (.+)zinvalid time units: c                 s  s   | ]}|  V  qd S r;   )striprT   r>   r>   r?   rV      rW   z,_unpack_netcdf_time_units.<locals>.<genexpr>)rY   rZ   rI   r[   r_   )rN   matchesZdelta_unitsrS   r>   r>   r?   _unpack_netcdf_time_units   s    rb   ztuple[str, pd.Timestamp]c                 C  s0   t | \}}t|}|jd ur(|d }||fS r;   )rb   r   tzZ
tz_convert)rN   
time_unitsZ	_ref_daterS   r>   r>   r?   _unpack_time_units_and_ref_date   s
    

re   bool | Noneznp.dtype)rN   r9   
use_cftimer:   c           
      C  s   t t | }tt|dp"dgt|p.dgg}zt||||}W nB ty   |d u r`dnd|}d|d|d}t	|Y n0 t
|dtd	}	|	S )
Nr%   r   zthe default calendarz	calendar zunable to decode time units z with z_. Try opening your dataset with decode_times=False or installing cftime if it is not installed.rA   object)r   Z!ImplicitToExplicitIndexingAdapterZas_indexablerB   Zconcatenater   r   decode_cf_datetime	ExceptionrI   getattrrA   )
datarN   r9   rg   valuesZexample_valueresultZcalendar_msgmsgrA   r>   r>   r?   _decode_cf_datetime_dtype   s    rp   z
np.ndarray)	num_datesrN   r9   r:   c                 C  sD   t d u rtd| jdkr2tt j| ||ddS tjg tdS d S )NNo module named 'cftime'r   T)Zonly_use_cftime_datetimesrA   )cftimeModuleNotFoundErrorsizerB   r   Znum2datearrayrh   )rq   rN   r9   r>   r>   r?   _decode_datetime_with_cftime   s    
rx   )flat_num_datesrN   r9   r:   c                 C  sD  t |std|dt|\}}t|}zt|}W n tyN   tY n0 t P tddt	 | j
dkrt|  ||  t|  ||  W d    n1 s0    Y  | jjdv r| tj} t| | ttjjkB }| t|  } tj| tjd}ttjj||< | |  tj|| < t|d| jS )	Nz2Cannot decode times from a non-standard calendar, z, using pandas.ignorezinvalid value encounteredr   iurs   r)   )r@   r
   rb   rQ   r   rI   r]   catch_warningsfilterwarningsRuntimeWarningrv   rF   to_timedeltarC   rD   rA   kindastyperB   int64isnanZiinfo_NS_PER_TIME_DELTAZ
zeros_likerm   )ry   rN   r9   rd   rS   nanZflat_num_dates_ns_intr>   r>   r?   _decode_datetime_with_pandas   s.    



2r   z
str | Nonec                 C  s   t | } |  }|du rd}|du rzt|||}W q ttttfy   t|	t
||}|t |  jdk s|t |  jdkrt|rtjdtdd nt|rt|}Y q0 n|rt|||}nt|||}|| jS )a  Given an array of numeric dates in netCDF format, convert it into a
    numpy array of date time objects.

    For standard (Gregorian) calendars, this function uses vectorized
    operations, which makes it much faster than cftime.num2date. In such a
    case, the returned array will be of type np.datetime64.

    Note that time unit in `units` must not be smaller than microseconds and
    not larger than days.

    See Also
    --------
    cftime.num2date
    Nr$   i  i  zUnable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range   )
stacklevel)rB   r   ravelr   KeyErrorr
   r   OverflowErrorrx   r   floatZ	nanargminyearZ	nanargmaxr@   r]   r^   r   cftime_to_nptimereshapeshape)rq   rN   r9   rg   ry   datesr>   r>   r?   ri   *  s6    
	ri   c                 K  s(   t j| fi | }|jdks$J |S )Ntimedelta64[ns])rF   r   to_numpyrA   valuekwargsrn   r>   r>   r?   to_timedelta_unboxed`  s    r   c                 K  s(   t j| fi | }|jdks$J |S )Ndatetime64[ns])rF   to_datetimer   rA   r   r>   r>   r?   to_datetime_unboxedf  s    r   c                 C  s.   t | } t|}t|  |d}|| jS )znGiven an array of numeric timedeltas in netCDF format, convert it into a
    numpy timedelta64[ns] array.
    )unit)rB   r   rQ   r   r   r   r   )Znum_timedeltasrN   rn   r>   r>   r?   decode_cf_timedeltal  s    
r   r   c                 C  s   t t|  dS )Nr0   )r   _US_PER_TIME_DELTArP   r>   r>   r?   _unit_timedelta_cftimev  s    r   znp.timedelta64c                 C  s   t | }tt| dS )Nr)   )rQ   rB   timedelta64r   )rN   Znumpy_unitsr>   r>   r?   _unit_timedelta_numpyz  s    r   )r:   c                 C  sd   | j t dkr$t}t}tdd}nt}t}tdd}|D ]"}t| || |kr<|  S q<dS )NOr   r   r)   r2   )	rA   rB   _NETCDF_TIME_UNITS_CFTIMEr   r   _NETCDF_TIME_UNITS_NUMPYr   r   all)unique_timedeltasrd   Zunit_timedeltaZzero_timedeltaZ	time_unitr>   r>   r?   _infer_time_units_from_diff  s    
r   c                 C  s   t dt| dS )Nr%   r   )rB   r   rQ   r   rP   r>   r>   r?   _time_units_to_timedelta64  s    r   r!   c                 C  s   t | jrdS | jtdkrv| jdkrvtdurvt| jd }t|rd| }t	|tj
rd| }t	|tjrv|jS tddS )z7Given an array of datetimes, infer the CF calendar namer#   r   r   Nz(Array does not contain datetime objects.)r   rA   rB   rv   rt   r   Zflatr    Zcompute
isinstanceZndarrayitemr   r9   rI   )r   sampler>   r>   r?   infer_calendar_name  s    
r   c                 C  s   t |  } t | jdkrVt| } | t|  } t| dkrH| d nd}t|}n t| dkrj| d nd}t	|}t 
t | }t|}| d| S )a  Given an array of datetimes, returns a CF compatible time-unit string of
    the form "{time_unit} since {date[0]}", where `time_unit` is 'days',
    'hours', 'minutes' or 'seconds' (the first one that can evenly divide all
    unique time deltas in `dates`)
    r   r   z
1970-01-01 since )rB   r   r   rA   r   rF   notnulllenr   format_cftime_datetimeuniquediffr   )r   Zreference_dater   rN   r>   r>   r?   infer_datetime_units  s    
r   c                 C  sH   | j dd| jdd| jdd| jdd| jdd| jdd| jdS )zbConverts a cftime.datetime object to a string with the format:
    YYYY-MM-DD HH:MM:SS.UUUUUU
    rX   -Z02d :.Z06d)r   monthdayhourminutesecondmicrosecond)dater>   r>   r?   r     s    r   c                 C  s.   t t|  } t| t|  }t|S )zGiven an array of timedeltas, returns a CF compatible time-unit from
    {'days', 'hours', 'minutes' 'seconds'} (the first one that can evenly
    divide all unique time deltas in `deltas`)
    )r   rB   r   r   r   rF   r   r   )deltasr   r>   r>   r?   infer_timedelta_units  s    r   T)raise_on_invalidr:   c                 C  s   t | } t j| jdd}t | D ]\}}z&t|j|j|j|j	|j
|j|j}W nD ty } z,|r~td| d| dnd}W Y d}~n
d}~0 0 t |||< q$|S )zGiven an array of cftime.datetime objects, return an array of
    numpy.datetime64 objects of the same size

    If raise_on_invalid is True (default), invalid dates trigger a ValueError.
    Otherwise, the invalid element is replaced by np.NaT.zM8[ns]rs   Cannot convert date z. to a date in the standard calendar.  Reason: r   ZNaTN)rB   r   emptyr   Zndenumerater   r   r   r   r   r   r   r   rI   
datetime64)rK   r   newitdter>   r>   r?   r     s"    
r   c                 C  s   |t jtjfv r&t| js&t| |dS t| jr:t | } tj| j	dd}t
| D ]\}}z&||j|j|j|j|j|j|j}W nV ty } z>|rtd| d|dddj d| d	ntj}W Y d
}~n
d
}~0 0 |||< qR|S )am  Given an array of datetimes, return the same dates in another cftime or numpy date type.

    Useful to convert between calendars in numpy and cftime or between cftime calendars.

    If raise_on_valid is True (default), invalid dates trigger a ValueError.
    Otherwise, the invalid element is replaced by np.nan for cftime types and np.NaT for np.datetime64.
    )r   r   rs   r   z to a date in the i  r%   z calendar.  Reason: r   N)rF   rG   rB   r   r   rA   r   DatetimeIndexr   r   	enumerater   r   r   r   r   r   r   rI   r9   r   )rK   	date_typer   r   r   r   r   r   r>   r>   r?   convert_times  s0    


r   c                 C  s   |t jkrt}z$|| j| j| j| j| j| j| j	W S  t
yF    Y n| ty   z,|| j| j| jd | j| j| j| j	W  Y S  ty   || j| j| jd | j| j| j| j	 Y  Y S 0 Y n0 dS )a  Convert a single date to a new date_type (cftime.datetime or pd.Timestamp).

    If the new date is invalid, it goes back a day and tries again. If it is still
    invalid, goes back a second day.

    This is meant to convert end-of-month dates into a new calendar.
    r%      N)rF   rG   r   r   r   r   r   r   r   r   r
   rI   )r   r   r>   r>   r?   rE     sF    

	
	rE   )target_calendarrg   r:   c                 C  sJ   |durFt |r.t| rdS |du rFtdn|du rFtd| ddS )aa  Return whether conversion of the source to the target calendar should
    result in a cftime-backed array.

    Source is a 1D datetime array, target_cal a string (calendar name) and
    use_cftime is a boolean or None. If use_cftime is None, this returns True
    if the source's range and target calendar are convertible to np.datetime64 objects.
    TFzPSource time range is not valid for numpy datetimes. Try using `use_cftime=True`.z
Calendar 'z9' is only valid with cftime. Try using `use_cftime=True`.)r@   rM   rI   )sourcer   rg   r>   r>   r?   _should_cftime_be_used@  s    
r   c              	   C  sZ   t | \}}| }|ds(| d}z| dt| } W n ttfyT   Y n0 | S )Nr,   r   )rb   r<   rO   r   r
   rI   )rN   rd   rS   r>   r>   r?   _cleanup_netcdf_time_units[  s    

r   )rN   r9   r:   c                   sb   t du rtdt| jtjr0| dt}  fddtfdd| 	 D 
| jS )zFallback method for encoding dates using cftime.

    This method is more flexible than xarray's parsing using datetime64[ns]
    arrays but also slower because it loops over each element.
    Nrr   zM8[us]c                   sV   z"| d u rt jntj|  ddW S  tyP   | d u r>t jnt|   Y S 0 d S )NF)Z
longdouble)rB   r   rt   Zdate2num	TypeError)d)r9   rN   r>   r?   encode_datetimev  s    z5_encode_datetime_with_cftime.<locals>.encode_datetimec                   s   g | ]} |qS r>   r>   )rU   r   )r   r>   r?   
<listcomp>  rW   z0_encode_datetime_with_cftime.<locals>.<listcomp>)rt   ru   rB   
issubdtyperA   r   r   r   rw   r   r   r   )r   rN   r9   r>   )r9   r   rN   r?   _encode_datetime_with_cftimei  s    r   c                 C  s$   t j| t jd}| |k r |} | S )Nrs   )rB   r   r   r   )numZint_numr>   r>   r?   cast_to_int_if_safe  s    r   c                 C  s2   |r&| | tj }|j tjdd}n| | }|S )NF)copy)r   rB   r   )r   deltafloorr   r>   r>   r?   	_division  s
    r   )r   rA   r:   c                 C  s   t  , t jddd tj| |d}W d    n1 s:0    Y  t|tjr| |k st| jtj	rt
d| jd|dqtd| jd|d	n&t| rtd| jd|d
|S )Nrz   Zoverflow)messagers   z,Not possible to cast all encoded times from z to z without losing precision. Consider modifying the units such that integer values can be used, or removing the units and dtype encoding, at which point xarray will make an appropriate choice.z(Not possible to cast encoded times from z without overflow. Consider removing the dtype encoding, at which point xarray will make an appropriate choice, or explicitly switching to a larger integer dtype.z without overflow.  Consider removing the dtype encoding, at which point xarray will make an appropriate choice, or explicitly switching to a larger floating point dtype.)r]   r|   r}   rB   r   r   integerr   rA   ZfloatingrI   r   isinfany)r   rA   Zcast_numr>   r>   r?   _cast_to_dtype_if_safe  s6    
,
r   r"   znp.dtype | Noneztuple[T_DuckArray, str, str])r   rN   r9   rA   r:   c                 C  s0   t | } t| rt| |||S t| |||S dS )zGiven an array of datetime objects, returns the tuple `(num, units,
    calendar)` suitable for a CF compliant time variable.

    Unlike `date2num`, this function can handle datetime64 arrays.

    See Also
    --------
    cftime.date2num
    N)r   r   _lazily_encode_cf_datetime_eagerly_encode_cf_datetime)r   rN   r9   rA   r>   r>   r?   encode_cf_datetime  s    r   )r   rN   r9   rA   allow_units_modificationr:   c              
   C  s  t | } t| }|d u r|}nt|}|d u r6t| }zHt|rN| jjdkrRt| jdks`J t|\}}t	|}t
|  }	|	| }
t|\}}||krt||  }t	|}|| tddkrt|}t	|}d}||krdd}|d u rtd|d|d	 nVt|tjrd|rd| d
t| }td|d|d|d|d	 |}|}d}t|
||}|j| j}W n. tttfy   t| ||}t|}Y n0 |d urt||}|||fS )Nr   r   r   r)   TFzCTimes can't be serialized faithfully to int64 with requested units . Resolution of z needed. Serializing times to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.r   . Serializing with units P instead. Set encoding['dtype'] to floating point dtype to serialize with units . Set encoding['units'] to  to silence this warning .)r   r   r   r   r@   rA   r   r
   re   r   rF   r   r   absZto_timedelta64rB   r   r   r   r   r   r   r   rm   r   r   r   rI   r   r   r   )r   rN   r9   rA   r   
data_unitsrd   rS   
time_deltaZdates_as_indextime_deltasneeded_unitsZdata_ref_dateZ	ref_deltaZ
data_deltaneeded_time_deltafloor_divisionZ	new_unitsr   r>   r>   r?   r     sj    



r   c                 C  s   t | |||dd^}}|S NF)r   )r   )r   rN   r9   rA   r   _r>   r>   r?   %_encode_cf_datetime_within_map_blocks&  s    

r   r   ztuple[T_ChunkedArray, str, str]c                 C  s   |d u rt | }|d u rH|d u rH| jdkr:d}td}nd}td}|d u sX|d u rntd| d| dt| }|jt| ||||d}|||fS )	Nr   zmicroseconds since 1970-01-01r   znanoseconds since 1970-01-01zWhen encoding chunked arrays of datetime values, both the units and dtype must be prescribed or both must be unprescribed. Prescribing only one or the other is not currently supported. Got a units encoding of  and a dtype encoding of r   rs   )r   rA   rB   rI   r   
map_blocksr   )r   rN   r9   rA   chunkmanagerr   r>   r>   r?   r   2  s4    

r   ztuple[T_DuckArray, str])
timedeltasrN   rA   r:   c                 C  s,   t | } t| rt| ||S t| ||S d S r;   )r   r   _lazily_encode_cf_timedelta_eagerly_encode_cf_timedelta)r   rN   rA   r>   r>   r?   encode_cf_timedeltaX  s    r   )r   rN   rA   r   r:   c              
   C  s   t | }|d u r|}t|}t|  }|}||krHtt| }t|}d}	||krd}	|d u rt	d|d|d n@t
|tjr|rt	d|d|d|d	|d
	 |}|}d}	t|||	}
|
j| j}
|d urt|
|}
|
|fS )NTFzHTimedeltas can't be serialized faithfully to int64 with requested units r   z needed. Serializing timeseries to floating point instead. Set encoding['dtype'] to integer dtype to serialize to int64. Set encoding['dtype'] to floating point dtype to silence this warning.z?Timedeltas can't be serialized faithfully with requested units r   r   r   r   )r   r   rF   ZTimedeltaIndexr   r   rB   r   Zdropnar   r   r   r   rm   r   r   r   )r   rN   rA   r   r   r   r   r   r   r   r   r>   r>   r?   r   d  sH    
r   c                 C  s   t | ||dd\}}|S r   )r   )r   rN   rA   r   r   r>   r>   r?   &_encode_cf_timedelta_within_map_blocks  s    
r   ztuple[T_ChunkedArray, str]c                 C  sh   |d u r|d u rd}t d}|d u s.|d u rDtd| d| dt| }|jt| |||d}||fS )Nr6   r   zWhen encoding chunked arrays of timedelta values, both the units and dtype must be prescribed or both must be unprescribed. Prescribing only one or the other is not currently supported. Got a units encoding of r   r   rs   )rB   rA   rI   r   r   r   )r   rN   rA   r   r   r>   r>   r?   r     s(    
r   c                   @  sF   e Zd ZddddddZddddd	d
dZddddd	ddZdS )CFDatetimeCoderNrf   None)rg   r:   c                 C  s
   || _ d S r;   )rg   )selfrg   r>   r>   r?   __init__  s    zCFDatetimeCoder.__init__r   T_Namevariablenamer:   c           
      C  s   t |jjt jst|rt|\}}}}|dd }|dd }|dd }	t	||||	\}}}t
|d||d t
|d||d t||||ddS |S d S )NrN   r9   rA   r  TZfastpath)rB   r   rl   rA   r   r   r   popgetr   r   r   )
r  r  r  dimsrl   attrsencodingrN   r9   rA   r>   r>   r?   encode  s    
zCFDatetimeCoder.encodec                 C  s   |j dd }t|trd|v rt|\}}}}t||d}t||d}t|||| j}	tt	||| jd}
t
||
|	}t||||ddS |S d S )NrN   Zsincer9   )rN   r9   rg   Tr  )r  r
  r   r7   r   r   rp   rg   r   ri   r   r   )r  r  r  rN   r  rl   r  r  r9   rA   	transformr>   r>   r?   decode  s    zCFDatetimeCoder.decode)N)N)N)__name__
__module____qualname__r  r  r  r>   r>   r>   r?   r     s   r   c                   @  s4   e Zd Zd	ddddddZd
ddddddZdS )CFTimedeltaCoderNr   r  r  c                 C  sl   t |jjt jrdt|\}}}}t||dd |dd \}}t	|d||d t
||||ddS |S d S )NrN   rA   r  Tr  )rB   r   rl   rA   r   r   r   r	  r
  r   r   )r  r  r  r  rl   r  r  rN   r>   r>   r?   r    s    zCFTimedeltaCoder.encodec           
      C  sz   |j dd }t|trr|tv rrt|\}}}}t||d}tt|d}t	
d}	t|||	d}t||||ddS |S d S )NrN   rP   r   rs   Tr  )r  r
  r   r7   
TIME_UNITSr   r   r   r   rB   rA   r   r   )
r  r  r  rN   r  rl   r  r  r  rA   r>   r>   r?   r    s    
zCFTimedeltaCoder.decode)N)N)r  r  r  r  r  r>   r>   r>   r?   r    s   r  )NN)T)T)NNN)NNNT)NNN)NN)NNT)NN)l
__future__r   rY   r]   collections.abcr   r   r   	functoolsr   typingr   r   r	   numpyrB   ZpandasrF   Zpandas.errorsr
   r   Zxarray.coding.variablesr   r   r   r   r   r   r   Zxarray.corer   Zxarray.core.commonr   r   Zxarray.core.duck_array_opsr   Zxarray.core.formattingr   r   r   Zxarray.core.pdcompatr   Zxarray.core.utilsr   Zxarray.core.variabler   Z xarray.namedarray.parallelcompatr   r   Zxarray.namedarray.pycompatr   Zxarray.namedarray.utilsr    rt   ImportErrorZxarray.core.typesr!   r"   r  r=   r\   r   r   r   r   	frozensetr  r@   rM   rQ   rR   r_   rb   re   rp   rx   r   ri   r   r   r   r   r   r   r   r   r   r   r   r   r   rE   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r>   r>   r>   r?   <module>   s   $	

		
"5 6

"1&       S   (     4 +