WARPXM v1.10.0
Loading...
Searching...
No Matches
warpy.simulation Namespace Reference

Classes

class  simulation
 Simulation base class. More...
 

Functions

def recurse_remove_files (base_dir)
 
def format_walltime (t)
 
def load_configs (local_path=None, site_path='warpy_config.py')
 
def env_vars_to_str (args)
 Converts a dictionary of extra environment variables to a string that can be used on the command line.
 
def replace_macros (macros, line)
 Replaces template macro vars in a single line.
 
def write_git_info (rundir, git_repo)
 Writes git commit and working directory status information to text file in output directory.
 
def setup_sim (category=None, local_path=None, site_path='warpy_config.py', input_file=None, sim=None, wxm_args=[], sim_param=None)
 Setups the simulation run directory.
 
def run (category=None, local_path=None, site_path='warpy_config.py', input_file=None, sim=None, wxm_args=[], sim_param=None)
 runs a WARPXM simulation.
 
def unique_h_acts_ (groups)
 

Function Documentation

◆ env_vars_to_str()

def warpy.simulation.env_vars_to_str (   args)

Converts a dictionary of extra environment variables to a string that can be used on the command line.

◆ format_walltime()

def warpy.simulation.format_walltime (   t)

◆ load_configs()

def warpy.simulation.load_configs (   local_path = None,
  site_path = 'warpy_config.py' 
)

◆ recurse_remove_files()

def warpy.simulation.recurse_remove_files (   base_dir)

◆ replace_macros()

def warpy.simulation.replace_macros (   macros,
  line 
)

Replaces template macro vars in a single line.

Syntax is similar to the one used by QtCreator. Available macros are in macros.

Can place a **:u** to convert the macro to upper case, and **:l** to convert to lower case. ex.: ProjectName:u% would expand to the project name in all caps.

Parameters
macros
line
Returns
replaced line

◆ run()

def warpy.simulation.run (   category = None,
  local_path = None,
  site_path = 'warpy_config.py',
  input_file = None,
  sim = None,
  wxm_args = [],
  sim_param = None 
)

runs a WARPXM simulation.

This may be either a pre-existing input file, or one to be generated by a given simulation object. Resolves parameters in the with the following priority (highest priority to lowest):

  1. local config file
  2. site config file
Parameters
categorysimulation category. Only used if sim is not None.
local_pathpath to the local config file, or None to not use any local config file. This is relative to the current working directory (if given a relative path).
site_pathpath to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path).
input_filepath of an input file to run. This is mutually exclusive to sim.
simsimulation to generate the input file from. This is mutually exclusive to input_file_path
wxm_argsExtra arguments to pass to WARPXM
Returns
return code from running WARPXM

◆ setup_sim()

def warpy.simulation.setup_sim (   category = None,
  local_path = None,
  site_path = 'warpy_config.py',
  input_file = None,
  sim = None,
  wxm_args = [],
  sim_param = None 
)

Setups the simulation run directory.

This may be either a pre-existing input file, or one to be generated by a given simulation object. Resolves parameters in the with the following priority (highest priority to lowest):

  1. local config file
  2. site config file
Parameters
categorysimulation category. Only used if sim is not None.
local_pathpath to the local config file, or None to not use any local config file. This is relative to the current working directory (if given a relative path).
site_pathpath to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path).
input_filepath of an input file to run. This is mutually exclusive to sim.
simsimulation to generate the input file from. This is mutually exclusive to input_file_path
wxm_argsExtra arguments to pass to WARPXM
Returns
tuple: list of strings for how to run sim on command-line, second entry is the working directory

◆ unique_h_acts_()

def warpy.simulation.unique_h_acts_ (   groups)

◆ write_git_info()

def warpy.simulation.write_git_info (   rundir,
  git_repo 
)

Writes git commit and working directory status information to text file in output directory.

Parameters
rundirOutput directory.