pywfm.misc.IWFMMiscellaneous.increment_time#

IWFMMiscellaneous.increment_time(date_string, time_interval, n_intervals)#

increments the date provided by the specified time interval

Parameters:
  • date_string (str) – IWFM date format i.e. MM/DD/YYYY_HH:MM

  • time_interval (str) – valid time interval

  • n_intervals (int) – number of intervals to increment time

Returns:

IWFM-style date the number of time intervals after the provided date

Return type:

str

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_n_intervals

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

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

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.increment_time('10/01/1990_24:00', '1DAY', n_intervals=1)
'10/02/1990_24:00'
>>> 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.increment_time('12/31/2000_24:00', '1MON', n_intervals=3)
'03/31/2001_24:00'
>>> 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.increment_time('02/28/1991_24:00', '1YEAR', n_intervals=1)
'02/29/1992_24:00'
>>> model.kill()