Initialize DATeS for a Run

DATeS can easily run without perminant installation:

dates.dates_setup

Initialize DATeS:

Define necessary global variables needed for access by DATeS modules, and scripts. An alternative to this procedure, will be to export to Environment variables. This module should be imported, and the method ‘initialize_dates’ should be executed prior to further use of DATeS by your driver script.

Example: initialize DATeS with default settings:

In your driver script: import dates_setup dates_setup.initialize_dates()
add_src_paths(add_all_dirs=True, relative_paths_list=None)

Add directories containing source files to the system directories. All package-specified paths are inserted in the beginning of the system paths’ list for proper import and faster access of DATeS modules.

Parameters:
  • add_all_dirs

    bool (default is True). * If True: all DATeS subdirectories (including models, test_cases, etc.) will be added to the sys.path. * If False: only necessary directories (passed to ‘relative_paths_list’) will be added.

    This requires later update if other directories are added to the package.
  • relative_paths_list – list (default is None)
  • list of relative paths to add to sys.path to give access to DATeS modules. (A) –
  • shoudl be used only if you know all necessary paths in DATeS. (This) –
  • only if add_all_dirs==False (Used) –
Returns:

None

initialize_dates(add_all_dirs=True, relative_paths_list=None, random_seed=None)

Setup up Environment Variables and add source directories to PYTHONPATH.

Parameters:
  • add_all_dirs

    bool (True/False). * If True: all DATeS subdirectories (including models, test_cases, etc.)

    will be added to the sys.path.
    • If False: only necessary directories (passed to ‘relative_paths_list’) will be added. This requires later update if other directories are added to the package.
  • relative_paths_list – list (default is None)
  • list of relative paths to add to sys.path to give access to DATeS modules. (A) –
  • shoudl be used only if you know all necessary paths in DATeS. (This) –
  • only if add_all_dirs==False (Used) –
  • random_seed – integer (default is None)
  • integer used to reset the seed of NumPy random number generator globally. (An) –
Returns:

None

In the DATeS root directory run the following statement:
import dates_setup
dates_setup.initilize_dates()

Run a driver; examples