wiver.run_wiver module

Created on Fri Jun 10 21:00:21 2016

@author: MaxBohnet

wiver.run_wiver.add_logfile(project_folder, scenario)

add Logfile to logger

Parameters:
  • project_folder (str) – filepath of the project folder

  • scenario (str) – the name of the scenario

wiver.run_wiver.balancing_file(project_folder)

The balancing-file

Parameters:

project_folder (str) –

Returns:

balancing_file

Return type:

str

wiver.run_wiver.calc_starting_ending_trips(wiver, wiver_files, starting_ending_trips_file, connection)

calculate starting and ending trips per zone

Parameters:
  • wiver (WIVER) – wiver-model

  • wiver-files – dict

  • starting_ending_trips_file (str) – str

  • connection (Connection) – An open Database Connection

  • wiver_files (dict) –

wiver.run_wiver.close_logfile()

close logfiles

wiver.run_wiver.connection(project_folder)

database connection to an sqlite-file named wiver.db3 in the project_folder to write zonal data into

Parameters:

project_folder (str) – the folder, where the sqlite-file is created

Return type:

Connection

wiver.run_wiver.groups_to_calculate()

List of group ids to calculate

Return type:

List[int]

wiver.run_wiver.matrix_file(project_folder)

The matrix-file

Parameters:

project_folder (str) –

Returns:

matrix_file

Return type:

str

wiver.run_wiver.max_iterations()

maximum number of iterations

Return type:

str

wiver.run_wiver.n_threads()

The number of threads to use if not defined, use the maximum number of threads available, maximum number equals to the number of groups

Return type:

int

wiver.run_wiver.params_file(project_folder)

The params-file

Parameters:

project_folder (str) –

Returns:

params_file

Return type:

str

wiver.run_wiver.project_folder()

The Project folder (%TEMP% by default)

Return type:

str

wiver.run_wiver.reset_balancing()

if True, balancing factors will be reset to 1 before calculating

Return type:

bool

wiver.run_wiver.result_file(project_folder)

The results-file Must not contain non-ascii-letters in the directory- or filename, because netcdf4-files fail otherwise

Parameters:

project_folder (str) –

Returns:

result_file

Return type:

str

wiver.run_wiver.result_folder(project_folder)

The result folder

Parameters:

project_folder (str) –

Returns:

result_folder

Return type:

str

wiver.run_wiver.run_wiver(wiver, wiver_files, max_iterations)

calculate wiver model

Parameters:
  • wiver (WIVER) – wiver-model

  • wiver_files (dict) – dict with the input files

  • max_iterations (int) – Maximum number of iterations

wiver.run_wiver.run_wiver_for_selected_groups(wiver, wiver_files, max_iterations, reset_balancing, groups_to_calculate)

calculate wiver model for selected groups only

Parameters:
  • wiver (WIVER) – wiver-model

  • wiver-files – dict

  • max_iterations (int) – int

  • groups_to_calculate (List[int]) – list of group numbers, that should be calculated

  • wiver_files (dict) –

  • reset_balancing (bool) –

wiver.run_wiver.save_detailed_results(wiver, wiver_files, result_folder, groups_to_calculate)

save detailed result matrices of wiver-model

Parameters:
  • wiver (WIVER) – wiver-model

  • wiver-files – dict

  • result_folder (str) – the folder to store the calculated matrices

  • groups_to_calculate (List[int]) – list of int

  • wiver_files (dict) –

wiver.run_wiver.save_input_data(wiver, wiver_files)

save the input data from the wiver-model as HDF5-files to the wiver_files

Parameters:
  • wiver (WIVER) – the Wiver-model

  • wiver_files (dict) – dict with the filenames

wiver.run_wiver.save_results(wiver, wiver_files, result_folder)

save result matrices of wiver-model

Parameters:
  • wiver (WIVER) – wiver-model

  • wiver-files – dict

  • result_folder (str) – the folder to store the calculated matrices

  • wiver_files (dict) –

wiver.run_wiver.scenario()

The Scenario Name

Return type:

str

wiver.run_wiver.starting_ending_trips_file(project_folder)

The Excel-File for starting and ending trips

Parameters:

project_folder (str) –

Returns:

starting_ending_trip_file

Return type:

str

wiver.run_wiver.wiver(wiver_files, n_threads)

Create a WIVER-instance with the given input data

Parameters:
  • wiver_files (Dict[str, str]) – dict with the input files

  • n_threads (int) – the maximum number of threads to use

Return type:

WIVER

wiver.run_wiver.wiver_files(params_file, matrix_file, zones_file, balancing_file, result_file)
Returns:

wiver_files – a dictionary with the file path to the input data files

Return type:

dict

Parameters:
  • params_file (str) –

  • matrix_file (str) –

  • zones_file (str) –

  • balancing_file (str) –

  • result_file (str) –

wiver.run_wiver.zones_file(project_folder)

The zonal_data-file

Parameters:

project_folder (str) –

Returns:

zones_file

Return type:

str