o
    !ôjf  ã                   @   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   úl/var/www/html/academy/tools/voices/clone/cosy-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
    