Commit c4372d57 by eric pellegrini

Merge branch 'feature-clarify-API-output_files_parameter' into 'develop'

Replacing all output_file occurences by output_files See merge request !13
parents 8235f09d b83428de
Pipeline #3832 passed with stages
in 15 minutes 7 seconds
......@@ -142,7 +142,7 @@ class CASTEPConverter(Converter):
settings = collections.OrderedDict()
settings['castep_file'] = ('input_file', {'default':os.path.join('..','..','..','Data','Trajectories','CASTEP','PBAnew.md')})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
"""
......@@ -165,7 +165,7 @@ class CASTEPConverter(Converter):
self._gradients = ParticleVector(self._universe)
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w')
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w')
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -280,7 +280,7 @@ class DCDConverter(Converter):
settings = collections.OrderedDict()
settings['pdb_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','CHARMM','2vb1.pdb')})
settings['dcd_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','CHARMM','2vb1.dcd')})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
settings['fold'] = ('boolean', {'default':False,'label':"Fold coordinates in to box"})
def initialize(self):
......@@ -313,7 +313,7 @@ class DCDConverter(Converter):
resolve_undefined_molecules_name(self._universe)
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w')
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w')
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions=[TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -299,7 +299,7 @@ class DL_POLYConverter(Converter):
'default':os.path.join('..','..','..','Data','Trajectories','DL_Poly','HISTORY_cumen')})
settings['atom_aliases'] = ('python_object',{'default':{}})
settings['version'] = ('single_choice', {'choices':_HISTORY_FORMAT.keys(), 'default':'2'})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -338,7 +338,7 @@ class DL_POLYConverter(Converter):
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w', comment=self._fieldFile["title"])
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w', comment=self._fieldFile["title"])
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -235,7 +235,7 @@ class DiscoverConverter(Converter):
settings = collections.OrderedDict()
settings['xtd_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','Discover','sushi.xtd')})
settings['his_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','Discover','sushi.his')})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -267,7 +267,7 @@ class DiscoverConverter(Converter):
self._universe.foldCoordinatesIntoBox()
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w', comment=self._hisfile["title"])
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w', comment=self._hisfile["title"])
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -285,7 +285,7 @@ class ForciteConverter(Converter):
settings = collections.OrderedDict()
settings['xtd_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','Forcite','nylon66_rho100_500K_v300K.xtd')})
settings['trj_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','Forcite','nylon66_rho100_500K_v300K.trj')})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -315,7 +315,7 @@ class ForciteConverter(Converter):
self._forces.array[:,:] = 0.00
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w', comment=self._trjfile["title"])
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w', comment=self._trjfile["title"])
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -166,7 +166,7 @@ class GenericConverter(Converter):
settings = collections.OrderedDict()
settings['gt_file'] = ('input_file',{'wildcard':"Generic trajectory files|*.gtf|All files|*",
'default':os.path.join('..','..','..','Data','Trajectories','Generic','test.gtf')})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -331,7 +331,7 @@ class GenericConverter(Converter):
self._dataShape=(self._universe.numberOfAtoms(),3)
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w')
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w')
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -140,7 +140,7 @@ class LAMMPSConverter(Converter):
settings['mass_tolerance'] = ('float', {'label':"mass tolerance (uma)", 'default':1.0e-5, 'mini':1.0e-9})
settings['time_step'] = ('float', {'label':"time step (fs)", 'default':1.0, 'mini':1.0e-9})
settings['n_steps'] = ('integer', {'label':"number of time steps", 'default':1, 'mini':0})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -155,7 +155,7 @@ class LAMMPSConverter(Converter):
self.parse_first_step()
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w')
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w')
self._nameToIndex = dict([(at.name,at.index) for at in self._universe.atomList()])
......
......@@ -51,7 +51,7 @@ class PDBConverter(Converter):
settings['pdb_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','PDB','2f58_nma.pdb')})
settings['nb_frame'] = ('range', {'valueType':int, 'includeLast':True, 'mini':0.0, 'default':(0,2,1)})
settings['time_step'] = ('float', {'mini':1.0e-6, 'default':1.0})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
"""
......@@ -71,7 +71,7 @@ class PDBConverter(Converter):
self._universe.addObject(pdb_config.createAll(None, 1))
# Open the new trajectory
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], "w", "Converted from PDB")
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], "w", "Converted from PDB")
# Make a snapshot generator for saving.
self._snapshot = SnapshotGenerator(self._universe,actions = [TrajectoryOutput(self._trajectory, None, 0, None, 1)])
......
......@@ -126,7 +126,7 @@ class VASPConverter(Converter):
settings = collections.OrderedDict()
settings['xdatcar_file'] = ('input_file',{'default':os.path.join('..','..','..','Data','Trajectories','VASP','XDATCAR_version5')})
settings['time_step'] = ('float', {'label':"time step", 'default':1.0, 'mini':1.0e-9})
settings['output_file'] = ('output_files', {'formats':["netcdf"]})
settings['output_files'] = ('output_files', {'formats':["netcdf"]})
def initialize(self):
'''
......@@ -146,7 +146,7 @@ class VASPConverter(Converter):
self._universe.addObject(Atom(symbol, name="%s_%d" % (symbol,i)))
# A MMTK trajectory is opened for writing.
self._trajectory = Trajectory(self._universe, self.configuration['output_file']['files'][0], mode='w')
self._trajectory = Trajectory(self._universe, self.configuration['output_files']['files'][0], mode='w')
# A frame generator is created.
self._snapshot = SnapshotGenerator(self._universe, actions = [TrajectoryOutput(self._trajectory, ["all"], 0, None, 1)])
......
......@@ -53,10 +53,7 @@ class JobFileGenerator():
temp = 'parameters[%r] = %r\n' % (k, v)
test_string = test_string + ' ' + temp.replace('\\\\', '/')
test_string = test_string + ' job = REGISTRY[%r][%r]()\n' % ('job',self.job._type)
test_string = test_string + ' if "output_file" in parameters:\n'
test_string = test_string + ' output_path = parameters["output_file"][0]\n'
test_string = test_string + ' else:\n'
test_string = test_string + ' output_path = parameters["output_files"][0]\n'
test_string = test_string + ' output_path = parameters["output_files"][0]\n'
test_string = test_string + ' reference_data_path = "' + self.reference_data_path.replace('\\', '/') + '"\n'
# Launch the job in monoprocessor mode and copy output file
test_string = test_string + ' print "Launching job in monoprocessor mode"\n'
......
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