From 06af02684889036d649b0ee05f1364bd4f4fcae5 Mon Sep 17 00:00:00 2001 From: vvbragin Date: Tue, 27 Dec 2022 18:03:54 +0100 Subject: [PATCH 1/5] fixed redundant warnings --- netpyne/batch/batch.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/netpyne/batch/batch.py b/netpyne/batch/batch.py index 759e9159d..c6fe5a006 100644 --- a/netpyne/batch/batch.py +++ b/netpyne/batch/batch.py @@ -22,17 +22,8 @@ except NameError: to_unicode = str -import imp -import json -import pickle -import logging import datetime -from copy import copy -from random import Random -from time import sleep, time -from itertools import product -from subprocess import Popen, PIPE -import importlib, types +from time import time from neuron import h from netpyne import specs @@ -42,21 +33,6 @@ from .evol import evolOptim from .asd_parallel import asdOptim -try: - from .optuna_parallel import optunaOptim -except: - pass - # print('Warning: Could not import "optuna" package...') - - -try: - from .sbi_parallel import sbiOptim -except: - pass - #print('Error @ the batch.py file import section') - - - pc = h.ParallelContext() # use bulletin board master/slave if pc.id()==0: pc.master_works_on_jobs(0) @@ -277,6 +253,7 @@ def run(self): # ------------------------------------------------------------------------------- elif self.method == 'optuna': try: + from .optuna_parallel import optunaOptim optunaOptim(self, pc) except Exception as e: import traceback @@ -288,6 +265,7 @@ def run(self): # ------------------------------------------------------------------------------- elif self.method == 'sbi': try: + from .sbi_parallel import sbiOptim sbiOptim(self, pc) except Exception as e: import traceback From 8383bd6bb51b9ede992ebc34b1da310eeed09035 Mon Sep 17 00:00:00 2001 From: vvbragin Date: Tue, 3 Jan 2023 21:13:14 +0100 Subject: [PATCH 2/5] gui support: removed duplicated code in gridSearch which might lead to errors, temporarily removed the line that lead to malfunction of UI simulations --- netpyne/batch/grid.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/netpyne/batch/grid.py b/netpyne/batch/grid.py index b40774d59..60d8b7429 100644 --- a/netpyne/batch/grid.py +++ b/netpyne/batch/grid.py @@ -185,40 +185,6 @@ def gridSearch(batch, pc): if batch.runCfg.get('type',None) == 'mpi_bulletin': pc.runworker() # only 1 runworker needed in rank0 - createFolder(batch.saveFolder) - - # save Batch dict as json - targetFile = batch.saveFolder+'/'+batch.batchLabel+'_batch.json' - batch.save(targetFile) - - # copy this batch script to folder - targetFile = batch.saveFolder+'/'+batch.batchLabel+'_batchScript.py' - os.system('cp ' + os.path.realpath(__file__) + ' ' + targetFile) - - # copy netParams source to folder - netParamsSavePath = batch.saveFolder+'/'+batch.batchLabel+'_netParams.py' - os.system('cp ' + batch.netParamsFile + ' ' + netParamsSavePath) - - # import cfg - if batch.cfg is None: - cfgModuleName = os.path.basename(batch.cfgFile).split('.')[0] - - try: - loader = importlib.machinery.SourceFileLoader(cfgModuleName, batch.cfgFile) - cfgModule = types.ModuleType(loader.name) - loader.exec_module(cfgModule) - except: - cfgModule = imp.load_source(cfgModuleName, batch.cfgFile) - - batch.cfg = cfgModule.cfg - - batch.cfg.checkErrors = False # avoid error checking during batch - - # set initial cfg initCfg - if len(batch.initCfg) > 0: - for paramLabel, paramVal in batch.initCfg.items(): - batch.setCfgNestedParam(paramLabel, paramVal) - processes, processFiles = [],[] if batch.method == 'list': From 7e1eda3d201384aa60116146a01caee2a1bc8174 Mon Sep 17 00:00:00 2001 From: vvbragin Date: Fri, 6 Jan 2023 15:00:46 +0100 Subject: [PATCH 3/5] remove h.quit() to make GUI experiment work --- netpyne/batch/grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netpyne/batch/grid.py b/netpyne/batch/grid.py index 60d8b7429..c8eacde53 100644 --- a/netpyne/batch/grid.py +++ b/netpyne/batch/grid.py @@ -246,7 +246,9 @@ def gridSearch(batch, pc): except: pass pc.done() - h.quit() + # TODO: line below was commented out due to issue on Netpyne-UI (https://dura-bernallab.slack.com/archives/C02UT6WECEL/p1671724489096569?thread_ts=1671646899.368969&cid=C02UT6WECEL) + # Needs to be re-visited. + # h.quit() def gridSubmit(batch, pc, netParamsSavePath, jobName, simLabel, processes, processFiles): From cabe68bcc7ac75c0b21e8b9c529379cdc45d48b4 Mon Sep 17 00:00:00 2001 From: vvbragin Date: Fri, 6 Jan 2023 15:30:42 +0100 Subject: [PATCH 4/5] added back missing import --- netpyne/batch/batch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/netpyne/batch/batch.py b/netpyne/batch/batch.py index c6fe5a006..b5d240106 100644 --- a/netpyne/batch/batch.py +++ b/netpyne/batch/batch.py @@ -24,6 +24,7 @@ import datetime from time import time +import importlib, types from neuron import h from netpyne import specs From 60eac58c00289f324f3784dd115cdde574184db7 Mon Sep 17 00:00:00 2001 From: vvbragin Date: Fri, 6 Jan 2023 15:32:20 +0100 Subject: [PATCH 5/5] VERSION 1.0.3.1 --- CHANGES.md | 4 ++++ doc/source/conf.py | 4 ++-- netpyne/__init__.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ad7ab1868..f8e341b28 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.0.3.1 + +- Hotfix to support new GUI functionality + # Version 1.0.3 **New features** diff --git a/doc/source/conf.py b/doc/source/conf.py index 30162cf37..c91f60e97 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -67,9 +67,9 @@ # built documents. # # The short X.Y version. -version = '1.0.3' +version = '1.0.3.1' # The full version, including alpha/beta/rc tags. -release = '1.0.3' +release = '1.0.3.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/netpyne/__init__.py b/netpyne/__init__.py index 145044e0a..3d199d1f4 100644 --- a/netpyne/__init__.py +++ b/netpyne/__init__.py @@ -4,7 +4,7 @@ NetPyNE consists of a number of sub-packages and modules. """ -__version__ = '1.0.3' +__version__ = '1.0.3.1' import os, sys display = os.getenv('DISPLAY') nogui = (sys.argv.count('-nogui')>0)