From aa3511a9649570ee6a2a206019805275c0132485 Mon Sep 17 00:00:00 2001
From: James Chen <jchen.6727@gmail.com>
Date: Tue, 17 Sep 2024 10:15:09 -0400
Subject: [PATCH 1/2] d/w expanse setup, moved {env} {res} {custom}

---
 netpyne/batchtools/search.py  |  1 +
 netpyne/batchtools/submits.py | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/netpyne/batchtools/search.py b/netpyne/batchtools/search.py
index 93a52cc05..79045706b 100644
--- a/netpyne/batchtools/search.py
+++ b/netpyne/batchtools/search.py
@@ -225,6 +225,7 @@ def run(config):
     ('sh', 'sfs' ): constructors(runtk.dispatchers.SFSDispatcher , submits.SHSubmitSFS),
 }#TODO, just say "socket"?
 
+
 """
 some shim functions before ray_search
 """
diff --git a/netpyne/batchtools/submits.py b/netpyne/batchtools/submits.py
index ad033f188..587843a37 100644
--- a/netpyne/batchtools/submits.py
+++ b/netpyne/batchtools/submits.py
@@ -179,9 +179,8 @@ class SlurmSubmit(Submit):
 #SBATCH --mail-user={email}
 #SBATCH --mail-type=end
 export JOBID=$SLURM_JOB_ID
-{res}
+{env}
 {custom}
-source ~/.bashrc
 cd {project_path}
 {command}
 wait
@@ -227,8 +226,8 @@ class SlurmSubmitSFS(SlurmSubmit):
 export JOBID=$SLURM_JOB_ID
 export OUTFILE="{output_path}/{label}.out"
 export SGLFILE="{output_path}/{label}.sgl"
+{env}
 {custom}
-source ~/.bashrc
 cd {project_path}
 {command}
 wait
@@ -254,8 +253,8 @@ class SlurmSubmitSOCK(SlurmSubmit):
 #SBATCH --mail-type=end
 export JOBID=$SLURM_JOB_ID
 export SOCNAME="{sockname}"
+{env}
 {custom}
-source ~/.bashrc
 cd {project_path}
 {command}
 wait
@@ -263,4 +262,5 @@ class SlurmSubmitSOCK(SlurmSubmit):
     script_handles = {runtk.SUBMIT: '{output_path}/{label}.sh',
                       runtk.STDOUT: '{output_path}/{label}.run',
                       runtk.SOCKET: '{sockname}'
-                      }
\ No newline at end of file
+                      }
+

From 15de957059b20ca5b36c48b49492e89a4f75118b Mon Sep 17 00:00:00 2001
From: James Chen <jchen.6727@gmail.com>
Date: Thu, 26 Sep 2024 13:11:14 -0500
Subject: [PATCH 2/2] quickfix -- runners validation now referring to mapping
 rather than coll

---
 netpyne/batchtools/runners.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netpyne/batchtools/runners.py b/netpyne/batchtools/runners.py
index 8289c8421..389ad2993 100644
--- a/netpyne/batchtools/runners.py
+++ b/netpyne/batchtools/runners.py
@@ -65,7 +65,7 @@ def update_items(d, u, force_match = False):
     for k, v in u.items():
         try:
             force_match and validate(k, d)
-            if isinstance(v, collections.abc.Container):
+            if isinstance(v, collections.abc.Mapping): #TODO this will currently break on lists of dicts
                 d[k] = update_items(d.get(k), v, force_match)
             else:
                 d[k] = v