Ieso
=========================

.. py:module:: gridstatus.ieso


Module Contents
---------------

Classes Summary
~~~~~~~~~~~~~~~

.. autoapisummary::

   gridstatus.ieso.IESO
   gridstatus.ieso.SurplusState




Functions
~~~~~~~~~

.. autoapisummary::
   :nosignatures:

   gridstatus.ieso.retired_data_warning



Attributes Summary
~~~~~~~~~~~~~~~~~~~

.. autoapisummary::

   gridstatus.ieso.CERTIFICATES_CHAIN_FILE
   gridstatus.ieso.CURRENT_DIR
   gridstatus.ieso.RETIRED_DATE


Contents
~~~~~~~~~~~~~~~~~~~
.. py:data:: CERTIFICATES_CHAIN_FILE

.. py:data:: CURRENT_DIR

.. py:class:: IESO

   Bases: :py:obj:`gridstatus.base.ISOBase`

   Independent Electricity System Operator (IESO)


   **Attributes**

   .. list-table::
      :widths: 15 85
      :header-rows: 0

      * - **default_timezone**
        - 'EST'
      * - **iso_id**
        - 'ieso'
      * - **name**
        - 'Independent Electricity System Operator'
      * - **status_homepage**
        - 'https://www.ieso.ca/en/Power-Data'


   **Methods**

   .. autoapisummary::
      :nosignatures:

      gridstatus.ieso.IESO.get_forecast_surplus_baseload_generation
      gridstatus.ieso.IESO.get_fuel_mix
      gridstatus.ieso.IESO.get_generator_report_hourly
      gridstatus.ieso.IESO.get_hoep_historical_hourly
      gridstatus.ieso.IESO.get_hoep_real_time_hourly
      gridstatus.ieso.IESO.get_in_service_transmission_limits
      gridstatus.ieso.IESO.get_intertie_actual_schedule_flow_hourly
      gridstatus.ieso.IESO.get_intertie_flow_5_min
      gridstatus.ieso.IESO.get_intertie_limits_day_ahead_hourly
      gridstatus.ieso.IESO.get_intertie_limits_real_time_5_min
      gridstatus.ieso.IESO.get_lmp_day_ahead_hourly
      gridstatus.ieso.IESO.get_lmp_day_ahead_hourly_intertie
      gridstatus.ieso.IESO.get_lmp_day_ahead_hourly_ontario_zonal
      gridstatus.ieso.IESO.get_lmp_day_ahead_hourly_virtual_zonal
      gridstatus.ieso.IESO.get_lmp_day_ahead_operating_reserves
      gridstatus.ieso.IESO.get_lmp_predispatch_hourly
      gridstatus.ieso.IESO.get_lmp_predispatch_hourly_intertie
      gridstatus.ieso.IESO.get_lmp_predispatch_hourly_ontario_zonal
      gridstatus.ieso.IESO.get_lmp_predispatch_hourly_virtual_zonal
      gridstatus.ieso.IESO.get_lmp_real_time_5_min
      gridstatus.ieso.IESO.get_lmp_real_time_5_min_intertie
      gridstatus.ieso.IESO.get_lmp_real_time_5_min_ontario_zonal
      gridstatus.ieso.IESO.get_lmp_real_time_5_min_virtual_zonal
      gridstatus.ieso.IESO.get_lmp_real_time_operating_reserves
      gridstatus.ieso.IESO.get_load
      gridstatus.ieso.IESO.get_load_forecast
      gridstatus.ieso.IESO.get_load_zonal_5_min
      gridstatus.ieso.IESO.get_load_zonal_hourly
      gridstatus.ieso.IESO.get_mcp_historical_5_min
      gridstatus.ieso.IESO.get_mcp_real_time_5_min
      gridstatus.ieso.IESO.get_outage_transmission_limits
      gridstatus.ieso.IESO.get_real_time_totals
      gridstatus.ieso.IESO.get_resource_adequacy_report
      gridstatus.ieso.IESO.get_resource_adequacy_report_by_last_modified
      gridstatus.ieso.IESO.get_shadow_prices_day_ahead_hourly
      gridstatus.ieso.IESO.get_shadow_prices_real_time_5_min
      gridstatus.ieso.IESO.get_solar_embedded_forecast
      gridstatus.ieso.IESO.get_solar_market_participant_forecast
      gridstatus.ieso.IESO.get_transmission_outages_planned
      gridstatus.ieso.IESO.get_wind_embedded_forecast
      gridstatus.ieso.IESO.get_wind_market_participant_forecast
      gridstatus.ieso.IESO.get_yearly_intertie_actual_schedule_flow_hourly
      gridstatus.ieso.IESO.get_zonal_load_forecast

   .. py:method:: get_forecast_surplus_baseload_generation(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get forecast surplus baseload generation.

      :param date: The publish date to get data for. The forecast will be for the day after this date.
      :param end: The end date to get data for. If None, only get data for the start date.
      :param verbose: Whether to print verbose output.

      :returns:     - Interval Start: The start of the interval
                    - Interval End: The end of the interval
                    - Publish Time: The time the forecast was published
                    - Surplus Baseload MW: The forecast surplus baseload generation in MW
                    - Surplus State: The state of the surplus baseload generation
                    - Action: The action taken for the surplus baseload generation
                    - Export Forecast MW: The forecast export in MW
                    - Minimum Generation Status: The minimum generation status
      :rtype: DataFrame with columns


   .. py:method:: get_fuel_mix(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

      Hourly output and capability for each fuel type (summed over all generators)
      for a given date or from date to end. Variable generators (solar and wind)
      have a forecast.

      :param date: The date to get the load for
                   Can be a `datetime.date` or `datetime.datetime` object, or a string
                   with the values "today" or "latest". If `end` is None, returns
                   only data for this date.
      :type date: datetime.date | datetime.datetime | str
      :param end: End date. Defaults None
                  If provided, returns data from `date` to `end` date. The `end` can be a
                  `datetime.date` or `datetime.datetime` object.
      :type end: datetime.date | datetime.datetime, optional
      :param verbose: Print verbose output. Defaults to False.
      :type verbose: bool, optional

      :returns: fuel mix
      :rtype: pd.DataFrame


   .. py:method:: get_generator_report_hourly(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

      Hourly output for each generator for a given date or from date to end.
      Variable generators (solar and wind) have a forecast and available capacity.
      Non-variable generators have a capability.

      :param date: The date to get the load for
                   Can be a `datetime.date` or `datetime.datetime` object, or a string
                   with the values "today" or "latest". If `end` is None, returns
                   only data for this date.
      :type date: datetime.date | datetime.datetime | str
      :param end: End date. Defaults None
                  If provided, returns data from `date` to `end` date. The `end` can be a
                  `datetime.date` or `datetime.datetime` object.
      :type end: datetime.date | datetime.datetime, optional
      :param verbose: Print verbose output. Defaults to False.
      :type verbose: bool, optional

      :returns: generator output and capability/available capacity
      :rtype: pd.DataFrame


   .. py:method:: get_hoep_historical_hourly(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

   .. py:method:: get_hoep_real_time_hourly(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_in_service_transmission_limits(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_intertie_actual_schedule_flow_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_intertie_flow_5_min(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_intertie_limits_day_ahead_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get day-ahead intertie scheduling limits.

      This returns hourly data showing import and export limits for each
      of Ontario's intertie zones used in the day-ahead market.

      :param date: Date or date range to get data for, or "latest"
      :param end: End date for date range (optional)
      :param verbose: Whether to print verbose output

      :returns: DataFrame with columns for interval start/end and import/export
                limits for each intertie zone


   .. py:method:: get_intertie_limits_real_time_5_min(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get real-time intertie scheduling limits.

      This returns 5-minute interval data showing import and export limits
      for each of Ontario's intertie zones.

      :param date: Date or date range to get data for, or "latest"
      :param end: End date for date range (optional)
      :param verbose: Whether to print verbose output

      :returns: DataFrame with columns for interval start/end and import/export
                limits for each intertie zone


   .. py:method:: get_lmp_day_ahead_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get day-ahead LMP data.
      :param date: The date to get the data for.
      :param end: The end date to get the data for.
      :param verbose: Whether to print verbose output.

      :returns: DataFrame with LMP data.


   .. py:method:: get_lmp_day_ahead_hourly_intertie(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_lmp_day_ahead_hourly_ontario_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_day_ahead_hourly_virtual_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get day-ahead zonal virtual LMP data.
      :param date: The date to get the data for.
      :param end: The end date to get the data for.
      :param verbose: Whether to print verbose output.

      :returns: DataFrame with LMP data.


   .. py:method:: get_lmp_day_ahead_operating_reserves(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

      Get day-ahead operating reserves LMP data.

      :param date: The date to get the data for.
      :param end: The end date to get the data for.
      :param verbose: Whether to print verbose output.

      :returns: DataFrame with operating reserves LMP data.


   .. py:method:: get_lmp_predispatch_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_lmp_predispatch_hourly_intertie(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_lmp_predispatch_hourly_ontario_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_predispatch_hourly_virtual_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_real_time_5_min(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_real_time_5_min_intertie(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_real_time_5_min_ontario_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_real_time_5_min_virtual_zonal(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_lmp_real_time_operating_reserves(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_load(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

      Get 5-minute load for the Market and Ontario for a given date or from
      date to end date.

      :param date: The date to get the load for
                   Can be a `datetime.date` or `datetime.datetime` object, or a string
                   with the values "today" or "latest". If `end` is None, returns
                   only data for this date.
      :type date: datetime.date | datetime.datetime | str
      :param end: End date. Defaults None
                  If provided, returns data from `date` to `end` date. The `end` can be a
                  `datetime.date` or `datetime.datetime` object.
      :type end: datetime.date | datetime.datetime, optional
      :param verbose: Print verbose output. Defaults to False.
      :type verbose: bool, optional
      :param frequency: Frequency of data. Defaults to "5min".
      :type frequency: str, optional

      :returns: zonal load as a wide table with columns for each zone
      :rtype: pd.DataFrame


   .. py:method:: get_load_forecast(date: str, verbose: bool = False)

      Get forecasted load for Ontario. Supports only "latest" and "today" because
      there is only one load forecast.

      :param date: Either "today" or "latest"
      :type date: str
      :param verbose: Print verbose output. Defaults to False.
      :type verbose: bool, optional

      :returns: Ontario load forecast
      :rtype: pd.DataFrame


   .. py:method:: get_load_zonal_5_min(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_load_zonal_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_mcp_historical_5_min(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

   .. py:method:: get_mcp_real_time_5_min()

   .. py:method:: get_outage_transmission_limits(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_real_time_totals(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_resource_adequacy_report(date: str | datetime.date | datetime.datetime, end: datetime.date | datetime.datetime | None = None, vintage: Literal['all', 'latest'] = 'latest', last_modified: str | datetime.date | datetime.datetime | None = None) -> pandas.DataFrame

      Retrieve and parse the Resource Adequacy Report for a given date.

      :param date: The date for which to get the report
      :type date: str | datetime.date | datetime.datetime
      :param end: The end date for the range of reports to get
      :type end: datetime.date | datetime.datetime | None
      :param vintage: The version of the report to get
      :type vintage: Literal["all", "latest"]
      :param last_modified: The last modified time after which to get report(s)
      :type last_modified: str | datetime.date | datetime.datetime | None

      :returns: The Resource Adequacy Report df for the given date
      :rtype: pd.DataFrame


   .. py:method:: get_resource_adequacy_report_by_last_modified(last_modified: str | datetime.date | datetime.datetime) -> pandas.DataFrame

      Retrieve and parse Resource Adequacy Reports modified after last_modified time.
      This method bypasses date iteration and gets all files across all dates.
      This is useful for ETL systems that want to get all new files at once.

      :param last_modified: The last modified time after which to get report(s)
      :param vintage: The version of the report to get

      :returns: The Resource Adequacy Report df with all files modified after last_modified
      :rtype: pd.DataFrame


   .. py:method:: get_shadow_prices_day_ahead_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False, last_modified: str | pandas.Timestamp | None = None) -> pandas.DataFrame

   .. py:method:: get_shadow_prices_real_time_5_min(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False, last_modified: str | pandas.Timestamp | None = None) -> pandas.DataFrame

   .. py:method:: get_solar_embedded_forecast(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, vintage: Literal['latest', 'all'] = 'latest', verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_solar_market_participant_forecast(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, vintage: Literal['latest', 'all'] = 'latest', verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_transmission_outages_planned(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False)

   .. py:method:: get_wind_embedded_forecast(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, vintage: Literal['latest', 'all'] = 'latest', verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_wind_market_participant_forecast(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, vintage: Literal['latest', 'all'] = 'latest', verbose: bool = False) -> pandas.DataFrame

   .. py:method:: get_yearly_intertie_actual_schedule_flow_hourly(date: str | pandas.Timestamp | tuple[pandas.Timestamp, pandas.Timestamp], end: pandas.Timestamp | None = None, verbose: bool = False, vintage: Literal['all', 'latest'] = 'latest', last_modified: str | datetime.date | datetime.datetime | None = None) -> pandas.DataFrame

      Get yearly intertie actual schedule flow hourly. Since this is a yearly file
      it is updated less frequency than the daily files. These can be retrieved via
      the get_intertie_schedule_flow_hourly method.
      :param date: The date to get the data for.
      :param end: The end date to get the data for.
      :param verbose: Whether to print verbose output.
      :param vintage: Whether to get the latest version or all versions of the report.
      :param last_modified: Only return reports modified after this date.

      :returns: DataFrame with hourly intertie schedule flow data.


   .. py:method:: get_zonal_load_forecast(date: str | datetime.date | tuple[datetime.date, datetime.date], end: datetime.date | datetime.datetime | None = None, verbose: bool = False)

      Get forecasted load by forecast zone (Ontario, East, West) for a given date
      or from date to end date. This method supports future dates.

      Supports data 90 days into the past and up to 34 days into the future.

      :param date: The date to get the load for
                   Can be a `datetime.date` or `datetime.datetime` object, or a string
                   with the values "today" or "latest". If `end` is None, returns
                   only data for this date.
      :type date: datetime.date | datetime.datetime | str
      :param end: End date. Defaults None
                  If provided, returns data from `date` to `end` date. The `end` can be a
                  `datetime.date` or `datetime.datetime` object.
      :type end: datetime.date | datetime.datetime, optional
      :param verbose: Print verbose output. Defaults to False.
      :type verbose: bool, optional

      :returns: forecasted load as a wide table with columns for each zone
      :rtype: pd.DataFrame



.. py:function:: retired_data_warning()

.. py:data:: RETIRED_DATE

.. py:class:: SurplusState

   Bases: :py:obj:`str`, :py:obj:`enum.Enum`

   Enum for surplus baseload generation states.

   The state is determined by the Action field in the report:
   - No Action (empty/null) -> No Surplus (white)
   - Other -> Managed with exports/curtailments/VG dispatch (green)
   - Manoeuvre -> Potential to dispatch nuclear units (yellow)
   - Shutdown -> Potential to shutdown nuclear units (red)

   Initialize self.  See help(type(self)) for accurate signature.


   **Attributes**

   .. list-table::
      :widths: 15 85
      :header-rows: 0

      * - **MANAGED_WITH_EXPORTS**
        - 'Managed with Exports'
      * - **NO_SURPLUS**
        - 'No Surplus'
      * - **NUCLEAR_DISPATCH**
        - 'Nuclear Dispatch'
      * - **NUCLEAR_SHUTDOWN**
        - 'Nuclear Shutdown'



