Commit da5f5a9b authored by eric pellegrini's avatar eric pellegrini

Merge tag '1.0.4.rc1' into develop

version 1.0.4.rc1
parents 47847a26 5dc706f0
Pipeline #1177 failed with stages
in 10 minutes and 42 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: version 1.0.3.e:
---------------- ----------------
* bug fix relative to REGISTRY update * bug fix relative to REGISTRY update
......
...@@ -42,13 +42,13 @@ def path_to_module(path,stop=""): ...@@ -42,13 +42,13 @@ def path_to_module(path,stop=""):
path, _ = os.path.splitext(path) path, _ = os.path.splitext(path)
splittedPath = path.split(os.sep) splittedPath = path.split(os.sep)
try: try:
idx = splittedPath.index(stop) idx = splittedPath[::-1].index(stop)
except ValueError: except ValueError:
idx = 0 idx = 0
finally: finally:
module = ".".join(splittedPath[idx:]) module = ".".join(splittedPath[len(splittedPath)-1-idx:])
return module return module
...@@ -110,14 +110,14 @@ class ClassRegistry(object): ...@@ -110,14 +110,14 @@ class ClassRegistry(object):
:param packageDir: the package for which all modules should be imported :param packageDir: the package for which all modules should be imported
:type packageDir: str :type packageDir: str
''' '''
for module in glob.glob(os.path.join(packageDir,'*.py')): for module in glob.glob(os.path.join(packageDir,'*.py')):
moduleDir, moduleFile = os.path.split(module) moduleDir, moduleFile = os.path.split(module)
if moduleFile == '__init__.py': if moduleFile == '__init__.py':
continue continue
# Any error that may occur here has to be caught. In such case the module is skipped. # Any error that may occur here has to be caught. In such case the module is skipped.
try: try:
if macros: if macros:
......
...@@ -50,7 +50,7 @@ class DistanceHistogram(IJob): ...@@ -50,7 +50,7 @@ class DistanceHistogram(IJob):
settings = collections.OrderedDict() settings = collections.OrderedDict()
settings['trajectory'] = ('mmtk_trajectory',{}) settings['trajectory'] = ('mmtk_trajectory',{})
settings['frames'] = ('frames', {'dependencies':{'trajectory':'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_selection'] = ('atom_selection', {'dependencies':{'trajectory':'trajectory'}})
settings['atom_transmutation'] = ('atom_transmutation', {'dependencies':{'trajectory':'trajectory','atom_selection':'atom_selection'}}) settings['atom_transmutation'] = ('atom_transmutation', {'dependencies':{'trajectory':'trajectory','atom_selection':'atom_selection'}})
settings['weights']=('weights',{"dependencies":{"atom_selection":"atom_selection"}}) settings['weights']=('weights',{"dependencies":{"atom_selection":"atom_selection"}})
......
...@@ -100,7 +100,12 @@ class LAMMPSConfigFile(dict): ...@@ -100,7 +100,12 @@ class LAMMPSConfigFile(dict):
for j in range(1, self["n_atom_types"]+1): for j in range(1, self["n_atom_types"]+1):
idx, mass = lines[i+j].strip().split() 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] self["elements"][idx] = el[0]
m = re.match("^bonds$",line, re.I) m = re.match("^bonds$",line, re.I)
......
...@@ -50,7 +50,7 @@ class IWidget(wx.Panel): ...@@ -50,7 +50,7 @@ class IWidget(wx.Panel):
self._configurator = configurator self._configurator = configurator
self._label = ' '.join(name.capitalize().split('_')) self._label = self._configurator.label
self.initialize() self.initialize()
......
__version__ = "1.0.3.e" __version__ = "1.0.4.rc1"
__date__ = "18-11-2016" __date__ = "22-11-2016"
__author__ = "Eric Pellegrini" __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