
    wgf                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Zy)zA
Contains the base class for series
Made using sequences in mind
    )Expr)S)cacheitc                       e Zd ZdZed        Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zd	 Zd
 Zd Zd Zy)
SeriesBasezBase Class for seriesc                     t        d| z        )z+The interval on which the series is definedz(%s).intervalNotImplementedErrorselfs    ^/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/sympy/series/series_class.pyintervalzSeriesBase.interval   s     "/D"899    c                     t        d| z        )z8The starting point of the series. This point is includedz
(%s).startr	   r   s    r   startzSeriesBase.start   s     ","566r   c                     t        d| z        )z6The ending point of the series. This point is includedz	(%s).stopr	   r   s    r   stopzSeriesBase.stop   s     "+"455r   c                     t        d| z        )zLength of the series expansionz(%s).lengthr	   r   s    r   lengthzSeriesBase.length   s     "-$"677r   c                      y)z-Returns a tuple of variables that are bounded r   r   s    r   	variableszSeriesBase.variables"   s     r   c                     | j                   D ch c]  }|j                  D ]  }|  c}}j                  | j                        S c c}}w )z
        This method returns the symbols in the object, excluding those
        that take on a specific value (i.e. the dummy symbols).
        )argsfree_symbols
differencer   )r   ijs      r   r   zSeriesBase.free_symbols'   s<     !II>qq~~>!>>DNN+	->s   Ac                     || j                   k  s|| j                  kD  rt        d|d| j                        | j	                  |      S )zTerm at point pt of a serieszIndex z out of bounds )r   r   
IndexErrorr   
_eval_termr   pts     r   termzSeriesBase.term0   s<     

?b499nBNOOr""r   c                 2    t        d| j                  z        )NzhThe _eval_term method should be added to%s to return series term so it is availablewhen 'term' calls it.)r
   funcr"   s     r   r!   zSeriesBase._eval_term7   s"    ! #: %)II#. / 	/r   c                     | j                   t        j                  u r| j                  }d}n| j                   }d}|||z  z   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steps       r   
_ith_pointzSeriesBase._ith_point=   sA     ::+++iiGDjjGD4r   c              #      K   d}|| j                   k  r:| j                  |      }| j                  |       |dz  }|| j                   k  r9y y wNr   r)   )r   r-   r$   )r   r   r#   s      r   __iter__zSeriesBase.__iter__Q   sH     $++o#B))B-FA $++os   A
AAc                 t   t        |t              r"| j                  |      }| j                  |      S t        |t              rq|j
                  |j                  }}|d}|| j                  }t        |||j                  xs d      D cg c]"  }| j                  | j                  |            $ c}S y c c}w r/   )

isinstanceintr-   r$   slicer   r   r   ranger,   )r   indexr   r   r   s        r   __getitem__zSeriesBase.__getitem__X   s    eS!OOE*E99U##u%++uzz4E}|{{%uzzQ79aDIIdooa01 9 9 &9s   
'B5N)__name__
__module____qualname____doc__propertyr   r   r   r   r   r   r   r$   r!   r-   r0   r7   r   r   r   r   r      s    : : 7 7 6 6 8 8   - - # #/ (9r   r   N)r;   sympy.core.exprr   sympy.core.singletonr   sympy.core.cacher   r   r   r   r   <module>r@      s#   
 ! " $X9 X9r   