o
    jgf                     @   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      t d|  )z+The interval on which the series is definedz(%s).intervalNotImplementedErrorself r   Q/var/www/html/zoom/venv/lib/python3.10/site-packages/sympy/series/series_class.pyinterval      zSeriesBase.intervalc                 C   r   )z8The starting point of the series. This point is includedz
(%s).startr   r	   r   r   r   start   r   zSeriesBase.startc                 C   r   )z6The ending point of the series. This point is includedz	(%s).stopr   r	   r   r   r   stop   r   zSeriesBase.stopc                 C   r   )zLength of the series expansionz(%s).lengthr   r	   r   r   r   length   r   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>-       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 )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u 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   s@    d}|| j k r| |}| |V  |d7 }|| j k sd S 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r8|j|j}}|d u r!d}|d u r( j} fddt|||j	p4dD S d S )Nr   c                    s   g | ]
}   |qS r   )r   r&   )r   r   r	   r   r   
<listcomp>b   r   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)r2   sympy.core.exprr   sympy.core.singletonr   sympy.core.cacher   r   r   r   r   r   <module>   s
    