From 7412fd377133d0d62c09d2e05a153ace04bc124d Mon Sep 17 00:00:00 2001 From: Maximilian Schmidt <max.schmidt@fz-juelich.de> Date: Thu, 29 Mar 2018 10:00:21 +0900 Subject: [PATCH] Add requirements file for add. requirements for figures of Schmidt2017, make Fig5 script independent of R installation, update README file with information on requirements --- README.md | 8 +++++++- figures/Schmidt2017/Fig5_cc_laminar_pattern.py | 17 +++++++++++------ figures/Schmidt2017/additional_requirements.txt | 2 ++ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 figures/Schmidt2017/additional_requirements.txt diff --git a/README.md b/README.md index 9966533..c6a31fb 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,12 @@ To install the required packages in a conda environment, execute: Note that NEST needs to be installed separately, see <http://www.nest-simulator.org/installation/>. +In addition, reproducing the figures of Schmidt et al. (2017) requires python-igraph and networkx. To install these additional packages, execute: + +`pip install -r figures/Schmidt2017/additional_requirements.txt` + +The SLN fit in `multiarea_model/data_multiarea/VisualCortex_Data.py` and `figures/Schmidt2017/Fig5_cc_laminar_pattern.py` requires an installation of R and the R library `aod` (<http://cran.r-project.org/package=aod>). Without R installation, both scripts will directly use the resulting values of the fit (see Fig. 5 of [1]). + ## Contributors All authors of the publications [1-3] made contributions to the scientific content. @@ -183,6 +189,6 @@ The code base was written by Maximilian Schmidt, Jannis Schuecker, and Sacha van ## Citation -If you use this code, we ask you to cite the appropriate papers in your publication. For the multi-area model itself, please [1] and [3]. If you use the mean-field theory or the stabilization method, please cite [2] in addition. We provide bibtex entries in `CITATION`. +If you use this code, we ask you to cite the appropriate papers in your publication. For the multi-area model itself, please cite [1] and [3]. If you use the mean-field theory or the stabilization method, please cite [2] in addition. We provide bibtex entries in `CITATION`. <img src="https://raw.githubusercontent.com/nest/nest-simulator/master/extras/logos/nest-simulated.png" alt="NEST simulated" width="200"/> diff --git a/figures/Schmidt2017/Fig5_cc_laminar_pattern.py b/figures/Schmidt2017/Fig5_cc_laminar_pattern.py index 40f1ad1..f46a51c 100644 --- a/figures/Schmidt2017/Fig5_cc_laminar_pattern.py +++ b/figures/Schmidt2017/Fig5_cc_laminar_pattern.py @@ -147,12 +147,17 @@ Fit of SLN vs. architectural type differences SLN_array = np.array(data[:, 10], dtype=np.float) densities = np.array(data[:, 7], dtype=np.float) -proc = subprocess.Popen( - ["Rscript", os.path.join(datapath, 'SLN_logdensities.R')], - stdout=subprocess.PIPE) -out = proc.communicate()[0].decode('utf-8') -R_fit = [float(out.split('\n')[1].split(' ')[1]), - float(out.split('\n')[1].split(' ')[3])] +# Call R script to perform SLN fit +try: + proc = subprocess.Popen(["Rscript", + os.path.join(datapath, 'SLN_logdensities.R')], + stdout=subprocess.PIPE) + out = proc.communicate()[0].decode('utf-8') + R_fit = [float(out.split('\n')[1].split(' ')[1]), + float(out.split('\n')[1].split(' ')[3])] +except OSError: + print("No R installation, taking hard-coded fit parameters.") + R_fit = [-0.1516142, -1.5343200] print(R_fit) ax = axes['A'] diff --git a/figures/Schmidt2017/additional_requirements.txt b/figures/Schmidt2017/additional_requirements.txt new file mode 100644 index 0000000..d607158 --- /dev/null +++ b/figures/Schmidt2017/additional_requirements.txt @@ -0,0 +1,2 @@ +python-igraph +networkx -- GitLab