You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(8) |
Jul
(3) |
Aug
(27) |
Sep
(10) |
Oct
(1) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(8) |
2013 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(2) |
Oct
(2) |
Nov
(2) |
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(13) |
Apr
(41) |
May
(20) |
Jun
(5) |
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(4) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:11:08
|
Python will not modify the string, so the string is a) made const so it can be stored in read-only segment, b) cast to (char*) because we know that it will not be modified. --- pymoose/moosemodule.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pymoose/moosemodule.cpp b/pymoose/moosemodule.cpp index 6641dd5..2dba27b 100644 --- a/pymoose/moosemodule.cpp +++ b/pymoose/moosemodule.cpp @@ -2053,7 +2053,7 @@ extern "C" { int define_destFinfos(const Cinfo * cinfo) { - static char * doc = "Destination field"; + static const char *doc = "Destination field"; const string& class_name = cinfo->name(); // Create methods for destFinfos. The tp_dict is initialized by // PyType_Ready. So we insert the dynamically generated @@ -2078,7 +2078,7 @@ extern "C" { strncpy(vec[curr_index].name, const_cast<char*>(destFinfo_name.c_str()), destFinfo_name.size()); - vec[curr_index].doc = doc; + vec[curr_index].doc = (char*) doc; vec[curr_index].get = (getter)moose_ObjId_get_destField_attr; PyObject * args = PyTuple_New(1); @@ -2230,7 +2230,7 @@ extern "C" { int define_lookupFinfos(const Cinfo * cinfo) { - static char * doc = "Lookup field"; + static const char *doc = "Lookup field"; const string & class_name = cinfo->name(); unsigned int num_lookupFinfos = cinfo->getNumLookupFinfo(); unsigned int curr_index = get_getsetdefs()[class_name].size(); @@ -2240,7 +2240,7 @@ extern "C" { get_getsetdefs()[class_name].push_back(getset); get_getsetdefs()[class_name][curr_index].name = (char*)calloc(lookupFinfo_name.size() + 1, sizeof(char)); strncpy(get_getsetdefs()[class_name][curr_index].name, const_cast<char*>(lookupFinfo_name.c_str()), lookupFinfo_name.size()); - get_getsetdefs()[class_name][curr_index].doc = doc; //moose_LookupField_documentation; + get_getsetdefs()[class_name][curr_index].doc = (char*) doc; //moose_LookupField_documentation; get_getsetdefs()[class_name][curr_index].get = (getter)moose_ObjId_get_lookupField_attr; PyObject * args = PyTuple_New(1); PyTuple_SetItem(args, 0, PyString_FromString(lookupFinfo_name.c_str())); @@ -2302,7 +2302,7 @@ extern "C" { int define_elementFinfos(const Cinfo * cinfo) { - static char * doc = "Element field\0"; + static const char *doc = "Element field"; const string & class_name = cinfo->name(); unsigned int num_fieldElementFinfo = cinfo->getNumFieldElementFinfo(); unsigned int curr_index = get_getsetdefs()[class_name].size(); @@ -2312,7 +2312,7 @@ extern "C" { get_getsetdefs()[class_name].push_back(getset); get_getsetdefs()[class_name][curr_index].name = (char*)calloc(finfo_name.size() + 1, sizeof(char)); strncpy(get_getsetdefs()[class_name][curr_index].name, const_cast<char*>(finfo_name.c_str()), finfo_name.size()); - get_getsetdefs()[class_name][curr_index].doc = doc; + get_getsetdefs()[class_name][curr_index].doc = (char*) doc; get_getsetdefs()[class_name][curr_index].get = (getter)moose_ObjId_get_elementField_attr; PyObject * args = PyTuple_New(1); PyTuple_SetItem(args, 0, PyString_FromString(finfo_name.c_str())); -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:11:00
|
--- python/moose/xmls_to_network/core/neuroml_to_moose.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/moose/xmls_to_network/core/neuroml_to_moose.py b/python/moose/xmls_to_network/core/neuroml_to_moose.py index 1ee74ad..fc013b9 100644 --- a/python/moose/xmls_to_network/core/neuroml_to_moose.py +++ b/python/moose/xmls_to_network/core/neuroml_to_moose.py @@ -55,7 +55,6 @@ prototype includes. from __future__ import print_function from future_builtins import zip, map import sys, os -from urllib2 import urlopen import numpy as np import neuroml2_parser as nml from units import SI -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:54
|
--- python/moose/alternate.py | 6 +++--- python/moose/graphutil.py | 2 +- python/moose/hdfutil.py | 2 +- python/moose/mtypes.py | 2 +- python/moose/multiscale/parser/MorphML.py | 2 +- python/moose/multiscale/parser/NetworkML.py | 6 +++--- python/moose/multiscale/parser/NeuroML.py | 6 +++--- python/moose/neuroml/MorphML.py | 2 +- python/moose/neuroml/NetworkML.py | 4 ++-- python/moose/neuroml/NeuroML.py | 6 +++--- python/moose/recording.py | 4 ++-- python/moose/utils.py | 4 ++-- python/moose/xmls_to_network/core/load_multi.py | 2 +- python/moose/xmls_to_network/core/neuroml_to_moose.py | 6 +++--- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/python/moose/alternate.py b/python/moose/alternate.py index ccd4f93..a7508b4 100644 --- a/python/moose/alternate.py +++ b/python/moose/alternate.py @@ -284,9 +284,9 @@ from __future__ import print_function from functools import partial import warnings from collections import defaultdict -import _moose -from _moose import __version__, VERSION, SVN_REVISION, useClock, setClock, start, reinit, stop, isRunning, loadModel, getFieldDict, getField, Id, ObjId, exists, seed -from _moose import wildcardFind as _wildcardFind # We override the original +from . import _moose +from ._moose import __version__, VERSION, SVN_REVISION, useClock, setClock, start, reinit, stop, isRunning, loadModel, getFieldDict, getField, Id, ObjId, exists, seed +from ._moose import wildcardFind as _wildcardFind # We override the original import __main__ as main sequence_types = [ 'vector<double>', diff --git a/python/moose/graphutil.py b/python/moose/graphutil.py index 13216f9..50baa48 100644 --- a/python/moose/graphutil.py +++ b/python/moose/graphutil.py @@ -32,7 +32,7 @@ from collections import defaultdict import re import networkx as nx import numpy as np -import moose +from . import moose def moosegraph(element, ies=['childMsg'], ied=['parentMsg'], iv=[], keep_solitary=False): """Create a graph out of all objects under teh element diff --git a/python/moose/hdfutil.py b/python/moose/hdfutil.py index b7d9ce6..dd01271 100644 --- a/python/moose/hdfutil.py +++ b/python/moose/hdfutil.py @@ -86,7 +86,7 @@ from __future__ import print_function from future_builtins import zip -import moose as moose__ +from . import moose as moose__ import numpy as np import h5py as h5 import time diff --git a/python/moose/mtypes.py b/python/moose/mtypes.py index 2f520ad..24064fd 100644 --- a/python/moose/mtypes.py +++ b/python/moose/mtypes.py @@ -47,7 +47,7 @@ from __future__ import print_function import re -import moose +from . import moose ##!!!!!!!!!!!!!!!!!!!!!!!!!!!! ## !! This was stolen from diff --git a/python/moose/multiscale/parser/MorphML.py b/python/moose/multiscale/parser/MorphML.py index e658d04..40b648b 100644 --- a/python/moose/multiscale/parser/MorphML.py +++ b/python/moose/multiscale/parser/MorphML.py @@ -24,7 +24,7 @@ from moose import utils as moose_utils from moose.neuroml import utils as neuroml_utils import helper.moose_methods as moose_methods -from ChannelML import ChannelML +from .ChannelML import ChannelML import core.config as config import debug.debug as debug import inspect diff --git a/python/moose/multiscale/parser/NetworkML.py b/python/moose/multiscale/parser/NetworkML.py index 9ec1562..42c6b11 100644 --- a/python/moose/multiscale/parser/NetworkML.py +++ b/python/moose/multiscale/parser/NetworkML.py @@ -27,8 +27,8 @@ from xml.etree import cElementTree as ET import string import os import sys -import MorphML -import ChannelML +from . import MorphML +from . import ChannelML import moose import moose.neuroml.utils as nmu import moose.utils as mu @@ -45,7 +45,7 @@ import matplotlib.pyplot as plt import numpy as np from math import cos, sin -import utils +from . import utils class NetworkML(object): diff --git a/python/moose/multiscale/parser/NeuroML.py b/python/moose/multiscale/parser/NeuroML.py index d78cd8e..0b23cc3 100644 --- a/python/moose/multiscale/parser/NeuroML.py +++ b/python/moose/multiscale/parser/NeuroML.py @@ -36,9 +36,9 @@ CHANGE LOG: from xml.etree import cElementTree as ET import sys -import MorphML -import NetworkML -import ChannelML +from . import MorphML +from . import NetworkML +from . import ChannelML import moose import moose.utils import moose.neuroml.utils as mnu diff --git a/python/moose/neuroml/MorphML.py b/python/moose/neuroml/MorphML.py index 38ab865..bdf0a3d 100644 --- a/python/moose/neuroml/MorphML.py +++ b/python/moose/neuroml/MorphML.py @@ -22,7 +22,7 @@ from os import path import moose from moose import utils as moose_utils from moose.neuroml import utils as neuroml_utils -from ChannelML import ChannelML +from .ChannelML import ChannelML class MorphML(): diff --git a/python/moose/neuroml/NetworkML.py b/python/moose/neuroml/NetworkML.py index b671d66..da1a456 100644 --- a/python/moose/neuroml/NetworkML.py +++ b/python/moose/neuroml/NetworkML.py @@ -16,8 +16,8 @@ from xml.etree import cElementTree as ET import string import os from math import cos, sin -from MorphML import MorphML -from ChannelML import ChannelML +from .MorphML import MorphML +from .ChannelML import ChannelML import moose from moose.neuroml.utils import meta_ns, nml_ns, find_first_file, tweak_model from moose import utils diff --git a/python/moose/neuroml/NeuroML.py b/python/moose/neuroml/NeuroML.py index 4594c0a..e5e4e60 100644 --- a/python/moose/neuroml/NeuroML.py +++ b/python/moose/neuroml/NeuroML.py @@ -25,9 +25,9 @@ from __future__ import print_function import moose from moose.utils import * from xml.etree import cElementTree as ET -from ChannelML import ChannelML -from MorphML import MorphML -from NetworkML import NetworkML +from .ChannelML import ChannelML +from .MorphML import MorphML +from .NetworkML import NetworkML import string from moose.neuroml.utils import * import sys diff --git a/python/moose/recording.py b/python/moose/recording.py index 21c60a2..e59a7b9 100644 --- a/python/moose/recording.py +++ b/python/moose/recording.py @@ -1,8 +1,8 @@ from __future__ import print_function from future_builtins import zip -import moose as _moose +from . import moose as _moose -from _compat import basestr +from ._compat import basestr _tick = 8 _base = '/_utils' diff --git a/python/moose/utils.py b/python/moose/utils.py index 9b1c49a..5b1cf7b 100644 --- a/python/moose/utils.py +++ b/python/moose/utils.py @@ -8,9 +8,9 @@ __date__ = '21 November 2012' import types, parser, token, symbol, string, os, math from datetime import datetime -import _moose +from . import _moose -from _compat import basestring +from ._compat import basestring ## for Ca Pool #FARADAY = 96154.0 # Coulombs # from cadecay.mod : 1/(2*96154.0) = 5.2e-6 which is the Book of Genesis / readcell value diff --git a/python/moose/xmls_to_network/core/load_multi.py b/python/moose/xmls_to_network/core/load_multi.py index ec3db24..6a197b2 100644 --- a/python/moose/xmls_to_network/core/load_multi.py +++ b/python/moose/xmls_to_network/core/load_multi.py @@ -23,7 +23,7 @@ import os os.environ['NUMPTHREADS'] = '1' import signal import math -import proto +from . import proto import parser.importer import debug.debug as debug diff --git a/python/moose/xmls_to_network/core/neuroml_to_moose.py b/python/moose/xmls_to_network/core/neuroml_to_moose.py index fc013b9..fd13b49 100644 --- a/python/moose/xmls_to_network/core/neuroml_to_moose.py +++ b/python/moose/xmls_to_network/core/neuroml_to_moose.py @@ -56,9 +56,9 @@ from __future__ import print_function from future_builtins import zip, map import sys, os import numpy as np -import neuroml2_parser as nml -from units import SI -import hhfit +from . import neuroml2_parser as nml +from .units import SI +from . import hhfit import logging import debug.debug as debug from IPython import embed -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:46
|
Various fields PySequenceMethods were deprecated, but not actually removed from the structure. This means that they should be filled with 0's. --- pymoose/ematrix.cpp | 14 ++++++++------ pymoose/moosemodule.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pymoose/ematrix.cpp b/pymoose/ematrix.cpp index 726ca05..72d9558 100644 --- a/pymoose/ematrix.cpp +++ b/pymoose/ematrix.cpp @@ -123,13 +123,13 @@ extern "C" { 0, //sq_concat 0, //sq_repeat (ssizeargfunc)moose_Id_getItem, //sq_item -#ifndef PY3K +#ifdef PY3K + 0, // was_sq_slice +#else (ssizessizeargfunc)moose_Id_getSlice, // getslice #endif - 0, //sq_ass_item -#ifndef PY3K - 0, // setslice -#endif + 0, // sq_ass_item + 0, // sq_ass_slice / was_sq_ass_slice (objobjproc)moose_Id_contains, // sq_contains 0, // sq_inplace_concat 0 // sq_inplace_repeat @@ -563,7 +563,8 @@ extern "C" { ret->oid_ = ObjId(self->id_, index); return (PyObject*)ret; } - + +#ifndef PY3K PyObject * moose_Id_getSlice(_Id * self, PyObject * args) { if (!Id::isValid(self->id_)){ @@ -599,6 +600,7 @@ extern "C" { } return ret; } +#endif /////////////////////////////////////////////////// // Mapping protocol diff --git a/pymoose/moosemodule.h b/pymoose/moosemodule.h index e01b323..5b2b6e6 100644 --- a/pymoose/moosemodule.h +++ b/pymoose/moosemodule.h @@ -174,7 +174,9 @@ extern "C" { /* Id functions to allow part of sequence protocol */ Py_ssize_t moose_Id_getLength(_Id * self); PyObject * moose_Id_getItem(_Id * self, Py_ssize_t index); +#ifndef PY3K PyObject * moose_Id_getSlice(_Id * self, PyObject * args); +#endif PyObject * moose_Id_getShape(_Id * self); PyObject * moose_Id_subscript(_Id * self, PyObject * op); PyObject * moose_Id_richCompare(_Id * self, PyObject * args, int op); -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:39
|
This makes the code more palatable for 2to3, which then doesn't try to wrap all uses of .keys() with list(). --- python/moose/alternate.py | 8 +++---- python/moose/graphutil.py | 2 +- python/moose/hdfutil.py | 28 ++++++++++------------ python/moose/moose.py | 6 ++--- python/moose/moose_py3k.py | 6 ++--- python/moose/multiscale/core/simulator.py | 4 ++-- python/moose/multiscale/helper/graph_methods.py | 4 ++-- python/moose/multiscale/helper/moose_methods.py | 1 + python/moose/multiscale/parser/ChannelML.py | 6 ++--- python/moose/multiscale/parser/MorphML.py | 4 ++-- python/moose/multiscale/parser/utils.py | 2 +- python/moose/neuroml/ChannelML.py | 6 ++--- python/moose/neuroml/MorphML.py | 4 ++-- python/moose/neuroml/utils.py | 2 +- python/moose/neuroml2/converter.py | 3 ++- python/moose/neuroml2/generated_neuroml.py | 5 +--- python/moose/neuroml2/hhfit.py | 2 +- python/moose/xmls_to_network/.noweb/main.nw | 6 ++--- python/moose/xmls_to_network/core/hhfit.py | 2 +- python/moose/xmls_to_network/core/multiscale.py | 2 +- .../moose/xmls_to_network/core/neuroml2_parser.py | 5 +--- .../moose/xmls_to_network/helper/graph_methods.py | 4 ++-- python/moose/xmls_to_network/parser/nml_parser.py | 5 +--- .../generatedNEURON/NEURONUtils/NEURONSimUtils.py | 2 +- .../NeuroMLUtils/NetworkMLHDF5Handler.py | 8 +++---- .../NeuroMLUtils/NetworkMLSaxHandler.py | 16 ++++++------- .../twoNeurons/generatedNEURON/twoNeurons.hoc | 4 ++-- .../NeuroMLUtils/NetworkMLHDF5Handler.py | 8 +++---- .../NeuroMLUtils/NetworkMLSaxHandler.py | 10 ++++---- .../generatedPyNN/PyNNUtils/PyNNUtils.py | 4 ++-- 30 files changed, 80 insertions(+), 89 deletions(-) diff --git a/python/moose/alternate.py b/python/moose/alternate.py index 24a0d41..ccd4f93 100644 --- a/python/moose/alternate.py +++ b/python/moose/alternate.py @@ -669,7 +669,7 @@ class Neutral(object): return self.oid_.getFieldNames(ftype) def getNeighbors(self, fieldName): - if fieldName in getFieldDict(self.className).keys(): + if fieldName in getFieldDict(self.className): return [eval('%s("%s")' % (id_[0].getField('class'), id_.getPath())) for id_ in self.oid_.getNeighbors(fieldName)] raise ValueError('%s: no such field on %s' % (fieldName, self.path)) @@ -885,8 +885,8 @@ def showfield(element, field='*', showtype=False): element = Neutral(element) if field == '*': value_field_dict = getFieldDict(element.className, 'valueFinfo') - max_type_len = max([len(dtype) for dtype in value_field_dict.values()]) - max_field_len = max([len(dtype) for dtype in value_field_dict.keys()]) + max_type_len = max(len(dtype) for dtype in value_field_dict.values()) + max_field_len = max(len(dtype) for dtype in value_field_dict) print() print('[', element.path, ']') for key, dtype in value_field_dict.items(): @@ -1003,7 +1003,7 @@ def update_class(cls, class_id): def define_class(class_id): """Define a class based on Cinfo element with Id=class_id.""" class_name = class_id[0].getField('name') - if class_name in globals().keys(): + if class_name in globals(): return base = class_id[0].getField('baseClass') if base != 'none': diff --git a/python/moose/graphutil.py b/python/moose/graphutil.py index c62db9f..13216f9 100644 --- a/python/moose/graphutil.py +++ b/python/moose/graphutil.py @@ -171,7 +171,7 @@ class TestMooseGraph(unittest.TestCase): def test_edgelabels(self): for ee in self.graph.edges(): - keys = self.graph.edge[ee[0]][ee[1]].keys() + keys = self.graph.edge[ee[0]][ee[1]] self.assertTrue('src' in keys) self.assertTrue('dest' in keys) diff --git a/python/moose/hdfutil.py b/python/moose/hdfutil.py index a17ff5a..b7d9ce6 100644 --- a/python/moose/hdfutil.py +++ b/python/moose/hdfutil.py @@ -85,6 +85,7 @@ # Code: from __future__ import print_function +from future_builtins import zip import moose as moose__ import numpy as np import h5py as h5 @@ -122,19 +123,17 @@ def get_rec_dtype(em): print('Creating entries for class:', obj.className) fielddict = moose__.getFieldDict(obj.className, 'valueFinfo') print(fielddict) - keys = sorted(list(fielddict.keys())) - fields = [] # [('path', 'S1024')] - for fieldname in keys: - ftype = fielddict[fieldname] - # If we do not have the type of this field in cpp-np data - # type map, skip it. We can handle vectors as nested - # table, but the problem with that is numpy requires all - # entries to have a fixed size for this table. Since - # vectors can have arbitrary length, we cannot get such a - # fixed size without checking the size of the vector field - # in all elements. - if ftype in cpptonp: - fields.append((fieldname, cpptonp[ftype])) + + # If we do not have the type of this field in cpp-np data + # type map, skip it. We can handle vectors as nested + # table, but the problem with that is numpy requires all + # entries to have a fixed size for this table. Since + # vectors can have arbitrary length, we cannot get such a + # fixed size without checking the size of the vector field + # in all elements. + fields = [(fieldname, cpptonp[ftype]) # [('path', 'S1024')] + for fieldname, ftype in sorted(fielddict.items()) + if ftype in cpptonp] dtype_table[obj.className] = np.dtype(fields) return dtype_table[obj.className] @@ -257,7 +256,7 @@ def savestate(filename=None): print('Creating entries for class:', obj.className) fielddict = moose__.getFieldDict(obj.className, 'valueFinfo') print(fielddict) - keys = sorted(list(fielddict.keys())) + keys = sorted(fielddict) fields = [] # [('path', 'S1024')] for fieldname in keys: ftype = fielddict[fieldname] @@ -309,7 +308,6 @@ def restorestate(filename): if f.startswith('set_') and f not in ['set_this', 'set_name', 'set_lastDimension', 'set_runTime'] and not f.startswith('set_num_')] with h5.File(filename, 'r') as fd: typeinfo = fd['/metadata/typeinfo'][:] - classdict = {} dimsdict = dict(zip(typeinfo['path'], typeinfo['dims'])) classdict = dict(zip(typeinfo['path'], typeinfo['class'])) parentdict = dict(zip(typeinfo['path'], typeinfo['parent'])) diff --git a/python/moose/moose.py b/python/moose/moose.py index af62d19..e995ab6 100644 --- a/python/moose/moose.py +++ b/python/moose/moose.py @@ -162,10 +162,10 @@ def showfield(el, field='*', showtype=False): el = element(el) if field == '*': value_field_dict = getFieldDict(el.className, 'valueFinfo') - max_type_len = max([len(dtype) for dtype in list(value_field_dict.values())]) - max_field_len = max([len(dtype) for dtype in list(value_field_dict.keys())]) + max_type_len = max(len(dtype) for dtype in value_field_dict.values()) + max_field_len = max(len(dtype) for dtype in value_field_dict) print('\n[', el.path, ']') - for key, dtype in list(value_field_dict.items()): + for key, dtype in value_field_dict.items(): if dtype == 'bad' or key == 'this' or key == 'dummy' or key == 'me' or dtype.startswith('vector') or 'ObjId' in dtype: continue value = el.getField(key) diff --git a/python/moose/moose_py3k.py b/python/moose/moose_py3k.py index f4c5302..0a8e82d 100644 --- a/python/moose/moose_py3k.py +++ b/python/moose/moose_py3k.py @@ -156,10 +156,10 @@ def showfield(elem, field='*', showtype=False): elem = element(elem) if field == '*': value_field_dict = getFieldDict(elem.className, 'valueFinfo') - max_type_len = max([len(dtype) for dtype in list(value_field_dict.values())]) - max_field_len = max([len(dtype) for dtype in list(value_field_dict.keys())]) + max_type_len = max(len(dtype) for dtype in value_field_dict.values()) + max_field_len = max(len(dtype) for dtype in value_field_dict) print('\n[', elem.path, ']') - for key, dtype in list(value_field_dict.items()): + for key, dtype in value_field_dict.items(): if dtype == 'bad' or key == 'this' or key == 'dummy' or key == 'me' or dtype.startswith('vector') or 'ObjId' in dtype: continue value = elem.getField(key) diff --git a/python/moose/multiscale/core/simulator.py b/python/moose/multiscale/core/simulator.py index 03f519b..ed6ffb6 100644 --- a/python/moose/multiscale/core/simulator.py +++ b/python/moose/multiscale/core/simulator.py @@ -320,7 +320,7 @@ class Simulator: # for i, var in enumerate(variables): # varType, varName, plotXml = var # varName = varType + varName -# assert varName in self.tableDict.keys() +# assert varName in self.tableDict # configDict = self.configurePlot(plotXml) # yvec, xvec = self.getPlotData(varName) # pylab.subplot(self.totalPlots, 1, i) @@ -401,7 +401,7 @@ class Simulator: def getPlotData(self, varName): """Get the plot data from dictionary """ - assert varName in self.tableDict.keys(), "{} not found in {}".format( + assert varName in self.tableDict, "{} not found in {}".format( varName , self.tableDict.keys() ) diff --git a/python/moose/multiscale/helper/graph_methods.py b/python/moose/multiscale/helper/graph_methods.py index b5d1360..6135e5c 100644 --- a/python/moose/multiscale/helper/graph_methods.py +++ b/python/moose/multiscale/helper/graph_methods.py @@ -46,7 +46,7 @@ def write_dot(g, filename): for n in g.nodes(): i += 1 nodeLabel = "[label=\"\"".format(i) - if 'proximal' in g.node[n].keys(): + if 'proximal' in g.node[n]: x = (float(g.node[n]['proximal'].get('x')) + float(g.node[n]['distal'].get('x')))/2 y = (float(g.node[n]['proximal'].get('y')) + float(g.node[n]['distal'].get('y')))/2 z = (float(g.node[n]['proximal'].get('z')) + float(g.node[n]['distal'].get('z')))/2 @@ -65,7 +65,7 @@ def write_dot(g, filename): for (f, t) in g.edges(): edge = g.node[f]['label'] + " -> " + g.node[t]['label'] edge += " [" - if 'synapse' in g.edge[f][t].keys(): + if 'synapse' in g.edge[f][t]: # color this edge and make it look like a synapse edge += " label=\"{0}\",".format(g.edge[f][t]['id']) edge += "color=blue,style=dotted," diff --git a/python/moose/multiscale/helper/moose_methods.py b/python/moose/multiscale/helper/moose_methods.py index e3e9d68..f19c0a1 100644 --- a/python/moose/multiscale/helper/moose_methods.py +++ b/python/moose/multiscale/helper/moose_methods.py @@ -8,6 +8,7 @@ Last modified: Tue Jan 28, 2014 10:31PM """ from __future__ import print_function +from future_builtins import filter __author__ = "Dilawar Singh" __copyright__ = "Copyright 2013, NCBS Bangalore" diff --git a/python/moose/multiscale/parser/ChannelML.py b/python/moose/multiscale/parser/ChannelML.py index 48f642e..e1a819d 100644 --- a/python/moose/multiscale/parser/ChannelML.py +++ b/python/moose/multiscale/parser/ChannelML.py @@ -226,7 +226,7 @@ class ChannelML: q10sets = IVrelation.findall('./{'+self.cml+'}q10_settings') for q10settings in q10sets: # self.temperature from neuro.utils - if 'gate' in list(q10settings.attrib.keys()): + if 'gate' in q10settings.attrib: if q10settings.attrib['gate'] == self.gate_name: self.setQ10(q10settings) break @@ -400,12 +400,12 @@ class ChannelML: def setQ10(self, q10settings): - if 'q10_factor' in list(q10settings.attrib.keys()): + if 'q10_factor' in q10settings.attrib: expTemp = float(q10settings.attrib['experimental_temp']) self.q10factor = float(q10settings.attrib['q10_factor']) ** ( ( self.temperature - expTemp) /10.0 ) - elif 'fixed_q10' in list(q10settings.attrib.keys()): + elif 'fixed_q10' in q10settings.attrib: self.q10factor = float(q10settings.attrib['fixed_q10']) diff --git a/python/moose/multiscale/parser/MorphML.py b/python/moose/multiscale/parser/MorphML.py index d492541..e658d04 100644 --- a/python/moose/multiscale/parser/MorphML.py +++ b/python/moose/multiscale/parser/MorphML.py @@ -285,7 +285,7 @@ class MorphML(): cablegroups = cable.findall(".//{"+self.meta+"}group") for cablegroup in cablegroups: cablegroupname = cablegroup.text - if cablegroupname in list(self.cablegroupsDict.keys()): + if cablegroupname in self.cablegroupsDict: self.cablegroupsDict[cablegroupname].append(cableid) else: self.cablegroupsDict[cablegroupname] = [cableid] @@ -306,7 +306,7 @@ class MorphML(): """ synLocs = cell.findall(".//{"+self.nml+"}potential_syn_loc") for psl in synLocs: - if 'synapse_direction' in list(psl.attrib.keys()): + if 'synapse_direction' in psl.attrib: if psl.attrib['synapse_direction'] in ['post']: self.set_group_compartment_param( cell diff --git a/python/moose/multiscale/parser/utils.py b/python/moose/multiscale/parser/utils.py index 18e2ae2..749c28d 100644 --- a/python/moose/multiscale/parser/utils.py +++ b/python/moose/multiscale/parser/utils.py @@ -196,7 +196,7 @@ def keepOnlyInclude(network, onlyInclude): populations = network.find(".//{"+nml_ns+"}populations") for population in network.findall(".//{"+nml_ns+"}population"): popname = population.attrib["name"] - if popname in list(includeCellsDict.keys()): + if popname in includeCellsDict: includecellids = includeCellsDict[popname] instances = population.find(".//{"+nml_ns+"}instances") for instance in instances.findall(".//{"+nml_ns+"}instance"): diff --git a/python/moose/neuroml/ChannelML.py b/python/moose/neuroml/ChannelML.py index 830ee4b..3cc3fc6 100644 --- a/python/moose/neuroml/ChannelML.py +++ b/python/moose/neuroml/ChannelML.py @@ -149,7 +149,7 @@ class ChannelML(): self.gate_name = gate.attrib['name'] for q10settings in IVrelation.findall('./{'+self.cml+'}q10_settings'): ## self.temperature from neuro.utils - if 'gate' in q10settings.attrib.keys(): + if 'gate' in q10settings.attrib: if q10settings.attrib['gate'] == self.gate_name: self.setQ10(q10settings) break @@ -301,10 +301,10 @@ class ChannelML(): moosegate_tableB.tableVector2D = tableB def setQ10(self,q10settings): - if 'q10_factor' in q10settings.attrib.keys(): + if 'q10_factor' in q10settings.attrib: self.q10factor = float(q10settings.attrib['q10_factor'])\ **((self.temperature-float(q10settings.attrib['experimental_temp']))/10.0) - elif 'fixed_q10' in q10settings.attrib.keys(): + elif 'fixed_q10' in q10settings.attrib: self.q10factor = float(q10settings.attrib['fixed_q10']) diff --git a/python/moose/neuroml/MorphML.py b/python/moose/neuroml/MorphML.py index 08a20d4..38ab865 100644 --- a/python/moose/neuroml/MorphML.py +++ b/python/moose/neuroml/MorphML.py @@ -208,7 +208,7 @@ class MorphML(): cablegroups = cable.findall(".//{"+self.meta+"}group") for cablegroup in cablegroups: cablegroupname = cablegroup.text - if cablegroupname in self.cablegroupsDict.keys(): + if cablegroupname in self.cablegroupsDict: self.cablegroupsDict[cablegroupname].append(cableid) else: self.cablegroupsDict[cablegroupname] = [cableid] @@ -337,7 +337,7 @@ class MorphML(): connectivity = cell.find(".//{"+self.neuroml+"}connectivity") if connectivity is not None: for potential_syn_loc in cell.findall(".//{"+self.nml+"}potential_syn_loc"): - if 'synapse_direction' in potential_syn_loc.attrib.keys(): + if 'synapse_direction' in potential_syn_loc.attrib: if potential_syn_loc.attrib['synapse_direction'] in ['post']: self.set_group_compartment_param(cell, cellname, potential_syn_loc,\ 'synapse_type', potential_syn_loc.attrib['synapse_type'], self.nml, mechanismname='synapse') diff --git a/python/moose/neuroml/utils.py b/python/moose/neuroml/utils.py index 3a1e3c0..749c28d 100644 --- a/python/moose/neuroml/utils.py +++ b/python/moose/neuroml/utils.py @@ -196,7 +196,7 @@ def keepOnlyInclude(network, onlyInclude): populations = network.find(".//{"+nml_ns+"}populations") for population in network.findall(".//{"+nml_ns+"}population"): popname = population.attrib["name"] - if popname in includeCellsDict.keys(): + if popname in includeCellsDict: includecellids = includeCellsDict[popname] instances = population.find(".//{"+nml_ns+"}instances") for instance in instances.findall(".//{"+nml_ns+"}instance"): diff --git a/python/moose/neuroml2/converter.py b/python/moose/neuroml2/converter.py index 24c64ce..d932581 100644 --- a/python/moose/neuroml2/converter.py +++ b/python/moose/neuroml2/converter.py @@ -50,6 +50,7 @@ #!!!!! TODO: unit conversion !!!! +from future_builtins import map import traceback import warnings from collections import deque @@ -111,7 +112,7 @@ def convert_morphology(root, positions='auto'): y=compartment.y, z=compartment.z, diameter=compartment.diameter) - plist = map(moose.element, compartment.neighbours['axial']) + plist = list(map(moose.element, compartment.neighbours['axial'])) try: parent = neuroml.SegmentParent(segments=comp_seg[moose.element(plist[0])].id) except (KeyError, IndexError) as e: diff --git a/python/moose/neuroml2/generated_neuroml.py b/python/moose/neuroml2/generated_neuroml.py index 0ea0243..e39161d 100644 --- a/python/moose/neuroml2/generated_neuroml.py +++ b/python/moose/neuroml2/generated_neuroml.py @@ -14,10 +14,7 @@ import datetime as datetime_ etree_ = None Verbose_import_ = False -( - XMLParser_import_none, XMLParser_import_lxml, - XMLParser_import_elementtree -) = range(3) +XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree = 0, 1, 2 XMLParser_import_library = None try: # lxml diff --git a/python/moose/neuroml2/hhfit.py b/python/moose/neuroml2/hhfit.py index fe4165e..764d1c8 100644 --- a/python/moose/neuroml2/hhfit.py +++ b/python/moose/neuroml2/hhfit.py @@ -214,7 +214,7 @@ def find_ratefn(x, y, **kwargs): rms_error = 1e10 # arbitrarily setting this best_fn = None best_p = None - for fn in fn_rate_map.keys(): + for fn in fn_rate_map: p = randomized_curve_fit(fn, x, y, **kwargs) if p is None: continue diff --git a/python/moose/xmls_to_network/.noweb/main.nw b/python/moose/xmls_to_network/.noweb/main.nw index 685e697..08402d1 100644 --- a/python/moose/xmls_to_network/.noweb/main.nw +++ b/python/moose/xmls_to_network/.noweb/main.nw @@ -544,13 +544,13 @@ for nw in network : if xml_helper.isTaggedWith(nw, "population") : try : populationId = nw.get('id') - if 'cell' in nw.keys() : + if 'cell' in nw : typeOfPopulation = 'cell' populationId = nw.get('cell') - elif 'network' in nw.keys() : + elif 'network' in nw : typeOfPopulation = 'network' populationId = nw.get('network') - elif 'component' in nw.keys() : + elif 'component' in nw : debug.printDebug("DEVL", "Component in network is not implmeneted yet.") else : pass print typeOfPopulation, populationId diff --git a/python/moose/xmls_to_network/core/hhfit.py b/python/moose/xmls_to_network/core/hhfit.py index e367a5e..1aeef89 100644 --- a/python/moose/xmls_to_network/core/hhfit.py +++ b/python/moose/xmls_to_network/core/hhfit.py @@ -214,7 +214,7 @@ def find_ratefn(x, y, **kwargs): rms_error = 1e10 # arbitrarily setting this best_fn = None best_p = None - for fn in fn_rate_map.keys(): + for fn in fn_rate_map: p = randomized_curve_fit(fn, x, y, **kwargs) if p is None: continue diff --git a/python/moose/xmls_to_network/core/multiscale.py b/python/moose/xmls_to_network/core/multiscale.py index a78d72a..5ab62e6 100644 --- a/python/moose/xmls_to_network/core/multiscale.py +++ b/python/moose/xmls_to_network/core/multiscale.py @@ -151,7 +151,7 @@ class Multiscale: segName = os.path.join(instId, cellType, segmentId) self.mooseG.add_node(segName) self.mooseG.node[segName]['population'] = populationName - for k in cellG.node[n].keys(): + for k in cellG.node[n]: self.mooseG.node[segName][k] = cellG.node[n][k] self.attachLabel(self.mooseG, segName) diff --git a/python/moose/xmls_to_network/core/neuroml2_parser.py b/python/moose/xmls_to_network/core/neuroml2_parser.py index 89fa1de..4e20177 100644 --- a/python/moose/xmls_to_network/core/neuroml2_parser.py +++ b/python/moose/xmls_to_network/core/neuroml2_parser.py @@ -14,10 +14,7 @@ import datetime as datetime_ etree_ = None Verbose_import_ = False -( - XMLParser_import_none, XMLParser_import_lxml, - XMLParser_import_elementtree -) = range(3) +XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree = 0, 1, 2 XMLParser_import_library = None try: # lxml diff --git a/python/moose/xmls_to_network/helper/graph_methods.py b/python/moose/xmls_to_network/helper/graph_methods.py index b5d1360..6135e5c 100644 --- a/python/moose/xmls_to_network/helper/graph_methods.py +++ b/python/moose/xmls_to_network/helper/graph_methods.py @@ -46,7 +46,7 @@ def write_dot(g, filename): for n in g.nodes(): i += 1 nodeLabel = "[label=\"\"".format(i) - if 'proximal' in g.node[n].keys(): + if 'proximal' in g.node[n]: x = (float(g.node[n]['proximal'].get('x')) + float(g.node[n]['distal'].get('x')))/2 y = (float(g.node[n]['proximal'].get('y')) + float(g.node[n]['distal'].get('y')))/2 z = (float(g.node[n]['proximal'].get('z')) + float(g.node[n]['distal'].get('z')))/2 @@ -65,7 +65,7 @@ def write_dot(g, filename): for (f, t) in g.edges(): edge = g.node[f]['label'] + " -> " + g.node[t]['label'] edge += " [" - if 'synapse' in g.edge[f][t].keys(): + if 'synapse' in g.edge[f][t]: # color this edge and make it look like a synapse edge += " label=\"{0}\",".format(g.edge[f][t]['id']) edge += "color=blue,style=dotted," diff --git a/python/moose/xmls_to_network/parser/nml_parser.py b/python/moose/xmls_to_network/parser/nml_parser.py index 1930979..16f4186 100644 --- a/python/moose/xmls_to_network/parser/nml_parser.py +++ b/python/moose/xmls_to_network/parser/nml_parser.py @@ -14,10 +14,7 @@ import datetime as datetime_ etree_ = None Verbose_import_ = False -( - XMLParser_import_none, XMLParser_import_lxml, - XMLParser_import_elementtree -) = range(3) +XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree = 0, 1, 2 XMLParser_import_library = None try: # lxml diff --git a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NEURONUtils/NEURONSimUtils.py b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NEURONUtils/NEURONSimUtils.py index a5ea349..5432bc3 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NEURONUtils/NEURONSimUtils.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NEURONUtils/NEURONSimUtils.py @@ -125,7 +125,7 @@ class NetManagerNEURON(NetworkHandler): self.log.info("Projection: "+projName+" from "+source+" to "+target+" with "+sizeInfo) - for synapseType in synapseTypes.keys(): + for synapseType in synapseTypes: synObjName = projName+"_"+synapseType+"["+str(size)+"]" self.log.info("Creating array for syns: "+synObjName) diff --git a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLHDF5Handler.py b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLHDF5Handler.py index ac85153..ac285f4 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLHDF5Handler.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLHDF5Handler.py @@ -150,7 +150,7 @@ class NetworkMLHDF5Handler(): elif val == 'post_fraction_along' or val[0] == 'post_fraction_along': indexPostFractAlong = int(attrName[len('column_'):]) - for synType in self.globalSynapseProps.keys(): + for synType in self.globalSynapseProps: if str(val).count(synType) >0: extraParamIndices[str(val)] = int(attrName[len('column_'):]) @@ -164,7 +164,7 @@ class NetworkMLHDF5Handler(): for i in range(0, d.shape[0]): row = d[i,:] localSynapseProps = {} - synTypes = self.globalSynapseProps.keys() + synTypes = self.globalSynapseProps for synType in synTypes: localSynapseProps[synType] = self.globalSynapseProps[synType].copy() @@ -186,7 +186,7 @@ class NetworkMLHDF5Handler(): if len(extraParamIndices)>0: for synType in localSynapseProps: - for paramName in extraParamIndices.keys(): + for paramName in extraParamIndices: if paramName.count(synType)>0: self.log.debug(paramName +"->"+synType) if paramName.count('weight')>0: @@ -206,7 +206,7 @@ class NetworkMLHDF5Handler(): self.log.debug("Connection %d from %f to %f" % (id, preCellId, postCellId)) - for synType in localSynapseProps.keys(): + for synType in localSynapseProps: synProps = localSynapseProps[synType] diff --git a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLSaxHandler.py b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLSaxHandler.py index e73b0b2..fed1d85 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLSaxHandler.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/NeuroMLUtils/NetworkMLSaxHandler.py @@ -223,7 +223,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.postFract = 0.5 self.localSynapseProps.clear() - synTypes = self.globalSynapseProps.keys() + synTypes = self.globalSynapseProps for synType in synTypes: self.localSynapseProps[synType] = self.globalSynapseProps[synType].copy() @@ -282,7 +282,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.globalSynapseProps[self.latestSynapseType] = newSynapseProps - for synProp in self.globalSynapseProps.keys(): + for synProp in self.globalSynapseProps: self.log.debug("globalSynapseProp "+synProp+": "+ str(self.globalSynapseProps[synProp])) @@ -310,7 +310,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.globalSynapseProps[self.latestSynapseType] = newSynapseProps - for synProp in self.globalSynapseProps.keys(): + for synProp in self.globalSynapseProps: self.log.debug("globalSynapseProp "+synProp+": "+ str(self.globalSynapseProps[synProp])) @@ -322,7 +322,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): if 'synapse_type' in attrs: synapse_type = attrs.get('synapse_type',"") elif len(self.localSynapseProps) == 1: - synapse_type = self.localSynapseProps.keys()[0] + synapse_type = self.localSynapseProps.popitem()[0] if synapse_type != "": synProps = self.localSynapseProps[synapse_type] @@ -388,9 +388,9 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): else: - others = ["populations", "projections", "connections", "inputs", - "meta:tag", "meta:value", "meta:property", "meta:properties"] - if (others.count(name) == 0): + others = {"populations", "projections", "connections", "inputs", + "meta:tag", "meta:value", "meta:property", "meta:properties"} + if name not in others: print('Unhandled, unknown element: '+ name) return @@ -455,7 +455,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.log.debug(" Gathered all details of connection: " + self.currentConnId) - for synType in self.localSynapseProps.keys(): + for synType in self.localSynapseProps: synProps = self.localSynapseProps[synType] diff --git a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/twoNeurons.hoc b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/twoNeurons.hoc index 8c264ee..d1b303d 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedNEURON/twoNeurons.hoc +++ b/python/moose/xmls_to_network/twoNeurons/generatedNEURON/twoNeurons.hoc @@ -349,7 +349,7 @@ for cellNum=0, n_PurkinjeCellGroup-1 { {nrnpython("group1._v_attrs.Population = 'PurkinjeCellGroup'")} {nrnpython("hArray = h5file.createArray(group1, 'VOLTAGE', allData, 'Values of VOLTAGE from cell group: PurkinjeCellGroup')")} {nrnpython("hArray.setAttr('Variable', 'VOLTAGE')")} -{nrnpython("for columnIndex in columnsVsCellNums.keys(): hArray.setAttr('column_'+str(columnIndex), 'cellNum_'+ str(columnsVsCellNums[columnIndex]))")} +{nrnpython("for columnIndex in columnsVsCellNums: hArray.setAttr('column_'+str(columnIndex), 'cellNum_'+ str(columnsVsCellNums[columnIndex]))")} // Saving VOLTAGE on only one seg, id: 0, in the only cell in SimpleCellGroup @@ -381,7 +381,7 @@ for cellNum=0, n_SimpleCellGroup-1 { {nrnpython("group1._v_attrs.Population = 'SimpleCellGroup'")} {nrnpython("hArray = h5file.createArray(group1, 'VOLTAGE', allData, 'Values of VOLTAGE from cell group: SimpleCellGroup')")} {nrnpython("hArray.setAttr('Variable', 'VOLTAGE')")} -{nrnpython("for columnIndex in columnsVsCellNums.keys(): hArray.setAttr('column_'+str(columnIndex), 'cellNum_'+ str(columnsVsCellNums[columnIndex]))")} +{nrnpython("for columnIndex in columnsVsCellNums: hArray.setAttr('column_'+str(columnIndex), 'cellNum_'+ str(columnsVsCellNums[columnIndex]))")} { sprint(timeFilename, "%s%s", targetDir, "time.dat")} { f_time.wopen(timeFilename) } diff --git a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLHDF5Handler.py b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLHDF5Handler.py index ac85153..ac285f4 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLHDF5Handler.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLHDF5Handler.py @@ -150,7 +150,7 @@ class NetworkMLHDF5Handler(): elif val == 'post_fraction_along' or val[0] == 'post_fraction_along': indexPostFractAlong = int(attrName[len('column_'):]) - for synType in self.globalSynapseProps.keys(): + for synType in self.globalSynapseProps: if str(val).count(synType) >0: extraParamIndices[str(val)] = int(attrName[len('column_'):]) @@ -164,7 +164,7 @@ class NetworkMLHDF5Handler(): for i in range(0, d.shape[0]): row = d[i,:] localSynapseProps = {} - synTypes = self.globalSynapseProps.keys() + synTypes = self.globalSynapseProps for synType in synTypes: localSynapseProps[synType] = self.globalSynapseProps[synType].copy() @@ -186,7 +186,7 @@ class NetworkMLHDF5Handler(): if len(extraParamIndices)>0: for synType in localSynapseProps: - for paramName in extraParamIndices.keys(): + for paramName in extraParamIndices: if paramName.count(synType)>0: self.log.debug(paramName +"->"+synType) if paramName.count('weight')>0: @@ -206,7 +206,7 @@ class NetworkMLHDF5Handler(): self.log.debug("Connection %d from %f to %f" % (id, preCellId, postCellId)) - for synType in localSynapseProps.keys(): + for synType in localSynapseProps: synProps = localSynapseProps[synType] diff --git a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLSaxHandler.py b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLSaxHandler.py index e73b0b2..1f03327 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLSaxHandler.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/NeuroMLUtils/NetworkMLSaxHandler.py @@ -223,7 +223,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.postFract = 0.5 self.localSynapseProps.clear() - synTypes = self.globalSynapseProps.keys() + synTypes = self.globalSynapseProps for synType in synTypes: self.localSynapseProps[synType] = self.globalSynapseProps[synType].copy() @@ -282,7 +282,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.globalSynapseProps[self.latestSynapseType] = newSynapseProps - for synProp in self.globalSynapseProps.keys(): + for synProp in self.globalSynapseProps: self.log.debug("globalSynapseProp "+synProp+": "+ str(self.globalSynapseProps[synProp])) @@ -310,7 +310,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.globalSynapseProps[self.latestSynapseType] = newSynapseProps - for synProp in self.globalSynapseProps.keys(): + for synProp in self.globalSynapseProps: self.log.debug("globalSynapseProp "+synProp+": "+ str(self.globalSynapseProps[synProp])) @@ -322,7 +322,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): if 'synapse_type' in attrs: synapse_type = attrs.get('synapse_type',"") elif len(self.localSynapseProps) == 1: - synapse_type = self.localSynapseProps.keys()[0] + synapse_type = self.localSynapseProps.popitem()[0] if synapse_type != "": synProps = self.localSynapseProps[synapse_type] @@ -455,7 +455,7 @@ class NetworkMLSaxHandler(xml.sax.ContentHandler): self.log.debug(" Gathered all details of connection: " + self.currentConnId) - for synType in self.localSynapseProps.keys(): + for synType in self.localSynapseProps: synProps = self.localSynapseProps[synType] diff --git a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/PyNNUtils/PyNNUtils.py b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/PyNNUtils/PyNNUtils.py index a9c04c0..424e356 100644 --- a/python/moose/xmls_to_network/twoNeurons/generatedPyNN/PyNNUtils/PyNNUtils.py +++ b/python/moose/xmls_to_network/twoNeurons/generatedPyNN/PyNNUtils/PyNNUtils.py @@ -196,7 +196,7 @@ class NetManagerPyNN(NetworkHandler): self.log.error("Error at handleInputSource! Need a size attribute in sites element to create spike source!") return - if inputProps.keys().count("synaptic_mechanism")>0 and inputProps.keys().count("frequency")>0: + if "synaptic_mechanism" in inputProps and "frequency" in inputProps: freq = float(inputProps["frequency"]) @@ -247,7 +247,7 @@ class NetManagerPyNN(NetworkHandler): exec("from pyNN.%s import *" % self.my_simulator) # Does this really need to be imported every time? - if self.inputCount.keys().count(inputName)==0: + if inputName not in self.inputCount: self.inputCount[inputName] = 0 weight = float(self.inputWeights[inputName]) -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:31
|
--- python/moose/moose.py | 3 - python/moose/moose_py3k.py | 250 --------------------------------------------- 2 files changed, 253 deletions(-) delete mode 100644 python/moose/moose_py3k.py diff --git a/python/moose/moose.py b/python/moose/moose.py index f0c2f1a..955d8e4 100644 --- a/python/moose/moose.py +++ b/python/moose/moose.py @@ -36,9 +36,6 @@ import io import warnings import platform import pydoc -_py3k = False -if int(platform.python_version_tuple()[0]) >= 3: - _py3k = True from collections import defaultdict from . import _moose from ._moose import * diff --git a/python/moose/moose_py3k.py b/python/moose/moose_py3k.py deleted file mode 100644 index 0a8e82d..0000000 --- a/python/moose/moose_py3k.py +++ /dev/null @@ -1,250 +0,0 @@ -# moose.py --- -# -# Filename: moose.py -# Description: -# Author: Subhasis Ray -# Maintainer: -# Copyright (C) 2010 Subhasis Ray, all rights reserved. -# Created: Sat Mar 12 14:02:40 2011 (+0530) -# Version: -# Last-Updated: Fri Aug 24 12:39:23 2012 (+0530) -# By: subha -# Update #: 1885 -# URL: -# Keywords: -# Compatibility: -# -# - -# Commentary: -# -# -# -# - -# Change log: -# -# -# - -# Code: - - -from __future__ import print_function -import warnings -import platform -from collections import defaultdict -from . import _moose -from ._moose import * -import __main__ as main - -sequence_types = [ 'vector<double>', - 'vector<int>', - 'vector<long>', - 'vector<unsigned int>', - 'vector<float>', - 'vector<unsigned long>', - 'vector<short>', - 'vector<Id>', - 'vector<ObjId>' ] -known_types = ['void', - 'char', - 'short', - 'int', - 'unsigned int', - 'double', - 'float', - 'long', - 'unsigned long', - 'string', - 'ematrix', - 'element'] + sequence_types - -###################################################################### -# Special function to generate objects of the right class from -# a given path. -# -# As of 2012-08-22, element() function has been renamed to_el because -# ObjId is now called element in pymoose. This function is not -# entirely deprecated as we do not yet have a way to call the -# destFields as functions from the base class. -###################################################################### - -def to_el(path): - """Return a reference to an existing object as an instance of the - appropriate class. If path does not exist, raises NameError. - - ematrix or element can be provided in stead of path""" - if isinstance(path, ematrix) or isinstance(path, element): - classObj = eval(path.className) - elif isinstance(path, str): - if not _moose.exists(path): - raise NameError('Object %s not defined' % (path)) - oid = _moose.element(path) - classObj = eval(oid.className) - else: - raise TypeError('expected argument: ematrix/element/str') - return classObj(path) - -def arrayelement(path, className='Neutral'): - """Return a reference to an existing object as an instance of the - right class. If path does not exist, className is used for - creating an instance of that class with the given path""" - warnings.warn('use element.ematrix() to retrieve its container. \ -ematrix instances can be used directly for getting \ -tuple of the field values of its elements.', - DeprecationWarning) - if not exists(path): - raise NameError('Object %s not defined' % (path)) - return ematrix(path) - -################################################################ -# Wrappers for global functions -################################################################ - -def pwe(): - """Print present working element. Convenience function for GENESIS - users.""" - print(_moose.getCwe().getPath()) - -def le(el=None): - """List elements. """ - if el is None: - el = getCwe()[0] - elif isinstance(el, str): - if not exists(el): - raise ValueError('no such element') - el = element(el) - elif isinstance(el, ematrix): - el = el[0] - print('Elements under', el.path) - for ch in el.children: - print(ch.path) - -ce = setCwe # ce is a GENESIS shorthand for change element. - -def syncDataHandler(target): - """Synchronize data handlers for target. - - Parameter: - target -- target element or path or ematrix. - """ - raise NotImplementedError('The implementation is not working for IntFire - goes to invalid objects. \ -First fix that issue with SynBase or something in that line.') - if isinstance(target, str): - if not _moose.exists(target): - raise ValueError('%s: element does not exist.' % (target)) - target = ematrix(target) - _moose.syncDataHandler(target) - -def showfield(elem, field='*', showtype=False): - """Show the fields of the element, their data types and values in - human readable format. Convenience function for GENESIS users. - - Parameters: - - element -- Element or path of an existing element. - - field -- Field to be displayed. If '*', all fields are displayed. - - showtype -- If True show the data type of each field. - - """ - if isinstance(elem, str): - if not exists(elem): - raise ValueError('no such element') - elem = element(elem) - if field == '*': - value_field_dict = getFieldDict(elem.className, 'valueFinfo') - max_type_len = max(len(dtype) for dtype in value_field_dict.values()) - max_field_len = max(len(dtype) for dtype in value_field_dict) - print('\n[', elem.path, ']') - for key, dtype in value_field_dict.items(): - if dtype == 'bad' or key == 'this' or key == 'dummy' or key == 'me' or dtype.startswith('vector') or 'ObjId' in dtype: - continue - value = elem.getField(key) - if showtype: - typestr = dtype.ljust(max_type_len + 4) - # The following hack is for handling both Python 2 and - # 3. Directly putting the print command in the if/else - # clause causes syntax error in both systems. - print(typestr, end=" ") - print(key.ljust(max_field_len + 4), '=', value) - else: - try: - print(field, '=', elem.getField(field)) - except AttributeError: - pass # Genesis silently ignores non existent fields - -def showfields(element, showtype=False): - """Convenience function. Should be deprecated if nobody uses it.""" - warnings.warn('Deprecated. Use showfield(element, field="*", showtype=True) instead.', DeprecationWarning) - showfield(element, field='*', showtype=showtype) - -def doc(arg): - """Display the documentation for class or field in a class. - - There is no way to dynamically access the MOOSE docs using - pydoc. (using properties requires copying all the docs strings - from MOOSE increasing the loading time by ~3x). Hence we provide a - separate function. - """ - if isinstance(arg, str): - tokens = arg.split('.') - print_field = len(tokens) > 1 - class_path = '/classes/%s' % (tokens[0]) - if exists(class_path): - if not print_field: - print(Cinfo(class_path).docs) - else: - print('No such class:', tokens[0]) - return - class_id = ematrix('/classes/%s' % (tokens[0])) - num_finfo = getField(class_id[0], 'num_valueFinfo', 'unsigned') - finfo = ematrix('/classes/%s/valueFinfo' % (tokens[0])) - print('\n* Value Field *\n') - for ii in range(num_finfo): - oid = element(finfo, 0, ii, 0) - if print_field: - if oid.name == tokens[1]: - print(oid.name, ':', oid.docs, '\n') - return - else: - print(oid.name, ':', oid.docs, '\n') - num_finfo = getField(class_id[0], 'num_srcFinfo', 'unsigned') - finfo = ematrix('/classes/%s/srcFinfo' % (tokens[0])) - print('\n* Source Field *\n') - for ii in range(num_finfo): - oid = element(finfo, 0, ii, 0) - if print_field: - if oid.name == tokens[1]: - print(oid.name, ':', oid.docs, '\n') - return - else: - print(oid.name, ':', oid.docs, '\n') - num_finfo = getField(class_id[0], 'num_destFinfo', 'unsigned') - finfo = ematrix('/classes/%s/destFinfo' % (tokens[0])) - print('\n* Destination Field *\n') - for ii in range(num_finfo): - oid = element(finfo, 0, ii, 0) - if print_field: - if oid.name == tokens[1]: - print(oid.name, ':', oid.docs, '\n') - return - else: - print(oid.name, ':', oid.docs, '\n') - num_finfo = getField(class_id[0], 'num_lookupFinfo', 'unsigned') - finfo = ematrix('/classes/%s/lookupFinfo' % (tokens[0])) - print('\n* Lookup Field *\n') - for ii in range(num_finfo): - oid = element(finfo, 0, ii, 0) - if print_field: - if oid.name == tokens[1]: - print(oid.name, ':', oid.docs) - return - else: - print(oid.name, ':', oid.docs, '\n') - - -# -# moose.py ends here -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:21
|
python-config returns flags that were used to compile Python itself, and usually included unrelated garbage. Python 2.7 and later includes a .pc file and this is the proper way to retrieve complication flags. --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8c89624..ded4db2 100644 --- a/Makefile +++ b/Makefile @@ -363,16 +363,16 @@ libmoose.so: libs ifneq ($(OSTYPE),win32) ifeq ($(PYTHON),3) PYTHON_VERSION := $(subst ., ,$(lastword $(shell python3 --version 2>&1))) -PYTHON_CFLAGS := $(shell python3-config --cflags) -PYTHON_LDFLAGS := $(shell python3-config --ldflags) +PYTHON_CFLAGS := $(shell pkg-config --cflags python3) +PYTHON_LDFLAGS := $(shell pkg-config --libs python3) else # Python 2.x PYTHON_VERSION := $(subst ., ,$(lastword $(shell python --version 2>&1))) ifneq ($(BUILD),debug) -PYTHON_CFLAGS := $(shell python-config --cflags) -PYTHON_LDFLAGS := $(shell python-config --ldflags) +PYTHON_CFLAGS := $(shell pkg-config --cflags python3) +PYTHON_LDFLAGS := $(shell pkg-config --libs python3) else -PYTHON_CFLAGS := $(shell python-config --includes) -fno-strict-aliasing -fwrapv -Wstrict-prototypes -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -PYTHON_LDFLAGS := -L/usr/lib/$(INSTALLED_PYTHON) -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions +PYTHON_CFLAGS := $(shell pkg-config --includes python) -fno-strict-aliasing -fwrapv -Wstrict-prototypes -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security +PYTHON_LDFLAGS := $(shell pkg-config --libs python) -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions endif # ifneq ($(BUILD),debug) endif # ifeq ($(PYTHON),3) PYTHON_VERSION_MAJOR := $(word 1,${PYTHON_VERSION}) -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:14
|
--- python/moose/neuroml2/generated_neuroml.py | 148 +++++++++---------- python/moose/neuroml2/reader.py | 2 +- python/moose/neuroml2/units.py | 2 +- .../moose/xmls_to_network/core/neuroml2_parser.py | 158 ++++++++++----------- .../moose/xmls_to_network/core/neuroml_to_moose.py | 2 +- python/moose/xmls_to_network/parser/nml_parser.py | 158 ++++++++++----------- 6 files changed, 235 insertions(+), 235 deletions(-) diff --git a/python/moose/neuroml2/generated_neuroml.py b/python/moose/neuroml2/generated_neuroml.py index f03fa42..0ea0243 100644 --- a/python/moose/neuroml2/generated_neuroml.py +++ b/python/moose/neuroml2/generated_neuroml.py @@ -76,7 +76,7 @@ def parsexml_(*args, **kwargs): try: from generatedssuper import GeneratedsSuper -except ImportError, exp: +except ImportError as exp: class GeneratedsSuper(object): tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$') @@ -1265,7 +1265,7 @@ class HHVariable(GeneratedsSuper): already_processed.add('rate') try: self.rate = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (rate): %s' % exp) value = find_attr_value_('scale', node) if value is not None and 'scale' not in already_processed: @@ -1688,7 +1688,7 @@ class PlasticityMechanism(GeneratedsSuper): already_processed.add('initReleaseProb') try: self.initReleaseProb = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (initReleaseProb): %s' % exp) self.validate_ZeroToOne(self.initReleaseProb) # validate type ZeroToOne def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -1779,7 +1779,7 @@ class SegmentParent(GeneratedsSuper): already_processed.add('fractionAlong') try: self.fractionAlong = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (fractionAlong): %s' % exp) self.validate_ZeroToOne(self.fractionAlong) # validate type ZeroToOne value = find_attr_value_('segment', node) @@ -1787,7 +1787,7 @@ class SegmentParent(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -1895,28 +1895,28 @@ class Point3DWithDiam(GeneratedsSuper): already_processed.add('y') try: self.y = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (y): %s' % exp) value = find_attr_value_('x', node) if value is not None and 'x' not in already_processed: already_processed.add('x') try: self.x = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (x): %s' % exp) value = find_attr_value_('z', node) if value is not None and 'z' not in already_processed: already_processed.add('z') try: self.z = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (z): %s' % exp) value = find_attr_value_('diameter', node) if value is not None and 'diameter' not in already_processed: already_processed.add('diameter') try: self.diameter = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (diameter): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -1990,7 +1990,7 @@ class ProximalDetails(GeneratedsSuper): already_processed.add('translationStart') try: self.translationStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (translationStart): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -2064,7 +2064,7 @@ class DistalDetails(GeneratedsSuper): already_processed.add('normalizationEnd') try: self.normalizationEnd = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (normalizationEnd): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -2141,7 +2141,7 @@ class Member(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -2480,7 +2480,7 @@ class SegmentEndPoint(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -3583,42 +3583,42 @@ class SpaceStructure(GeneratedsSuper): already_processed.add('ySpacing') try: self.ySpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (ySpacing): %s' % exp) value = find_attr_value_('zStart', node) if value is not None and 'zStart' not in already_processed: already_processed.add('zStart') try: self.zStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (zStart): %s' % exp) value = find_attr_value_('yStart', node) if value is not None and 'yStart' not in already_processed: already_processed.add('yStart') try: self.yStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (yStart): %s' % exp) value = find_attr_value_('zSpacing', node) if value is not None and 'zSpacing' not in already_processed: already_processed.add('zSpacing') try: self.zSpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (zSpacing): %s' % exp) value = find_attr_value_('xStart', node) if value is not None and 'xStart' not in already_processed: already_processed.add('xStart') try: self.xStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (xStart): %s' % exp) value = find_attr_value_('xSpacing', node) if value is not None and 'xSpacing' not in already_processed: already_processed.add('xSpacing') try: self.xSpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (xSpacing): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -3815,7 +3815,7 @@ class UnstructuredLayout(GeneratedsSuper): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -3909,7 +3909,7 @@ class RandomLayout(GeneratedsSuper): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4005,7 +4005,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('zSize') try: self.zSize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.zSize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4014,7 +4014,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('ySize') try: self.ySize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.ySize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4023,7 +4023,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('xSize') try: self.xSize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.xSize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4142,7 +4142,7 @@ class Instance(GeneratedsSuper): already_processed.add('i') try: self.i = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.i < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4151,7 +4151,7 @@ class Instance(GeneratedsSuper): already_processed.add('k') try: self.k = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.k < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4160,7 +4160,7 @@ class Instance(GeneratedsSuper): already_processed.add('j') try: self.j = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.j < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4169,7 +4169,7 @@ class Instance(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4268,21 +4268,21 @@ class Location(GeneratedsSuper): already_processed.add('y') try: self.y = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (y): %s' % exp) value = find_attr_value_('x', node) if value is not None and 'x' not in already_processed: already_processed.add('x') try: self.x = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (x): %s' % exp) value = find_attr_value_('z', node) if value is not None and 'z' not in already_processed: already_processed.add('z') try: self.z = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (z): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -4483,7 +4483,7 @@ class Connection(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4694,7 +4694,7 @@ class Input(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -5629,7 +5629,7 @@ class Population(Standalone): already_processed.add('size') try: self.size = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) super(Population, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -7716,7 +7716,7 @@ class ChannelPopulation(Base): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -8877,7 +8877,7 @@ class GateHHRatesInf(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9059,7 +9059,7 @@ class GateHHRatesTau(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9229,7 +9229,7 @@ class GateHHTauInf(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9395,7 +9395,7 @@ class GateHHRates(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9585,7 +9585,7 @@ class GateHHUndetermined(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -11104,7 +11104,7 @@ class BasePynnSynapse(BaseSynapse): already_processed.add('tau_syn') try: self.tau_syn = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -11234,35 +11234,35 @@ class basePyNNCell(BaseCell): already_processed.add('tau_syn_I') try: self.tau_syn_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn_I): %s' % exp) value = find_attr_value_('tau_syn_E', node) if value is not None and 'tau_syn_E' not in already_processed: already_processed.add('tau_syn_E') try: self.tau_syn_E = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn_E): %s' % exp) value = find_attr_value_('i_offset', node) if value is not None and 'i_offset' not in already_processed: already_processed.add('i_offset') try: self.i_offset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (i_offset): %s' % exp) value = find_attr_value_('cm', node) if value is not None and 'cm' not in already_processed: already_processed.add('cm') try: self.cm = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (cm): %s' % exp) value = find_attr_value_('v_init', node) if value is not None and 'v_init' not in already_processed: already_processed.add('v_init') try: self.v_init = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_init): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -12485,7 +12485,7 @@ class AlphaCondSynapse(BasePynnSynapse): already_processed.add('e_rev') try: self.e_rev = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev): %s' % exp) super(AlphaCondSynapse, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -12565,7 +12565,7 @@ class ExpCondSynapse(BasePynnSynapse): already_processed.add('e_rev') try: self.e_rev = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev): %s' % exp) super(ExpCondSynapse, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -12725,63 +12725,63 @@ class HH_cond_exp(basePyNNCell): already_processed.add('gbar_K') try: self.gbar_K = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (gbar_K): %s' % exp) value = find_attr_value_('e_rev_E', node) if value is not None and 'e_rev_E' not in already_processed: already_processed.add('e_rev_E') try: self.e_rev_E = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_E): %s' % exp) value = find_attr_value_('g_leak', node) if value is not None and 'g_leak' not in already_processed: already_processed.add('g_leak') try: self.g_leak = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (g_leak): %s' % exp) value = find_attr_value_('e_rev_Na', node) if value is not None and 'e_rev_Na' not in already_processed: already_processed.add('e_rev_Na') try: self.e_rev_Na = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_Na): %s' % exp) value = find_attr_value_('e_rev_I', node) if value is not None and 'e_rev_I' not in already_processed: already_processed.add('e_rev_I') try: self.e_rev_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_I): %s' % exp) value = find_attr_value_('e_rev_K', node) if value is not None and 'e_rev_K' not in already_processed: already_processed.add('e_rev_K') try: self.e_rev_K = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_K): %s' % exp) value = find_attr_value_('e_rev_leak', node) if value is not None and 'e_rev_leak' not in already_processed: already_processed.add('e_rev_leak') try: self.e_rev_leak = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_leak): %s' % exp) value = find_attr_value_('v_offset', node) if value is not None and 'v_offset' not in already_processed: already_processed.add('v_offset') try: self.v_offset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_offset): %s' % exp) value = find_attr_value_('gbar_Na', node) if value is not None and 'gbar_Na' not in already_processed: already_processed.add('gbar_Na') try: self.gbar_Na = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (gbar_Na): %s' % exp) super(HH_cond_exp, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -12907,35 +12907,35 @@ class basePyNNIaFCell(basePyNNCell): already_processed.add('tau_refrac') try: self.tau_refrac = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_refrac): %s' % exp) value = find_attr_value_('v_thresh', node) if value is not None and 'v_thresh' not in already_processed: already_processed.add('v_thresh') try: self.v_thresh = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_thresh): %s' % exp) value = find_attr_value_('tau_m', node) if value is not None and 'tau_m' not in already_processed: already_processed.add('tau_m') try: self.tau_m = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_m): %s' % exp) value = find_attr_value_('v_reset', node) if value is not None and 'v_reset' not in already_processed: already_processed.add('v_reset') try: self.v_reset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_reset): %s' % exp) value = find_attr_value_('v_rest', node) if value is not None and 'v_rest' not in already_processed: already_processed.add('v_rest') try: self.v_rest = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_rest): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -13510,14 +13510,14 @@ class basePyNNIaFCondCell(basePyNNIaFCell): already_processed.add('e_rev_I') try: self.e_rev_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_I): %s' % exp) value = find_attr_value_('e_rev_E', node) if value is not None and 'e_rev_E' not in already_processed: already_processed.add('e_rev_E') try: self.e_rev_E = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_E): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -13738,35 +13738,35 @@ class EIF_cond_alpha_isfa_ista(basePyNNIaFCondCell): already_processed.add('a') try: self.a = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (a): %s' % exp) value = find_attr_value_('delta_T', node) if value is not None and 'delta_T' not in already_processed: already_processed.add('delta_T') try: self.delta_T = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (delta_T): %s' % exp) value = find_attr_value_('b', node) if value is not None and 'b' not in already_processed: already_processed.add('b') try: self.b = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (b): %s' % exp) value = find_attr_value_('v_spike', node) if value is not None and 'v_spike' not in already_processed: already_processed.add('v_spike') try: self.v_spike = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_spike): %s' % exp) value = find_attr_value_('tau_w', node) if value is not None and 'tau_w' not in already_processed: already_processed.add('tau_w') try: self.tau_w = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_w): %s' % exp) super(EIF_cond_alpha_isfa_ista, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -13886,35 +13886,35 @@ class EIF_cond_exp_isfa_ista(basePyNNIaFCondCell): already_processed.add('a') try: self.a = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (a): %s' % exp) value = find_attr_value_('delta_T', node) if value is not None and 'delta_T' not in already_processed: already_processed.add('delta_T') try: self.delta_T = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (delta_T): %s' % exp) value = find_attr_value_('b', node) if value is not None and 'b' not in already_processed: already_processed.add('b') try: self.b = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (b): %s' % exp) value = find_attr_value_('v_spike', node) if value is not None and 'v_spike' not in already_processed: already_processed.add('v_spike') try: self.v_spike = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_spike): %s' % exp) value = find_attr_value_('tau_w', node) if value is not None and 'tau_w' not in already_processed: already_processed.add('tau_w') try: self.tau_w = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_w): %s' % exp) super(EIF_cond_exp_isfa_ista, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): diff --git a/python/moose/neuroml2/reader.py b/python/moose/neuroml2/reader.py index 28d7d5e..ee20af4 100644 --- a/python/moose/neuroml2/reader.py +++ b/python/moose/neuroml2/reader.py @@ -343,7 +343,7 @@ class NML2Reader(object): for path in paths: try: inner.read(path) - except IOError, e: + except IOError as e: error = e else: self.includes[include.href] = inner diff --git a/python/moose/neuroml2/units.py b/python/moose/neuroml2/units.py index cd89edf..2b23342 100644 --- a/python/moose/neuroml2/units.py +++ b/python/moose/neuroml2/units.py @@ -67,7 +67,7 @@ magnitude_regex = re.compile(r'^[\+-]?\d*\.?\d*([eE][\+-]?\d+)?') def SI(expression): try: match = magnitude_regex.match(expression) - except Exception, e: + except Exception as e: print('Error %s with expression: %s' % (e, expression)) raise(e) magnitude = float(match.group(0)) diff --git a/python/moose/xmls_to_network/core/neuroml2_parser.py b/python/moose/xmls_to_network/core/neuroml2_parser.py index 2b880d9..89fa1de 100644 --- a/python/moose/xmls_to_network/core/neuroml2_parser.py +++ b/python/moose/xmls_to_network/core/neuroml2_parser.py @@ -76,7 +76,7 @@ def parsexml_(*args, **kwargs): try: from generatedssuper import GeneratedsSuper -except ImportError, exp: +except ImportError as exp: class GeneratedsSuper(object): tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$') @@ -1266,7 +1266,7 @@ class HHVariable(GeneratedsSuper): already_processed.add('rate') try: self.rate = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (rate): %s' % exp) value = find_attr_value_('scale', node) if value is not None and 'scale' not in already_processed: @@ -1689,7 +1689,7 @@ class PlasticityMechanism(GeneratedsSuper): already_processed.add('initReleaseProb') try: self.initReleaseProb = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (initReleaseProb): %s' % exp) self.validate_ZeroToOne(self.initReleaseProb) # validate type ZeroToOne def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -1780,7 +1780,7 @@ class SegmentParent(GeneratedsSuper): already_processed.add('fractionAlong') try: self.fractionAlong = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (fractionAlong): %s' % exp) self.validate_ZeroToOne(self.fractionAlong) # validate type ZeroToOne value = find_attr_value_('segment', node) @@ -1788,7 +1788,7 @@ class SegmentParent(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -1896,28 +1896,28 @@ class Point3DWithDiam(GeneratedsSuper): already_processed.add('y') try: self.y = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (y): %s' % exp) value = find_attr_value_('x', node) if value is not None and 'x' not in already_processed: already_processed.add('x') try: self.x = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (x): %s' % exp) value = find_attr_value_('z', node) if value is not None and 'z' not in already_processed: already_processed.add('z') try: self.z = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (z): %s' % exp) value = find_attr_value_('diameter', node) if value is not None and 'diameter' not in already_processed: already_processed.add('diameter') try: self.diameter = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (diameter): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -1991,7 +1991,7 @@ class ProximalDetails(GeneratedsSuper): already_processed.add('translationStart') try: self.translationStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (translationStart): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -2065,7 +2065,7 @@ class DistalDetails(GeneratedsSuper): already_processed.add('normalizationEnd') try: self.normalizationEnd = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (normalizationEnd): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -2142,7 +2142,7 @@ class Member(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -2481,7 +2481,7 @@ class SegmentEndPoint(GeneratedsSuper): already_processed.add('segment') try: self.segment = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.segment < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -3596,42 +3596,42 @@ class SpaceStructure(GeneratedsSuper): already_processed.add('ySpacing') try: self.ySpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (ySpacing): %s' % exp) value = find_attr_value_('zStart', node) if value is not None and 'zStart' not in already_processed: already_processed.add('zStart') try: self.zStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (zStart): %s' % exp) value = find_attr_value_('yStart', node) if value is not None and 'yStart' not in already_processed: already_processed.add('yStart') try: self.yStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (yStart): %s' % exp) value = find_attr_value_('zSpacing', node) if value is not None and 'zSpacing' not in already_processed: already_processed.add('zSpacing') try: self.zSpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (zSpacing): %s' % exp) value = find_attr_value_('xStart', node) if value is not None and 'xStart' not in already_processed: already_processed.add('xStart') try: self.xStart = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (xStart): %s' % exp) value = find_attr_value_('xSpacing', node) if value is not None and 'xSpacing' not in already_processed: already_processed.add('xSpacing') try: self.xSpacing = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (xSpacing): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -3828,7 +3828,7 @@ class UnstructuredLayout(GeneratedsSuper): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -3922,7 +3922,7 @@ class RandomLayout(GeneratedsSuper): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4018,7 +4018,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('zSize') try: self.zSize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.zSize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4027,7 +4027,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('ySize') try: self.ySize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.ySize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4036,7 +4036,7 @@ class GridLayout(GeneratedsSuper): already_processed.add('xSize') try: self.xSize = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.xSize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4155,7 +4155,7 @@ class Instance(GeneratedsSuper): already_processed.add('i') try: self.i = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.i < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4164,7 +4164,7 @@ class Instance(GeneratedsSuper): already_processed.add('k') try: self.k = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.k < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4173,7 +4173,7 @@ class Instance(GeneratedsSuper): already_processed.add('j') try: self.j = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.j < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4182,7 +4182,7 @@ class Instance(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4281,21 +4281,21 @@ class Location(GeneratedsSuper): already_processed.add('y') try: self.y = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (y): %s' % exp) value = find_attr_value_('x', node) if value is not None and 'x' not in already_processed: already_processed.add('x') try: self.x = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (x): %s' % exp) value = find_attr_value_('z', node) if value is not None and 'z' not in already_processed: already_processed.add('z') try: self.z = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (z): %s' % exp) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass @@ -4538,7 +4538,7 @@ class Connection(GeneratedsSuper): already_processed.add('preFractionAlong') try: self.preFractionAlong = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (preFractionAlong): %s' % exp) self.validate_ZeroToOne(self.preFractionAlong) # validate type ZeroToOne value = find_attr_value_('preCellId', node) @@ -4550,7 +4550,7 @@ class Connection(GeneratedsSuper): already_processed.add('postFractionAlong') try: self.postFractionAlong = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (postFractionAlong): %s' % exp) self.validate_ZeroToOne(self.postFractionAlong) # validate type ZeroToOne value = find_attr_value_('postSegmentId', node) @@ -4558,7 +4558,7 @@ class Connection(GeneratedsSuper): already_processed.add('postSegmentId') try: self.postSegmentId = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.postSegmentId < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4572,7 +4572,7 @@ class Connection(GeneratedsSuper): already_processed.add('preSegmentId') try: self.preSegmentId = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.preSegmentId < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4582,7 +4582,7 @@ class Connection(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -4789,7 +4789,7 @@ class Input(GeneratedsSuper): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -5787,7 +5787,7 @@ class Population(Standalone): already_processed.add('size') try: self.size = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) super(Population, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -8043,7 +8043,7 @@ class ChannelPopulation(Base): already_processed.add('number') try: self.number = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.number < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -8639,7 +8639,7 @@ class Segment(BaseWithoutId): already_processed.add('id') try: self.id = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') @@ -9227,7 +9227,7 @@ class GateHHRatesInf(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9412,7 +9412,7 @@ class GateHHRatesTau(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9582,7 +9582,7 @@ class GateHHTauInf(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9748,7 +9748,7 @@ class GateHHRates(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -9938,7 +9938,7 @@ class GateHHUndetermined(Base): already_processed.add('instances') try: self.instances = int(value) - except ValueError, exp: + except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: @@ -11457,7 +11457,7 @@ class BasePynnSynapse(BaseSynapse): already_processed.add('tau_syn') try: self.tau_syn = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -11587,35 +11587,35 @@ class basePyNNCell(BaseCell): already_processed.add('tau_syn_I') try: self.tau_syn_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn_I): %s' % exp) value = find_attr_value_('tau_syn_E', node) if value is not None and 'tau_syn_E' not in already_processed: already_processed.add('tau_syn_E') try: self.tau_syn_E = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_syn_E): %s' % exp) value = find_attr_value_('i_offset', node) if value is not None and 'i_offset' not in already_processed: already_processed.add('i_offset') try: self.i_offset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (i_offset): %s' % exp) value = find_attr_value_('cm', node) if value is not None and 'cm' not in already_processed: already_processed.add('cm') try: self.cm = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (cm): %s' % exp) value = find_attr_value_('v_init', node) if value is not None and 'v_init' not in already_processed: already_processed.add('v_init') try: self.v_init = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_init): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -12838,7 +12838,7 @@ class AlphaCondSynapse(BasePynnSynapse): already_processed.add('e_rev') try: self.e_rev = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev): %s' % exp) super(AlphaCondSynapse, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -12918,7 +12918,7 @@ class ExpCondSynapse(BasePynnSynapse): already_processed.add('e_rev') try: self.e_rev = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev): %s' % exp) super(ExpCondSynapse, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -13078,63 +13078,63 @@ class HH_cond_exp(basePyNNCell): already_processed.add('gbar_K') try: self.gbar_K = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (gbar_K): %s' % exp) value = find_attr_value_('e_rev_E', node) if value is not None and 'e_rev_E' not in already_processed: already_processed.add('e_rev_E') try: self.e_rev_E = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_E): %s' % exp) value = find_attr_value_('g_leak', node) if value is not None and 'g_leak' not in already_processed: already_processed.add('g_leak') try: self.g_leak = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (g_leak): %s' % exp) value = find_attr_value_('e_rev_Na', node) if value is not None and 'e_rev_Na' not in already_processed: already_processed.add('e_rev_Na') try: self.e_rev_Na = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_Na): %s' % exp) value = find_attr_value_('e_rev_I', node) if value is not None and 'e_rev_I' not in already_processed: already_processed.add('e_rev_I') try: self.e_rev_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_I): %s' % exp) value = find_attr_value_('e_rev_K', node) if value is not None and 'e_rev_K' not in already_processed: already_processed.add('e_rev_K') try: self.e_rev_K = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_K): %s' % exp) value = find_attr_value_('e_rev_leak', node) if value is not None and 'e_rev_leak' not in already_processed: already_processed.add('e_rev_leak') try: self.e_rev_leak = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_leak): %s' % exp) value = find_attr_value_('v_offset', node) if value is not None and 'v_offset' not in already_processed: already_processed.add('v_offset') try: self.v_offset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_offset): %s' % exp) value = find_attr_value_('gbar_Na', node) if value is not None and 'gbar_Na' not in already_processed: already_processed.add('gbar_Na') try: self.gbar_Na = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (gbar_Na): %s' % exp) super(HH_cond_exp, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): @@ -13260,35 +13260,35 @@ class basePyNNIaFCell(basePyNNCell): already_processed.add('tau_refrac') try: self.tau_refrac = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_refrac): %s' % exp) value = find_attr_value_('v_thresh', node) if value is not None and 'v_thresh' not in already_processed: already_processed.add('v_thresh') try: self.v_thresh = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_thresh): %s' % exp) value = find_attr_value_('tau_m', node) if value is not None and 'tau_m' not in already_processed: already_processed.add('tau_m') try: self.tau_m = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (tau_m): %s' % exp) value = find_attr_value_('v_reset', node) if value is not None and 'v_reset' not in already_processed: already_processed.add('v_reset') try: self.v_reset = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_reset): %s' % exp) value = find_attr_value_('v_rest', node) if value is not None and 'v_rest' not in already_processed: already_processed.add('v_rest') try: self.v_rest = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (v_rest): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: @@ -13863,14 +13863,14 @@ class basePyNNIaFCondCell(basePyNNIaFCell): already_processed.add('e_rev_I') try: self.e_rev_I = float(value) - except ValueError, exp: + except ValueError as exp: raise ValueError('Bad float/double attribute (e_rev_I): %s' % exp) value = find_attr_value_('e_rev_E', node) if value is not None and 'e_rev_E' not in already_processed: already_processed.add('e_rev_E') try: self.e_rev_E = float(value) - e... [truncated message content] |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:02
|
This helps git users, and is harmless otherwise. --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c45bbd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*~ +*.o +*.a +*.so +moose +/TAGS +__pycache__/ -- 1.8.5.3 |
From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:09:55
|
--- python/moose/neuroml2/reader.py | 8 ++++---- python/moose/recording.py | 1 + python/moose/xmls_to_network/core/neuroml_to_moose.py | 10 ++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/python/moose/neuroml2/reader.py b/python/moose/neuroml2/reader.py index ee20af4..7d51790 100644 --- a/python/moose/neuroml2/reader.py +++ b/python/moose/neuroml2/reader.py @@ -53,8 +53,8 @@ prototype includes. """ from __future__ import print_function +from future_builtins import zip, map import sys, os -from itertools import izip from urllib2 import urlopen import numpy as np import moose @@ -213,9 +213,9 @@ class NML2Reader(object): p0 = parent.distal else: raise Exception('No proximal point and no parent segment for segment: name=%s, id=%s' % (segment.name, segment.id)) - comp.x0, comp.y0, comp.z0 = map(lambda x: x * self.lunit, map(float, (p0.x, p0.y, p0.z))) + comp.x0, comp.y0, comp.z0 = (x * self.lunit for x in map(float, (p0.x, p0.y, p0.z))) p1 = segment.distal - comp.x, comp.y, comp.z = map(lambda x: x * self.lunit, map(float, (p1.x, p1.y, p1.z))) + comp.x, comp.y, comp.z = (x * self.lunit for x in map(float, (p1.x, p1.y, p1.z))) comp.length = np.linalg.norm((comp.x - comp.x0, comp.y - comp.y0, comp.z - comp.z0)) @@ -363,7 +363,7 @@ class NML2Reader(object): mchan = moose.HHChannel('%s/%s' % (self.lib.path, chan.id)) mgates = map(moose.element, (mchan.gateX, mchan.gateY, mchan.gateZ)) assert(len(chan.gate) <= 3) # We handle only up to 3 gates in HHCHannel - for ngate, mgate in izip(chan.gate, mgates): + for ngate, mgate in zip(chan.gate, mgates): if mgate.name.endswith('X'): mchan.Xpower = ngate.instances elif mgate.name.endswith('Y'): diff --git a/python/moose/recording.py b/python/moose/recording.py index 312d1d9..066d2e5 100644 --- a/python/moose/recording.py +++ b/python/moose/recording.py @@ -1,4 +1,5 @@ from __future__ import print_function +from future_builtins import zip import moose as _moose _tick = 8 diff --git a/python/moose/xmls_to_network/core/neuroml_to_moose.py b/python/moose/xmls_to_network/core/neuroml_to_moose.py index 663b255..1ee74ad 100644 --- a/python/moose/xmls_to_network/core/neuroml_to_moose.py +++ b/python/moose/xmls_to_network/core/neuroml_to_moose.py @@ -53,8 +53,8 @@ prototype includes. """ from __future__ import print_function +from future_builtins import zip, map import sys, os -from itertools import izip from urllib2 import urlopen import numpy as np import neuroml2_parser as nml @@ -206,11 +206,9 @@ class NML2Reader(object): else: raise Exception('No proximal point and no parent segment \ for segment: name=%s, id=%s' % (segment.name, segment.id)) - comp.x0, comp.y0, comp.z0 = map(lambda x: x * self.lunit - , map(float, (p0.x, p0.y, p0.z))) + comp.x0, comp.y0, comp.z0 = [x * self.lunit for x in map(float, (p0.x, p0.y, p0.z))] p1 = segment.distal - comp.x, comp.y, comp.z = map(lambda x: x * self.lunit - , map(float, (p1.x, p1.y, p1.z))) + comp.x, comp.y, comp.z = [x * self.lunit for x in map(float, (p1.x, p1.y, p1.z))] comp.length = np.sqrt((comp.x - comp.x0)**2 + (comp.y - comp.y0)**2 + (comp.z - comp.z0)**2) @@ -370,7 +368,7 @@ class NML2Reader(object): mchan = moose.HHChannel('%s/%s' % (self.lib.path, chan.id)) mgates = map(moose.element, (mchan.gateX, mchan.gateY, mchan.gateZ)) assert(len(chan.gate) <= 3) # We handle only up to 3 gates in HHCHannel - for ngate, mgate in izip(chan.gate, mgates): + for ngate, mgate in zip(chan.gate, mgates): if mgate.name.endswith('X'): mchan.Xpower = ngate.instances elif mgate.name.endswith('Y'): -- 1.8.5.3 |
From: Dilawar S. <dil...@nc...> - 2014-03-31 04:11:23
|
Looks cool. On Mon, Mar 31, 2014 at 05:58:57AM +0200, Viktor Tóth wrote: >Hi everyone! > >I have initiated a blog which will contain the details of my contribution >to the MOOSE project as well as my observations on it. I also plan to write >posts about other topics I am interested in within the boundary of >Neuroinformatics. >The first post describes the explicit and implicit numerical methods. >Furthermore, it has some rules of thumb: which method when should be used. >If you notice any semantic inaccuracy, please tell me about it; the >understanding of this topic is essential for my future contribution. > >Link to the blog: http://neuroinf.blogspot.hu/ >In the next posts I'm going to write about the progress of NNGPU (trainable >CUDA powered neural network) and the Hines' solver. > >Thanks! > >Viktor >------------------------------------------------------------------------------ >_______________________________________________ >moose-devel mailing list >moo...@li... >https://lists.sourceforge.net/lists/listinfo/moose-devel |
From: Viktor T. <ben...@gm...> - 2014-03-31 03:59:03
|
Hi everyone! I have initiated a blog which will contain the details of my contribution to the MOOSE project as well as my observations on it. I also plan to write posts about other topics I am interested in within the boundary of Neuroinformatics. The first post describes the explicit and implicit numerical methods. Furthermore, it has some rules of thumb: which method when should be used. If you notice any semantic inaccuracy, please tell me about it; the understanding of this topic is essential for my future contribution. Link to the blog: http://neuroinf.blogspot.hu/ In the next posts I'm going to write about the progress of NNGPU (trainable CUDA powered neural network) and the Hines' solver. Thanks! Viktor |
From: vivek s. <viv...@gm...> - 2014-03-25 08:48:54
|
Hey everyone, I am writing a blog on the work that I am doing on MOOSE. Currently, it has only basic documentation and explanation of the MOOSE API, specifically on how to build a new class in MOOSE. I plan to continually update it with all the work that I will be doing as and when I finish. Do check it out if you have the time. My understanding of the different components may not be entirely clear and it would be great if you could let me know of any errors I have made. The blog link: http://vivekvidyasagaran.weebly.com/moose.html Subhasis: I am working on understanding the Hines' Solver now. As always, I will be more than happy to complete any assignments that you may have in mind. Please let me know. Thanks Vivek |
From: vivek s. <viv...@gm...> - 2014-03-21 04:59:58
|
Hey everyone, There is only about 12 hours left for the GSoC proposal submission deadline. Just wanted to make sure that all the required information is present in my proposal. If you could quickly check and let me know, that would be great. Thanks Vivek |
From: U.S.Bhalla <bh...@nc...> - 2014-03-20 10:23:05
|
Dear Viktor, Let us start with CUDA. It is more mature and we have some preliminary work with it already. Best, Upi On Thursday 20 March 2014 02:00 PM, Viktor Tóth wrote: > Hi everyone! > > I just have a question whether OpenCL is relevant for GPGPU parallelization > in Moose? I'm not sure if one summer would be enough for both OpenCL and > Cuda implementation, but if OpenCL has priority over Cuda, I may come to > terms with OpenCL too. > > Viktor > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel |
From: Viktor T. <ben...@gm...> - 2014-03-20 08:30:48
|
Hi everyone! I just have a question whether OpenCL is relevant for GPGPU parallelization in Moose? I'm not sure if one summer would be enough for both OpenCL and Cuda implementation, but if OpenCL has priority over Cuda, I may come to terms with OpenCL too. Viktor |
From: Subhasis R. <ray...@gm...> - 2014-03-19 06:09:16
|
When you update melange we get a mail on incf mailing list. So do not worry. Best, - Subhasis ( ʃʊbʱaːʃɪʃ ) On Wed, Mar 19, 2014 at 9:56 AM, vivek sagar <viv...@gm...>wrote: > Hey all, > > I have updated my google melange page with all the required details here: > > https://www.google-melange.com/gsoc/proposal/review/student/google/gsoc2014/sharkash/5668600916475904 > > I will be glad to consider any feedback that you may have. > > Subha: There seems to be something wrong with the INCF mailing list. I will > post this there as soon as it is working. > > Thanks > > Vivek > > > On Fri, Mar 14, 2014 at 12:39 PM, vivek sagar <viv...@gm... > >wrote: > > > Hello, > > > > I have a github account ( > https://github.com/Vivek-sagar?tab=repositories) , > > which has some of the projects I have worked on. > > > > - Balanar's Adventures( > > https://github.com/Vivek-sagar/Balanars-Adventures) is a game that I > > created entirely by myself. It is a 2-D sidescroller game made with > Python > > and the Pygame graphics library. This will provide a fair idea of my > coding > > style, considering that all the code here is mine. > > - I implemented an SLR parser ( > > https://github.com/Vivek-sagar/SLR-Parser) using OpenMP. It exhibits > > my understanding of the parallel programming paradigm. > > - I have been working with a climate model called WRF (Weather > > Research and Forecasting) - developing a GUI installer, and a > framework > > that employs this to provide Cyclone alerts. Unfortunately, this code > isn't > > in the public domain. You can read up about it on my website ( > > http://vivekvidyasagaran.weebly.com/wrfinstall.html). > > > > I have worked on a large number of other projects too. My website ( > > vivekvidyasagaran.weebly.com) showcases many of my projects. This does > > not have much of code in itself, but does provide a good idea of the type > > of work that I have been involved in. I will be glad to provide code for > > any of the projects if you require. Please do check it out if you have > the > > time. > > > > My Github account also has a few other pieces of code that I have > > developed. > > > > Thanks > > > > Vivek > > > > > > On Fri, Mar 14, 2014 at 9:54 AM, Subhasis Ray <ray...@gm... > >wrote: > > > >> Dear Vivek, > >> Can you please give us some pointers to your previous work (assuming > >> they > >> are publicly hosted)? > >> > >> Best, > >> - Subhasis > >> ( ʃʊbʱaːʃɪʃ ) > >> > >> > >> On Fri, Mar 14, 2014 at 9:31 AM, vivek sagar <viv...@gm... > >> >wrote: > >> > >> > Hello all, > >> > > >> > > >> > > >> > I am working towards participating in GSoC 2014 on the project > >> > "*Optimization > >> > of parallel computation in MOOSE*". I have been corresponding with Mr. > >> > Subhasis Ray for a few weeks now, and have got a basic idea of how to > >> > create new classes in MOOSE. > >> > > >> > I am working on a proposal for the GSoC application, a major part of > >> which > >> > is the schedule with proposed milestones. This is what I have come up > >> with > >> > so far: > >> > > >> > > >> > - · May 19 - May 26: *Reading up Literature* - Praveen (the > >> student > >> > who worked on GPU implementation last year) suggested I read up > *The > >> > book of GENESIS* to get a good idea of how Neural Network > Simulators > >> are > >> > built. Considering I have no prior knowledge in this field, I think > >> that > >> > this, along with other literature on such simulators, will help me > >> > understand the concepts I will need. I have already begun reading > it, > >> > and > >> > it has already provided a lot of perspective on what I will be > >> working > >> > on. > >> > I will be getting started on this well before the beginning of the > >> > coding > >> > period (May 19). > >> > - · May 27 - June 4:* Vacation* - I plan to do a long distance > >> > cycling trip over 10 days during this time. Still figuring out the > >> > logistics. Most probably from Bangalore to Goa! J > >> > - · June 5 - June 11: *Brushing up parallel programming > >> concepts* - > >> > With a decent idea of the sort of problems Neural Network > Simulators > >> > try to > >> > solve, I think now would be a good time to look up all the concepts > >> of > >> > parallel programming that I will need to implement > parallelization. I > >> > have > >> > done some work in parallel programming before using OpenMP and > CUDA, > >> but > >> > brushing up my concepts with a clear requirement in mind will > >> definitely > >> > help ease writing code as I move forward. > >> > - · June 12 - June 20 : *Praveen's Implementation* - I think > >> > Praveen's implementation of the Hines' Solver will be a good place > to > >> > start > >> > familiarizing myself with the code. He has provided a general > >> overview > >> > of > >> > the work he did, and his code itself. Hopefully, those resources > >> (along > >> > with some help from the mentors) will be enough to understand the > >> > implementation. I understand that this code hasn't been committed > to > >> the > >> > main repository yet, and would love to be able to polish it and > >> commit > >> > (Although this is most certainly an extended goal). > >> > - · June 21 - June 30 : *Implementing Hsolve* - By the halfway > >> > point of the program, I hope to have completed implementation of > the > >> > Hines' > >> > Solver. I don't know exactly what this will entail. Praveen > mentions > >> > buffering neuron spikes. From what I understood reading the > >> sourceforge > >> > wiki, this involves only "Cable Equations and biophysical > >> > calculations". Do > >> > correct me if I am wrong. > >> > - · July 1 - July 31 : *Implementating another component* - > >> After > >> > this point, my understanding of what needs to be done and what can > be > >> > done > >> > is very sketchy. I would like to parallelize at least one more > >> > component of > >> > the system, but am not sure exactly what that will be. The wiki > >> mentions > >> > "Single neuron branched reaction-diffusion calculations" and "3D > >> > reaction > >> > diffusion calculations", so maybe one of those. Another possibility > >> is > >> > parallelization of a different solver. I will need some help > figuring > >> > this > >> > out. Also, please note that I will be out for a week or so at some > >> point > >> > during the month. > >> > - · August 1 - August 18 : *Cleaning up* - I thought that I > >> should > >> > allow for some time to polish up my code, make it readable, and > make > >> > sure > >> > all documentation is up to date. This will ensure that the code is > >> clean > >> > before I commit it to the main repo. This time will also act as a > >> buffer > >> > period in case there is some bit of implementation remaining. > >> > > >> > There are a few rough edges in this schedule, so I was wondering if I > >> could > >> > get feedback on it and some help with filling in the holes. > >> > > >> > > >> > > >> > Thanks > >> > > >> > > >> > > >> > Vivek > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Learn Graph Databases - Download FREE O'Reilly Book > >> > "Graph Databases" is the definitive new guide to graph databases and > >> their > >> > applications. Written by three acclaimed leaders in the field, > >> > this first edition is now available. Download your free book today! > >> > http://p.sf.net/sfu/13534_NeoTech > >> > _______________________________________________ > >> > moose-devel mailing list > >> > moo...@li... > >> > https://lists.sourceforge.net/lists/listinfo/moose-devel > >> > > >> > >> > ------------------------------------------------------------------------------ > >> Learn Graph Databases - Download FREE O'Reilly Book > >> "Graph Databases" is the definitive new guide to graph databases and > their > >> applications. Written by three acclaimed leaders in the field, > >> this first edition is now available. Download your free book today! > >> http://p.sf.net/sfu/13534_NeoTech > >> _______________________________________________ > >> moose-devel mailing list > >> moo...@li... > >> https://lists.sourceforge.net/lists/listinfo/moose-devel > >> > > > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel > |
From: vivek s. <viv...@gm...> - 2014-03-19 04:26:46
|
Hey all, I have updated my google melange page with all the required details here: https://www.google-melange.com/gsoc/proposal/review/student/google/gsoc2014/sharkash/5668600916475904 I will be glad to consider any feedback that you may have. Subha: There seems to be something wrong with the INCF mailing list. I will post this there as soon as it is working. Thanks Vivek On Fri, Mar 14, 2014 at 12:39 PM, vivek sagar <viv...@gm...>wrote: > Hello, > > I have a github account (https://github.com/Vivek-sagar?tab=repositories) , > which has some of the projects I have worked on. > > - Balanar's Adventures( > https://github.com/Vivek-sagar/Balanars-Adventures) is a game that I > created entirely by myself. It is a 2-D sidescroller game made with Python > and the Pygame graphics library. This will provide a fair idea of my coding > style, considering that all the code here is mine. > - I implemented an SLR parser ( > https://github.com/Vivek-sagar/SLR-Parser) using OpenMP. It exhibits > my understanding of the parallel programming paradigm. > - I have been working with a climate model called WRF (Weather > Research and Forecasting) - developing a GUI installer, and a framework > that employs this to provide Cyclone alerts. Unfortunately, this code isn't > in the public domain. You can read up about it on my website ( > http://vivekvidyasagaran.weebly.com/wrfinstall.html). > > I have worked on a large number of other projects too. My website ( > vivekvidyasagaran.weebly.com) showcases many of my projects. This does > not have much of code in itself, but does provide a good idea of the type > of work that I have been involved in. I will be glad to provide code for > any of the projects if you require. Please do check it out if you have the > time. > > My Github account also has a few other pieces of code that I have > developed. > > Thanks > > Vivek > > > On Fri, Mar 14, 2014 at 9:54 AM, Subhasis Ray <ray...@gm...>wrote: > >> Dear Vivek, >> Can you please give us some pointers to your previous work (assuming >> they >> are publicly hosted)? >> >> Best, >> - Subhasis >> ( ʃʊbʱaːʃɪʃ ) >> >> >> On Fri, Mar 14, 2014 at 9:31 AM, vivek sagar <viv...@gm... >> >wrote: >> >> > Hello all, >> > >> > >> > >> > I am working towards participating in GSoC 2014 on the project >> > "*Optimization >> > of parallel computation in MOOSE*". I have been corresponding with Mr. >> > Subhasis Ray for a few weeks now, and have got a basic idea of how to >> > create new classes in MOOSE. >> > >> > I am working on a proposal for the GSoC application, a major part of >> which >> > is the schedule with proposed milestones. This is what I have come up >> with >> > so far: >> > >> > >> > - · May 19 - May 26: *Reading up Literature* - Praveen (the >> student >> > who worked on GPU implementation last year) suggested I read up *The >> > book of GENESIS* to get a good idea of how Neural Network Simulators >> are >> > built. Considering I have no prior knowledge in this field, I think >> that >> > this, along with other literature on such simulators, will help me >> > understand the concepts I will need. I have already begun reading it, >> > and >> > it has already provided a lot of perspective on what I will be >> working >> > on. >> > I will be getting started on this well before the beginning of the >> > coding >> > period (May 19). >> > - · May 27 - June 4:* Vacation* - I plan to do a long distance >> > cycling trip over 10 days during this time. Still figuring out the >> > logistics. Most probably from Bangalore to Goa! J >> > - · June 5 - June 11: *Brushing up parallel programming >> concepts* - >> > With a decent idea of the sort of problems Neural Network Simulators >> > try to >> > solve, I think now would be a good time to look up all the concepts >> of >> > parallel programming that I will need to implement parallelization. I >> > have >> > done some work in parallel programming before using OpenMP and CUDA, >> but >> > brushing up my concepts with a clear requirement in mind will >> definitely >> > help ease writing code as I move forward. >> > - · June 12 - June 20 : *Praveen's Implementation* - I think >> > Praveen's implementation of the Hines' Solver will be a good place to >> > start >> > familiarizing myself with the code. He has provided a general >> overview >> > of >> > the work he did, and his code itself. Hopefully, those resources >> (along >> > with some help from the mentors) will be enough to understand the >> > implementation. I understand that this code hasn't been committed to >> the >> > main repository yet, and would love to be able to polish it and >> commit >> > (Although this is most certainly an extended goal). >> > - · June 21 - June 30 : *Implementing Hsolve* - By the halfway >> > point of the program, I hope to have completed implementation of the >> > Hines' >> > Solver. I don't know exactly what this will entail. Praveen mentions >> > buffering neuron spikes. From what I understood reading the >> sourceforge >> > wiki, this involves only "Cable Equations and biophysical >> > calculations". Do >> > correct me if I am wrong. >> > - · July 1 - July 31 : *Implementating another component* - >> After >> > this point, my understanding of what needs to be done and what can be >> > done >> > is very sketchy. I would like to parallelize at least one more >> > component of >> > the system, but am not sure exactly what that will be. The wiki >> mentions >> > "Single neuron branched reaction-diffusion calculations" and "3D >> > reaction >> > diffusion calculations", so maybe one of those. Another possibility >> is >> > parallelization of a different solver. I will need some help figuring >> > this >> > out. Also, please note that I will be out for a week or so at some >> point >> > during the month. >> > - · August 1 - August 18 : *Cleaning up* - I thought that I >> should >> > allow for some time to polish up my code, make it readable, and make >> > sure >> > all documentation is up to date. This will ensure that the code is >> clean >> > before I commit it to the main repo. This time will also act as a >> buffer >> > period in case there is some bit of implementation remaining. >> > >> > There are a few rough edges in this schedule, so I was wondering if I >> could >> > get feedback on it and some help with filling in the holes. >> > >> > >> > >> > Thanks >> > >> > >> > >> > Vivek >> > >> > >> ------------------------------------------------------------------------------ >> > Learn Graph Databases - Download FREE O'Reilly Book >> > "Graph Databases" is the definitive new guide to graph databases and >> their >> > applications. Written by three acclaimed leaders in the field, >> > this first edition is now available. Download your free book today! >> > http://p.sf.net/sfu/13534_NeoTech >> > _______________________________________________ >> > moose-devel mailing list >> > moo...@li... >> > https://lists.sourceforge.net/lists/listinfo/moose-devel >> > >> >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> http://p.sf.net/sfu/13534_NeoTech >> _______________________________________________ >> moose-devel mailing list >> moo...@li... >> https://lists.sourceforge.net/lists/listinfo/moose-devel >> > > |
From: vivek s. <viv...@gm...> - 2014-03-14 07:10:26
|
Hello, I have a github account (https://github.com/Vivek-sagar?tab=repositories) , which has some of the projects I have worked on. - Balanar's Adventures(https://github.com/Vivek-sagar/Balanars-Adventures) is a game that I created entirely by myself. It is a 2-D sidescroller game made with Python and the Pygame graphics library. This will provide a fair idea of my coding style, considering that all the code here is mine. - I implemented an SLR parser (https://github.com/Vivek-sagar/SLR-Parser) using OpenMP. It exhibits my understanding of the parallel programming paradigm. - I have been working with a climate model called WRF (Weather Research and Forecasting) - developing a GUI installer, and a framework that employs this to provide Cyclone alerts. Unfortunately, this code isn't in the public domain. You can read up about it on my website ( http://vivekvidyasagaran.weebly.com/wrfinstall.html). I have worked on a large number of other projects too. My website ( vivekvidyasagaran.weebly.com) showcases many of my projects. This does not have much of code in itself, but does provide a good idea of the type of work that I have been involved in. I will be glad to provide code for any of the projects if you require. Please do check it out if you have the time. My Github account also has a few other pieces of code that I have developed. Thanks Vivek On Fri, Mar 14, 2014 at 9:54 AM, Subhasis Ray <ray...@gm...>wrote: > Dear Vivek, > Can you please give us some pointers to your previous work (assuming they > are publicly hosted)? > > Best, > - Subhasis > ( ʃʊbʱaːʃɪʃ ) > > > On Fri, Mar 14, 2014 at 9:31 AM, vivek sagar <viv...@gm... > >wrote: > > > Hello all, > > > > > > > > I am working towards participating in GSoC 2014 on the project > > "*Optimization > > of parallel computation in MOOSE*". I have been corresponding with Mr. > > Subhasis Ray for a few weeks now, and have got a basic idea of how to > > create new classes in MOOSE. > > > > I am working on a proposal for the GSoC application, a major part of > which > > is the schedule with proposed milestones. This is what I have come up > with > > so far: > > > > > > - · May 19 - May 26: *Reading up Literature* - Praveen (the > student > > who worked on GPU implementation last year) suggested I read up *The > > book of GENESIS* to get a good idea of how Neural Network Simulators > are > > built. Considering I have no prior knowledge in this field, I think > that > > this, along with other literature on such simulators, will help me > > understand the concepts I will need. I have already begun reading it, > > and > > it has already provided a lot of perspective on what I will be working > > on. > > I will be getting started on this well before the beginning of the > > coding > > period (May 19). > > - · May 27 - June 4:* Vacation* - I plan to do a long distance > > cycling trip over 10 days during this time. Still figuring out the > > logistics. Most probably from Bangalore to Goa! J > > - · June 5 - June 11: *Brushing up parallel programming > concepts* - > > With a decent idea of the sort of problems Neural Network Simulators > > try to > > solve, I think now would be a good time to look up all the concepts of > > parallel programming that I will need to implement parallelization. I > > have > > done some work in parallel programming before using OpenMP and CUDA, > but > > brushing up my concepts with a clear requirement in mind will > definitely > > help ease writing code as I move forward. > > - · June 12 - June 20 : *Praveen's Implementation* - I think > > Praveen's implementation of the Hines' Solver will be a good place to > > start > > familiarizing myself with the code. He has provided a general overview > > of > > the work he did, and his code itself. Hopefully, those resources > (along > > with some help from the mentors) will be enough to understand the > > implementation. I understand that this code hasn't been committed to > the > > main repository yet, and would love to be able to polish it and commit > > (Although this is most certainly an extended goal). > > - · June 21 - June 30 : *Implementing Hsolve* - By the halfway > > point of the program, I hope to have completed implementation of the > > Hines' > > Solver. I don't know exactly what this will entail. Praveen mentions > > buffering neuron spikes. From what I understood reading the > sourceforge > > wiki, this involves only "Cable Equations and biophysical > > calculations". Do > > correct me if I am wrong. > > - · July 1 - July 31 : *Implementating another component* - After > > this point, my understanding of what needs to be done and what can be > > done > > is very sketchy. I would like to parallelize at least one more > > component of > > the system, but am not sure exactly what that will be. The wiki > mentions > > "Single neuron branched reaction-diffusion calculations" and "3D > > reaction > > diffusion calculations", so maybe one of those. Another possibility is > > parallelization of a different solver. I will need some help figuring > > this > > out. Also, please note that I will be out for a week or so at some > point > > during the month. > > - · August 1 - August 18 : *Cleaning up* - I thought that I > should > > allow for some time to polish up my code, make it readable, and make > > sure > > all documentation is up to date. This will ensure that the code is > clean > > before I commit it to the main repo. This time will also act as a > buffer > > period in case there is some bit of implementation remaining. > > > > There are a few rough edges in this schedule, so I was wondering if I > could > > get feedback on it and some help with filling in the holes. > > > > > > > > Thanks > > > > > > > > Vivek > > > > > ------------------------------------------------------------------------------ > > Learn Graph Databases - Download FREE O'Reilly Book > > "Graph Databases" is the definitive new guide to graph databases and > their > > applications. Written by three acclaimed leaders in the field, > > this first edition is now available. Download your free book today! > > http://p.sf.net/sfu/13534_NeoTech > > _______________________________________________ > > moose-devel mailing list > > moo...@li... > > https://lists.sourceforge.net/lists/listinfo/moose-devel > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel > |
From: Subhasis R. <ray...@gm...> - 2014-03-14 04:24:47
|
Dear Vivek, Can you please give us some pointers to your previous work (assuming they are publicly hosted)? Best, - Subhasis ( ʃʊbʱaːʃɪʃ ) On Fri, Mar 14, 2014 at 9:31 AM, vivek sagar <viv...@gm...>wrote: > Hello all, > > > > I am working towards participating in GSoC 2014 on the project > "*Optimization > of parallel computation in MOOSE*". I have been corresponding with Mr. > Subhasis Ray for a few weeks now, and have got a basic idea of how to > create new classes in MOOSE. > > I am working on a proposal for the GSoC application, a major part of which > is the schedule with proposed milestones. This is what I have come up with > so far: > > > - · May 19 - May 26: *Reading up Literature* - Praveen (the student > who worked on GPU implementation last year) suggested I read up *The > book of GENESIS* to get a good idea of how Neural Network Simulators are > built. Considering I have no prior knowledge in this field, I think that > this, along with other literature on such simulators, will help me > understand the concepts I will need. I have already begun reading it, > and > it has already provided a lot of perspective on what I will be working > on. > I will be getting started on this well before the beginning of the > coding > period (May 19). > - · May 27 - June 4:* Vacation* - I plan to do a long distance > cycling trip over 10 days during this time. Still figuring out the > logistics. Most probably from Bangalore to Goa! J > - · June 5 - June 11: *Brushing up parallel programming concepts* - > With a decent idea of the sort of problems Neural Network Simulators > try to > solve, I think now would be a good time to look up all the concepts of > parallel programming that I will need to implement parallelization. I > have > done some work in parallel programming before using OpenMP and CUDA, but > brushing up my concepts with a clear requirement in mind will definitely > help ease writing code as I move forward. > - · June 12 - June 20 : *Praveen's Implementation* - I think > Praveen's implementation of the Hines' Solver will be a good place to > start > familiarizing myself with the code. He has provided a general overview > of > the work he did, and his code itself. Hopefully, those resources (along > with some help from the mentors) will be enough to understand the > implementation. I understand that this code hasn't been committed to the > main repository yet, and would love to be able to polish it and commit > (Although this is most certainly an extended goal). > - · June 21 - June 30 : *Implementing Hsolve* - By the halfway > point of the program, I hope to have completed implementation of the > Hines' > Solver. I don't know exactly what this will entail. Praveen mentions > buffering neuron spikes. From what I understood reading the sourceforge > wiki, this involves only "Cable Equations and biophysical > calculations". Do > correct me if I am wrong. > - · July 1 - July 31 : *Implementating another component* - After > this point, my understanding of what needs to be done and what can be > done > is very sketchy. I would like to parallelize at least one more > component of > the system, but am not sure exactly what that will be. The wiki mentions > "Single neuron branched reaction-diffusion calculations" and "3D > reaction > diffusion calculations", so maybe one of those. Another possibility is > parallelization of a different solver. I will need some help figuring > this > out. Also, please note that I will be out for a week or so at some point > during the month. > - · August 1 - August 18 : *Cleaning up* - I thought that I should > allow for some time to polish up my code, make it readable, and make > sure > all documentation is up to date. This will ensure that the code is clean > before I commit it to the main repo. This time will also act as a buffer > period in case there is some bit of implementation remaining. > > There are a few rough edges in this schedule, so I was wondering if I could > get feedback on it and some help with filling in the holes. > > > > Thanks > > > > Vivek > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel > |
From: vivek s. <viv...@gm...> - 2014-03-14 04:01:41
|
Hello all, I am working towards participating in GSoC 2014 on the project "*Optimization of parallel computation in MOOSE*". I have been corresponding with Mr. Subhasis Ray for a few weeks now, and have got a basic idea of how to create new classes in MOOSE. I am working on a proposal for the GSoC application, a major part of which is the schedule with proposed milestones. This is what I have come up with so far: - · May 19 - May 26: *Reading up Literature* - Praveen (the student who worked on GPU implementation last year) suggested I read up *The book of GENESIS* to get a good idea of how Neural Network Simulators are built. Considering I have no prior knowledge in this field, I think that this, along with other literature on such simulators, will help me understand the concepts I will need. I have already begun reading it, and it has already provided a lot of perspective on what I will be working on. I will be getting started on this well before the beginning of the coding period (May 19). - · May 27 - June 4:* Vacation* - I plan to do a long distance cycling trip over 10 days during this time. Still figuring out the logistics. Most probably from Bangalore to Goa! J - · June 5 - June 11: *Brushing up parallel programming concepts* - With a decent idea of the sort of problems Neural Network Simulators try to solve, I think now would be a good time to look up all the concepts of parallel programming that I will need to implement parallelization. I have done some work in parallel programming before using OpenMP and CUDA, but brushing up my concepts with a clear requirement in mind will definitely help ease writing code as I move forward. - · June 12 - June 20 : *Praveen's Implementation* - I think Praveen's implementation of the Hines' Solver will be a good place to start familiarizing myself with the code. He has provided a general overview of the work he did, and his code itself. Hopefully, those resources (along with some help from the mentors) will be enough to understand the implementation. I understand that this code hasn't been committed to the main repository yet, and would love to be able to polish it and commit (Although this is most certainly an extended goal). - · June 21 - June 30 : *Implementing Hsolve* - By the halfway point of the program, I hope to have completed implementation of the Hines' Solver. I don't know exactly what this will entail. Praveen mentions buffering neuron spikes. From what I understood reading the sourceforge wiki, this involves only "Cable Equations and biophysical calculations". Do correct me if I am wrong. - · July 1 - July 31 : *Implementating another component* - After this point, my understanding of what needs to be done and what can be done is very sketchy. I would like to parallelize at least one more component of the system, but am not sure exactly what that will be. The wiki mentions "Single neuron branched reaction-diffusion calculations" and "3D reaction diffusion calculations", so maybe one of those. Another possibility is parallelization of a different solver. I will need some help figuring this out. Also, please note that I will be out for a week or so at some point during the month. - · August 1 - August 18 : *Cleaning up* - I thought that I should allow for some time to polish up my code, make it readable, and make sure all documentation is up to date. This will ensure that the code is clean before I commit it to the main repo. This time will also act as a buffer period in case there is some bit of implementation remaining. There are a few rough edges in this schedule, so I was wondering if I could get feedback on it and some help with filling in the holes. Thanks Vivek |
From: Subhasis R. <ray...@gm...> - 2014-03-10 06:17:45
|
Dear Dilawar, There was an update in naming convention which has not been reflected in the pulsegen demo: moose.connect(tab, 'requestOut', pg, 'getOutput') should be moose.connect(tab, 'requestOut', pg, 'getOutputValue') I have committed this change to svn repo. Please update your copy. Also, in general the naming convention is that if there is a src field called output, then its counterpart value field is outputValue. Best, - Subhasis ( ʃʊbʱaːʃɪʃ ) On Sun, Mar 9, 2014 at 12:18 AM, Dilawar Singh <dil...@nc...> wrote: > I am running Demo/snippets/pulsegen.py file with async branch. On line 64, > following line is causing problem. > > tab = moose.Table('tab') > m = moose.connect(tab, 'requestOut', pg, 'output', 'Single') > > I have tried changing srcField (requestOut) many times and even printing > all > possible srcField. But it always fails with following error message: > > Shell::doAddMsg: Error: Src/Dest Msg type mismatch: requestOut/output > > There is virtual function `checkTarget` which checks for type mismatch, > but it > is returning 0 in every case. The comment on top of the virual function > says, > > Is called only from msg src, so most Finfos return 0. > > Is there a note or some writeup which summarises how to set-up connection > in > async branch. > > -- > Dilawar > > > ------------------------------------------------------------------------------ > Subversion Kills Productivity. Get off Subversion & Make the Move to > Perforce. > With Perforce, you get hassle-free workflows. Merge that actually works. > Faster operations. Version large binaries. Built-in WAN optimization and > the > freedom to use Git, Perforce or both. Make the move to Perforce. > > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel > |
From: Dilawar S. <dil...@nc...> - 2014-03-08 18:49:09
|
I am running Demo/snippets/pulsegen.py file with async branch. On line 64, following line is causing problem. tab = moose.Table('tab') m = moose.connect(tab, 'requestOut', pg, 'output', 'Single') I have tried changing srcField (requestOut) many times and even printing all possible srcField. But it always fails with following error message: Shell::doAddMsg: Error: Src/Dest Msg type mismatch: requestOut/output There is virtual function `checkTarget` which checks for type mismatch, but it is returning 0 in every case. The comment on top of the virual function says, Is called only from msg src, so most Finfos return 0. Is there a note or some writeup which summarises how to set-up connection in async branch. -- Dilawar |
From: Dilawar S. <dil...@nc...> - 2014-02-22 08:49:08
|
On many recent releases or rpm based linux default openmpi lib is libmpi.so.1 rather than `libmpi.so.0`. I have changed `/python/moose/__init__.py` file in my local repository. The diff is following ~~~~ +++ b/python/moose/__init__.py @@ -236,5 +236,9 @@ elements under current working element __version__ = '$Revision: 4454$' # $Source$ import ctypes -ctypes.CDLL('libmpi.so.0', ctypes.RTLD_GLOBAL) +try: + ctypes.CDLL('libmpi.so.0', ctypes.RTLD_GLOBAL) +except Exception as e: + ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL) + ~~~~ This compiles and runs on opensuse 13.1. If this is OK then it can be merged after adding additional `finally` clause. -- Dilawar |
From: Niraj D. <ni...@nc...> - 2013-11-26 03:54:59
|
Hi Saeed, A single instance of HSolve is intended to handle a single neuron. You are correct in your suspicion that you will need to create a separate HSolve for each neuronal model. There is development underway that will allow a single HSolve object handle multiple neurons which are identical, or at least have identical branching structure. However, this is not ready yet. Best, Niraj > Dear all, > > I am trying to use HSolve for two neuron which are located at > /network/cell1 and /network/cell2. I set HSolve target field to /network, > but it seems that the HSolve just consider the first cell and the second > cell does not zumbify. > > Would you please help me to know how can I use hsolve for a bunch of > neurons? > Does it create a HSolve object for every neuron? > What can I do if I want to send a pool of neurons to hsolve? > > I am looking forward to hear from your > > Best Regards, > Saeed > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > moose-devel mailing list > moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-devel > |