Commit 5dc706f0 authored by eric pellegrini's avatar eric pellegrini

Merge branch 'release-1.0.4.rc1'

parents b244f2c9 bc2392b3
Pipeline #1178 failed with stages
in 11 minutes and 15 seconds
version 1.0.4.rc1
----------------
* bug fix in IWidget: the label of the configurator was not taken into account
* bug fix path_to_module function: the list of directories has to be parsed backwards
* raise an error when none or more than atom matches the mass stored in the LAMMPS config file
* modified the label for r value
version 1.0.3.e:
----------------
* bug fix relative to REGISTRY update
......
......@@ -42,13 +42,13 @@ def path_to_module(path,stop=""):
path, _ = os.path.splitext(path)
splittedPath = path.split(os.sep)
try:
idx = splittedPath.index(stop)
idx = splittedPath[::-1].index(stop)
except ValueError:
idx = 0
finally:
module = ".".join(splittedPath[idx:])
module = ".".join(splittedPath[len(splittedPath)-1-idx:])
return module
......@@ -110,14 +110,14 @@ class ClassRegistry(object):
:param packageDir: the package for which all modules should be imported
:type packageDir: str
'''
for module in glob.glob(os.path.join(packageDir,'*.py')):
moduleDir, moduleFile = os.path.split(module)
if moduleFile == '__init__.py':
continue
# Any error that may occur here has to be caught. In such case the module is skipped.
try:
if macros:
......
......@@ -50,7 +50,7 @@ class DistanceHistogram(IJob):
settings = collections.OrderedDict()
settings['trajectory'] = ('mmtk_trajectory',{})
settings['frames'] = ('frames', {'dependencies':{'trajectory':'trajectory'}})
settings['r_values'] = ('range', {'valueType':float, 'includeLast':True, 'mini':0.0})
settings['r_values'] = ('range', {'label':'r values (nm)','valueType':float, 'includeLast':True, 'mini':0.0})
settings['atom_selection'] = ('atom_selection', {'dependencies':{'trajectory':'trajectory'}})
settings['atom_transmutation'] = ('atom_transmutation', {'dependencies':{'trajectory':'trajectory','atom_selection':'atom_selection'}})
settings['weights']=('weights',{"dependencies":{"atom_selection":"atom_selection"}})
......
......@@ -100,7 +100,12 @@ class LAMMPSConfigFile(dict):
for j in range(1, self["n_atom_types"]+1):
idx, mass = lines[i+j].strip().split()
el = ELEMENTS.match_numeric_property("atomic_weight", float(mass), tolerance=1.0e-3)
tolerance = 1.0e-3
idx = int(idx)
mass = float(mass)
el = ELEMENTS.match_numeric_property("atomic_weight", mass, tolerance=tolerance)
if len(el) != 1:
raise LAMMPSConfigFileError("The atom %d with defined mass %f could not be assigned with a tolerance of %f. Please modify the mass in the config file to comply with MDANSE internal database" % (idx,mass,tolerance))
self["elements"][idx] = el[0]
m = re.match("^bonds$",line, re.I)
......
......@@ -50,7 +50,7 @@ class IWidget(wx.Panel):
self._configurator = configurator
self._label = ' '.join(name.capitalize().split('_'))
self._label = self._configurator.label
self.initialize()
......
__version__ = "1.0.3.e"
__version__ = "1.0.4.rc1"
__date__ = "18-11-2016"
__date__ = "22-11-2016"
__author__ = "Eric Pellegrini"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment