From b3c9c9fa8dfbf9c09204350142ffde19a14f1833 Mon Sep 17 00:00:00 2001
From: Maximilian Schmidt <max.schmidt@fz-juelich.de>
Date: Mon, 2 Apr 2018 11:24:53 +0900
Subject: [PATCH] Use absolute paths rather than relative paths for files

---
 multiarea_model/default_params.py | 4 +++-
 run_example.py                    | 7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/multiarea_model/default_params.py b/multiarea_model/default_params.py
index 15dbba6..6ae1ddc 100644
--- a/multiarea_model/default_params.py
+++ b/multiarea_model/default_params.py
@@ -62,7 +62,8 @@ network_params = {
     'N_scaling': 1.,
     # Scaling of indegrees
     'K_scaling': 1.,
-    # Full-scale rates for scaling synaptic weights
+    # Absolute path to the file holding full-scale rates for scaling
+    # synaptic weights
     'fullscale_rates': None
 }
 
@@ -146,6 +147,7 @@ connection_params = {
     # $(replace_cc_input_source)-area-population.npy
     # (e.g. '$(replace_cc_input_source)-V1-23E.npy')
     # contain the time series for each population.
+    # We recommend using absolute paths rather than relative paths.
     'replace_cc_input_source': None,
 
     # whether to redistribute CC synapse to meet literature value
diff --git a/run_example.py b/run_example.py
index 8945b41..f9e7df9 100644
--- a/run_example.py
+++ b/run_example.py
@@ -1,6 +1,9 @@
+import os
+
 from multiarea_model import MultiAreaModel
 from start_jobs import start_job
 from config import submit_cmd, jobscript_template
+from config import base_path
 
 """
 Example script showing how to simulate the multi-area model
@@ -17,7 +20,7 @@ resources, for instance on a compute cluster.
 """
 d = {}
 conn_params = {'g': -11.,
-               'K_stable': 'K_stable.npy',
+               'K_stable': os.path.join(base_path, 'K_stable.npy'),
                'fac_nu_ext_TH': 1.2,
                'fac_nu_ext_5E': 1.125,
                'fac_nu_ext_6E': 1.41666667,
@@ -68,7 +71,7 @@ neuron_params = {'V0_mean': -150.,
                  'V0_sd': 50.}
 network_params = {'N_scaling': 0.01,
                   'K_scaling': 0.01,
-                  'fullscale_rates': 'tests/fullscale_rates.json',
+                  'fullscale_rates': os.path.join(base_path, 'tests/fullscale_rates.json'),
                   'connection_params': conn_params,
                   'neuron_params': neuron_params}
 
-- 
GitLab