pywfm.IWFMModel.get_n_intervals#

IWFMModel.get_n_intervals(begin_date, end_date, time_interval, includes_end_date=True)#

returns the number of time intervals between a provided start date and end date

Parameters:
  • begin_date (str) – IWFM format date MM/DD/YYYY_HH:MM

  • end_date (str) – IWFM format date MM/DD/YYYY_HH:MM

  • time_interval (str) – valid IWFM time interval

  • includes_end_date (boolean, default=True) – True adds 1 to the number of intervals to include the end_date False is the number of intervals between the two dates without including the end_date

Returns:

number of time intervals between begin and end date

Return type:

int

See also

IWFMModel.get_current_date_and_time

returns the current simulation date and time

IWFMModel.get_n_time_steps

returns the number of timesteps in an IWFM simulation

IWFMModel.get_time_specs

returns the IWFM simulation dates and time step

IWFMModel.get_output_interval

returns a list of the possible time intervals a selected time-series data can be retrieved at.

IWFMModel.is_date_greater

returns True if first_date is greater than comparison_date

IWFMModel.increment_time

increments the date provided by the specified time interval

Examples

>>> from pywfm import IWFMModel
>>> dll = '../../DLL/Bin/IWFM2015_C_x64.dll'
>>> pp_file = '../Preprocessor/PreProcessor_MAIN.IN'
>>> sim_file = 'Simulation_MAIN.IN'
>>> model = IWFMModel(dll, preprocessor_infile, simulation_infile)
>>> model.get_n_intervals('06/30/1997_24:00', '12/31/1997_24:00', '1MON', includes_end_date=False)
6
>>> model.kill()
>>> from pywfm import IWFMModel
>>> dll = '../../DLL/Bin/IWFM2015_C_x64.dll'
>>> pp_file = '../Preprocessor/PreProcessor_MAIN.IN'
>>> sim_file = 'Simulation_MAIN.IN'
>>> model = IWFMModel(dll, preprocessor_infile, simulation_infile)
>>> model.get_n_intervals('09/30/2011_24:00', '12/31/2011_24:00', '1DAY')
92
>>> model.kill()