Configuration file parser

The configuration file includes all the required parameters of the Kuramoto’s model. A config text file must contain the following parameters:

| #Config file for a Kuramoto model simulation
| experiment_name=Test
| #Network structure
| n_nodes=90
| struct_connectivity=../input_data/AAL_matrices.mat
| delay_matrix=../input_data/AAL_matrices.mat
| #Global parameters
| K=360.00
| mean_delay=0.018
| #Intrinsic/Natural frequencies
| nat_freqs=
| nat_freq_mean=40
| nat_freq_std=0.0
| #Time parameters
| simulation_period=30
| dt=1e-4
| #Stim
| ForcingNodes=[0]
| StimTstart=22
| StimTend=25
| StimFreq=20
| StimAmp=50
| #Stochastic parameters
| seed=3423
| random_nat_freq=False
| noise_std=0
| #Parallel process
| max_workers=2

A line starting with the # symbol will be considered as a comment.

(Remove the | symbols in the text file.)

Functions:

loadData(file_path)

Recollect the model parameters from the config file specified by file_path.

readline(line)

Read one line from the config file, if the line is not tagged as a comment

model.parserConfig.loadData(file_path)

Recollect the model parameters from the config file specified by file_path.

Parameters

filepath (str) – The path with the directory and filename of the __config__ file.

Returns

config – A dictionary with the required parameters for the Kuramoto model. Using the template of the __config__ file, there will not be any warning. If you __config__ file lacks one o several parameters, it will be an error. Future release: You can specifiy only the required parameters to change, if there is not in the __config__ file, the model is instatiated with the default parameters.

Return type

dict

model.parserConfig.readline(line)

Read one line from the config file, if the line is not tagged as a comment

Parameters

line (str) – A line of the config file

Returns

  • key_name (str) – Keyname of the parameter. The name before the “=” symbol. It returns “#” if the line is commented.

  • value (str) – Value of the parameter as written in the config file. It returns “#” if the line is commented.