Package empro :: Package toolkit :: Module project :: Class EMProProject
[frames] | no frames]

Class EMProProject

source code

A Python representation of an EMPro Project by path name

Instance Methods
 
__init__(self, path)
@type path string @param path path to project, e.g.
source code
None
activate(self)
Loads as active project.
source code
 
simulationIds(self)
return all available simulation ids
source code
 
simulationDir(self, simId)
returns directory containing project.xsim @type simId string @param simId id of simulation
source code
 
simulationEngine(self, simId)
return engine type of simulation
source code
 
copyTo(self, destPath, clean=False, shallow=False)
Copy file tree of project to new location.
source code
simId
createNewSimulation(self, engine=...)
Loads as active project and creates a new simulation without adding it to the queue.
source code
 
createSimulationProcess(self, simId, threads=1, hardwareOnly=False, storeMinidump=False, handleMinidump=None, stdout=None, stderr=None, extraOptions=None, distributed=False)
Starts a subprocess running a simulation.
source code
 
runSimulation(self, *args, **kwargs)
Starts a simulation, and wait until it is finished.
source code
Properties
  path
  name
  resultTree
Method Details

__init__(self, path)
(Constructor)

source code 

@type path string @param path path to project, e.g. foo/bar.ep

activate(self)

source code 

Loads as active project. After this call, empro.activeProject will hold this project, until another project is loaded.

Returns: None

copyTo(self, destPath, clean=False, shallow=False)

source code 

Copy file tree of project to new location. @type destPath string @param destPath new location of copy, e.g. foo/bar.ep @type clean bool @param clean if true, the new location is first cleaned. @type shallow bool @param shallow if True, the simulations are skipped during copying

createNewSimulation(self, engine=...)

source code 

Loads as active project and creates a new simulation without adding it to the queue.

It assumes the project is preconfigured so new simulations can be created without additional information. Setting up simulation configuration without creating is done with the 'New FDTD Simulation' or 'New FEM Simulation' dialogs as usual, but by clicking 'Done' instead of 'Create & Queue Simulation' or 'Create Simulation Only'.

Whether an FDTD or an FEM simulation will be created depends on which dialog was used as last. To change this, open either 'New FDTD Simulation' or 'New FEM Simulation' and simply click 'Done'. Then save the project.

Returns: simId

createSimulationProcess(self, simId, threads=1, hardwareOnly=False, storeMinidump=False, handleMinidump=None, stdout=None, stderr=None, extraOptions=None, distributed=False)

source code 

Starts a subprocess running a simulation. It returns a tuple (process, dirname, command):

  • process: instance of subprocess.Popen
  • dirname: string
  • command: string

runSimulation(self, *args, **kwargs)

source code 

Starts a simulation, and wait until it is finished. Raises an exception if the simulation failed. Arguments are the same as for createSimulationProcess


Property Details

path

Get Method:
internal.path(self)

name

Get Method:
internal.name-1(self)

resultTree

Get Method:
internal.resultTree(self)