U
    L?hf                     @   s<   d Z ddlmZ ddlmZ ddlmZ G dd deZdS )zA
Contains the base class for series
Made using sequences in mind
    )Expr)S)cacheitc                   @   s   e Zd ZdZedd Zedd Zedd Zedd	 Zed
d Z	edd Z
edd Zdd Zdd Zdd Zdd ZdS )
SeriesBasezBase Class for seriesc                 C   s   t d|  dS )z+The interval on which the series is definedz(%s).intervalNNotImplementedErrorself r
   K/var/www/html/venv/lib/python3.8/site-packages/sympy/series/series_class.pyinterval   s    zSeriesBase.intervalc                 C   s   t d|  dS )z8The starting point of the series. This point is includedz
(%s).startNr   r   r
   r
   r   start   s    zSeriesBase.startc                 C   s   t d|  dS )z6The ending point of the series. This point is includedz	(%s).stopNr   r   r
   r
   r   stop   s    zSeriesBase.stopc                 C   s   t d|  dS )zLength of the series expansionz(%s).lengthNr   r   r
   r
   r   length   s    zSeriesBase.lengthc                 C   s   dS )z-Returns a tuple of variables that are boundedr
   r
   r   r
   r
   r   	variables"   s    zSeriesBase.variablesc                 C   s   dd | j D | jS )z
        This method returns the symbols in the object, excluding those
        that take on a specific value (i.e. the dummy symbols).
        c                 S   s   h | ]}|j D ]}|qqS r
   )free_symbols).0ijr
   r
   r   	<setcomp>-   s       z*SeriesBase.free_symbols.<locals>.<setcomp>)args
differencer   r   r
   r
   r   r   '   s    zSeriesBase.free_symbolsc                 C   s0   || j k s|| jkr&td|| jf | |S )zTerm at point pt of a serieszIndex %s out of bounds %s)r   r   
IndexErrorr   
_eval_termr	   ptr
   r
   r   term0   s    zSeriesBase.termc                 C   s   t d| j d S )NzhThe _eval_term method should be added to%s to return series term so it is availablewhen 'term' calls it.)r   funcr   r
   r
   r   r   7   s    zSeriesBase._eval_termc                 C   s.   | j tjkr| j}d}n
| j }d}|||  S )z
        Returns the i'th point of a series
        If start point is negative infinity, point is returned from the end.
        Assumes the first point to be indexed zero.

        Examples
        ========

        TODO
           )r   r   NegativeInfinityr   )r	   r   initialstepr
   r
   r   
_ith_point=   s    zSeriesBase._ith_pointc                 c   s2   d}|| j k r.| |}| |V  |d7 }qd S )Nr   r   )r   r#   r   )r	   r   r   r
   r
   r   __iter__Q   s
    

zSeriesBase.__iter__c                    st   t |tr |} |S t |trp|j|j }}|d krBd}|d krP j} fddt|||j	phdD S d S )Nr   c                    s   g | ]}   |qS r
   )r   r#   )r   r   r   r
   r   
<listcomp>b   s     z*SeriesBase.__getitem__.<locals>.<listcomp>r   )

isinstanceintr#   r   slicer   r   r   ranger"   )r	   indexr   r   r
   r   r   __getitem__X   s    




zSeriesBase.__getitem__N)__name__
__module____qualname____doc__propertyr   r   r   r   r   r   r   r   r   r#   r$   r+   r
   r
   r
   r   r      s&   






r   N)r/   Zsympy.core.exprr   Zsympy.core.singletonr   Zsympy.core.cacher   r   r
   r
   r
   r   <module>   s   