Skip to content

Commit

Permalink
Merge pull request #726 from suny-downstate-medical-center/release/1.…
Browse files Browse the repository at this point in the history
…0.3.1

PR from release/1.0.3.1 to master - VERSION 1.0.3.1
  • Loading branch information
vvbragin authored Jan 6, 2023
2 parents 90f2de9 + 60eac58 commit 9bc6384
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 1.0.3.1

- Hotfix to support new GUI functionality

# Version 1.0.3

**New features**
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion netpyne/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 3 additions & 24 deletions netpyne/batch/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +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
from time import time
import importlib, types

from neuron import h
Expand All @@ -42,21 +34,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)
Expand Down Expand Up @@ -277,6 +254,7 @@ def run(self):
# -------------------------------------------------------------------------------
elif self.method == 'optuna':
try:
from .optuna_parallel import optunaOptim
optunaOptim(self, pc)
except Exception as e:
import traceback
Expand All @@ -288,6 +266,7 @@ def run(self):
# -------------------------------------------------------------------------------
elif self.method == 'sbi':
try:
from .sbi_parallel import sbiOptim
sbiOptim(self, pc)
except Exception as e:
import traceback
Expand Down
38 changes: 3 additions & 35 deletions netpyne/batch/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -280,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):

Expand Down

0 comments on commit 9bc6384

Please sign in to comment.