sirepo.sim_data package

Type-based simulation operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.SimDataBase[source]

Bases: object

ANALYSIS_ONLY_FIELDS = frozenset({})
LIB_DIR = 'lib'
WATCHPOINT_REPORT = 'watchpointReport'
WATCHPOINT_REPORT_RE = re.compile('^watchpointReport(\\d+)$')
classmethod compute_job_hash(data, qcall)[source]

Hash fields related to data and set computeJobHash

Only needs to be unique relative to the report, not globally unique so MD5 is adequate. Long and cryptographic hashes make the cache checks slower.

Parameters:
  • data (dict) – simulation data

  • changed (callable) – called when value changed

Returns:

hash value

Return type:

bytes

classmethod compute_model(model_or_data)[source]

Compute model for this model_or_data

Parameters:

() (model_or_data) – analysis model

Returns:

name of compute model for report

Return type:

str

classmethod does_api_reply_with_file(api, method)[source]

Identify which job_api calls expect files

Parameters:
  • api (str) – job_api method, e.g. api_statelessCompute

  • method (str) – template sub-method of api, e.g. sample_preview

Returns:

True if method can return a file

Return type:

bool

classmethod example_paths()[source]
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod frame_id(data, response, model, index)[source]

Generate a frame_id from values (unit testing)

Parameters:
  • data (PKDict) – model data

  • response (PKDict) – JSON response

  • model (str) – animation name

  • index (int) – index of frame

Returns:

combined frame id

Return type:

str

classmethod is_parallel(data_or_model)[source]

Is this report a parallel (long) simulation?

Parameters:

data_or_model (dict) – sim data or compute_model

Returns:

True if parallel job

Return type:

bool

classmethod is_run_mpi()[source]
classmethod is_watchpoint(name)[source]
classmethod lib_file_abspath(basename, data=None, qcall=None)[source]

Returns full, unique paths of simulation files

Parameters:
  • basename (str) – lib file basename

  • data – DEPRECATED

Returns:

py.path.local to files (duplicates removed) OR py.path.local

Return type:

object

classmethod lib_file_basenames(data)[source]

List files used by the simulation

Parameters:

data (dict) – sim db

Returns:

list of str, sorted

Return type:

set

classmethod lib_file_exists(basename, qcall=None)[source]

Does basename exist in library

Parameters:
  • basename (str) – to test for existence

  • qcall (quest.API) – quest state

Returns:

True if it exists

Return type:

bool

classmethod lib_file_in_use(data, basename)[source]

Check if file in use by simulation

Parameters:
  • data (dict) – simulation

  • basename (str) – to check

Returns:

True if basename in use by data

Return type:

bool

classmethod lib_file_is_zip(basename)[source]

Is this lib file a zip file?

Parameters:

basename (str) – to search

Returns:

True if is a zip file

Return type:

bool

classmethod lib_file_name_with_model_field(model_name, field, filename)[source]
classmethod lib_file_name_with_type(filename, file_type)[source]
classmethod lib_file_name_without_type(basename)[source]

Strip the file type prefix

See lib_file_name which prefixes with model-field.

Parameters:

basename – lib file name with type

Returns:

basename without type prefix

Return type:

str

classmethod lib_file_names_for_type(file_type, qcall=None)[source]

Return sorted list of files which match file_type

Parameters:

file_type (str) – in the format of model-field

Returns:

sorted list of file names stripped of file_type

Return type:

list

classmethod lib_file_read_binary(basename, qcall=None)[source]

Get contents of basename from lib as bytes

Parameters:
  • basename (str) – full name including suffix

  • qcall (quest.API) – logged in user

Returns:

contents of file

Return type:

bytes

classmethod lib_file_read_text(*args, **kwargs)[source]

Get contents of basename from lib as str

Parameters:
  • basename (str) – full name including suffix

  • qcall (quest.API) – logged in user

Returns:

contents of file

Return type:

str

classmethod lib_file_resource_path(basename)[source]

Location of lib file in source distribution

Parameters:

basename (str) – complete name of lib file

Returns:

Absolute path to file in source distribution

Return type:

py.path

classmethod lib_file_save_from_url(url, model_name, field)[source]

Fetch url and save to lib

Path to save to is lib_file_name_with_model_field is called with the basename of url.

Parameters:
  • url (str) – web address

  • model_name (str) – model name

  • field (str) – field of the model

classmethod lib_file_size(basename, qcall=None)[source]

Get size of basename from lib

Parameters:
  • basename (str) – full name including suffix

  • qcall (quest.API) – logged in user

Returns:

size in bytes

Return type:

int

classmethod lib_file_write(basename, path_or_content, qcall=None)[source]

Save content to basename in lib

Parameters:
  • basename (str) – full name including suffix

  • path_or_content (str|bytes|py.path) – what to save, may be text or binary

  • qcall (quest.API) – logged in user

classmethod lib_file_write_path(basename, qcall=None)[source]

DEPRECATED: Use lib_file_write

classmethod lib_files_for_export(data, qcall=None)[source]
classmethod lib_files_from_other_user(data, other_lib_dir, qcall)[source]

Copy auxiliary files to other user

Does not copy resource files. Only works locally.

Parameters:
  • data (dict) – simulation db

  • other_lib_dir (py.path) – source directory

classmethod lib_files_to_run_dir(data, run_dir)[source]

Copy auxiliary files to run_dir

Parameters:
  • data (dict) – simulation db

  • run_dir (py.path) – where to copy to

classmethod model_defaults(name)[source]

Returns a set of default model values from the schema.

Some special cases:

if the data type is “UUID” and the default value is empty, set the value to a new UUID string

if the data type is “RandomId” and the default value is empty, set the value to a new Base62 string

if the data type has the form “model.zzz”, set the value to the default value of model “zzz”

Parameters:

name (str) – model name

classmethod parse_jid(data, uid)[source]

A Job is a tuple of user, sid, and compute_model.

A jid is words and dashes.

Parameters:
  • data (dict) – extract sid and compute_model

  • uid (str) – user id

Returns:

unique name (treat opaquely)

Return type:

str

classmethod parse_model(obj)[source]

Find the model in the arg

Looks for frameReport, report, and modelName. Might be a compute or analysis model.

Parameters:

obj (str or dict) – simulation type or description

Returns:

target of the request

Return type:

str

classmethod parse_sid(obj)[source]

Extract simulationId from obj

Parameters:

obj (object) – may be data, req, resp, or string

Returns:

simulation id

Return type:

str

classmethod poll_seconds(data)[source]

Client poll period for simulation status

TODO(robnagler) needs to be encapsulated

Parameters:

data (dict) – must container report name

Returns:

number of seconds to poll

Return type:

int

classmethod prepare_import_file_args(req)[source]
classmethod proprietary_code_lib_file_basenames()[source]
classmethod proprietary_code_tarball()[source]
classmethod put_sim_file(sim_id, src_file_name, dst_basename)[source]

Write a file to the simulation’s database directory

Parameters:
  • sim_id (str) – simulation id

  • src_file_name (str or py.path) – local file to send to sim_db

  • dst_basename (str) – name in sim repo dir

classmethod resource_path(filename)[source]

Static resource (package_data) file for simulation

Returns:

absolute path to file

Return type:

py.path.local

classmethod schema()[source]

Get schema for code

Returns:

schema

Return type:

PKDict

classmethod sim_db_client()[source]

Low-level for sim_db_file ops for job agents

Used to manipulate sim db files in job agent. Care should be taken to avoid inefficiencies as these are remote requests. Typically, these are done in job_cmd, not job_agent, because operations are synchronous.

Returns:

interface to sirepo.sim_db_file

Return type:

SimDbClient

classmethod sim_db_read_sim(sim_id, sim_type=None, qcall=None)[source]

Read simulation sdata for sim_id

Calls simulation_db.read_simulation_json

Parameters:
  • sim_id (str) – which simulation

  • sim_type (str) – simulation type [cls.sim_type()]

  • qcall (quest.API) – quest [None]

Returns:

sdata

Return type:

PKDict

classmethod sim_db_save_sim(sdata, qcall=None)[source]

Save sdata to simulation db.

Calls simulation_db.save_simulation_json

Parameters:
  • sdata (PKDict) – what to write

  • qcall (quest.API) – quest [None]

Returns:

updated sdata

Return type:

PKDict

classmethod sim_file_basenames(data)[source]

List of files needed for this simulation

Returns:

basenames of sim repo dir

Return type:

list

classmethod sim_files_to_run_dir(data, run_dir)[source]

Copy files from sim repo dir to run_dir

Calls sim_file_basenames to get list of sim files.

Parameters:
  • data (PKDict) – used to identify simulation

  • run_dir (py.path) – directory to write to

classmethod sim_run_dir_prepare(run_dir, data=None)[source]

Create and install files, update parameters, and generate command.

Copies files into the simulation directory (run_dir) Updates the parameters in data and save. Generate the pkcli command.

Parameters:
  • run_dir (py.path.local or str) – dir simulation will be run in

  • data (PKDict) – optional, will read from run_dir

Returns:

pkcli command to execute

Return type:

list

classmethod sim_run_input(run_dir, checked=True)[source]

Read input from run dir

Parameters:
  • run_dir (py.path) – directory containing input file

  • checked (bool) – raise if not found [True]

Returns:

sim input data or None if not checked

Return type:

PKDict

classmethod sim_run_input_fixup(data)[source]

Fixup data for simulation input

Parameters:

data (PKDict) – for a run or whole sim data

Returns:

fixed up data

Return type:

PKDict

classmethod sim_run_input_path(run_dir)[source]

Generate path from run_dir

Parameters:

run_dir (py.path) – directory containing input file

Returns:

path to run input

Return type:

py.path

classmethod sim_run_input_to_run_dir(data, run_dir)[source]

Read input from run dir

Parameters:
  • data (PKDict) – for a run or whole sim data

  • run_dir (py.path) – directory read from

Returns:

fixed up sim input data

Return type:

PKDict

classmethod sim_type()[source]
classmethod support_files_to_run_dir(data, run_dir)[source]
classmethod update_model_defaults(model, name, dynamic=None)[source]
classmethod want_browser_frame_cache(report)[source]
classmethod watchpoint_id(report)[source]
sirepo.sim_data.audit_proprietary_lib_files(qcall, force=False, sim_types=None, uid=None)[source]

Add/removes proprietary files based on a user’s roles

For example, add the Flash tarball if user has the flash role.

Parameters:
  • qcall (quest.API) – logged in user

  • force (bool) – Overwrite existing lib files with the same name as new ones

  • sim_types (set) – Set of sim_types to audit (proprietary_sim_types if None)

sirepo.sim_data.get_class(type_or_data)[source]

Simulation data class

Parameters:

type_or_data (str or dict) – simulation type or description

Returns:

simulation data operation class

Return type:

type

sirepo.sim_data.parse_frame_id(frame_id)[source]

Parse the frame_id and return it along with self

Parameters:

frame_id (str) – values separated by “*”

Returns:

frame_args SimDataBase: sim_data object for this simulationType

Return type:

PKDict

sirepo.sim_data.resource_path(filename)[source]

Path to common (not specific to sim type) resource file

sirepo.sim_data.template_globals(sim_type=None)[source]

Initializer for templates

Usage::

_SIM_DATA, SIM_TYPE, _SCHEMA = sirepo.sim_data.template_globals()

Parameters:

sim_type (str) – simulation type [calling module’s basename]

Returns:

SimData class, simulation type, and schema

Return type:

(class, str, object)

Submodules

sirepo.sim_data.activait module

sirepo.sim_data.adm module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.adm.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.canvas module

simulation data operations

copyright:

Copyright (c) 2024 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.canvas.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.controls module

sirepo.sim_data.cortex module

simulation data operations

copyright:

Copyright (c) 2025 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.cortex.SimData[source]

Bases: SimDataBase

SUMMARY_GLOB = '*-summary.json'
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod lib_file_from_parts(report, material_id, stat, suffix)[source]
classmethod lib_glob(suffix)[source]
classmethod parts_from_lib_file(filename)[source]
classmethod parts_from_summary_file(filename)[source]
classmethod summary_file_from_parts(report, material_id)[source]

sirepo.sim_data.elegant module

elegant simulation data functions

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.elegant.SimData[source]

Bases: LatticeSimData

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod sim_type()

sirepo.sim_data.epicsllrf module

simulation data operations

copyright:

Copyright (c) 2023 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.epicsllrf.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.flash module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.flash.SimData[source]

Bases: SimDataBase

COMPILE_LOG = 'compile.log'
FLASH_PAR_FILE = 'flash.par'
SETUP_LOG = 'setup.log'
SETUP_PARAMS_SCHEMA_FILE = 'setup_params.json'
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod flash_app_archive_basename()[source]
classmethod flash_app_lib_basename(sim_id)[source]
classmethod flash_exe_basename(data)[source]
classmethod flash_problem_files_archive_basename(data)[source]
classmethod flash_problem_files_archive_hash(path)[source]
classmethod flash_setup_command(setup_args)[source]
classmethod proprietary_code_lib_file_basenames()[source]
classmethod proprietary_code_tarball()[source]
classmethod sim_files_to_run_dir(data, run_dir)[source]

Copy files from sim repo dir to run_dir

Calls sim_file_basenames to get list of sim files.

Parameters:
  • data (PKDict) – used to identify simulation

  • run_dir (py.path) – directory to write to

sirepo.sim_data.genesis module

simulation data operations

copyright:

Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.genesis.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.hellweg module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.hellweg.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'colorMap', 'notes'})
classmethod fixup_old_data(data, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.impactt module

simulation data operations :copyright: Copyright (c) 2024 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.impactt.SimData[source]

Bases: LatticeSimData

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod get_distgen_file(data, require_exists=False)[source]
classmethod get_distribution_file(data, require_exists=False)[source]

sirepo.sim_data.impactx module

simulation data operations :copyright: Copyright (c) 2024 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.impactx.SimData[source]

Bases: LatticeSimData

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.jspec module

sirepo.sim_data.jupyterhublogin module

simulation data operations

copyright:

Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.jupyterhublogin.SimData[source]

Bases: SimDataBase

sirepo.sim_data.lattice module

Common simulation data operations for lattice apps :copyright: Copyright (c) 2025 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.lattice.LatticeSimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.madx module

simulation data operations

copyright:

Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.madx.SimData[source]

Bases: LatticeSimData

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.myapp module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.myapp.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod sim_type()

sirepo.sim_data.omega module

simulation data operations

copyright:

Copyright (c) 2023 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.omega.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.opal module

opal simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.opal.SimData[source]

Bases: LatticeSimData

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.openmc module

simulation data operations

copyright:

Copyright (c) 202 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.openmc.SimData[source]

Bases: SimDataBase

INPUT_DAGMC = 'DAGMC'
INPUT_MCNP = 'MCNP'
INPUT_STEP = 'STEP'
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod get_geometry_input_filenames(data)[source]

Get the dagmc and possibly STEP or MCNP filenames

Parameters:

data (PKDict) – simulation data

Returns:

Tuple of the dagmc filename. And either the

Return type:

(str, str|None)

original STEP or MCNP file the dagmc was generated from or None if the dagmc wasn’t generated from an intermediate file.

classmethod get_input_file_type(filename)[source]
classmethod materials_filename(data)[source]
classmethod source_filenames(data)[source]

sirepo.sim_data.radia module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.radia.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'alpha', 'bgColor', 'color', 'colorMap', 'name', 'notes', 'scaling'})
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod prepare_import_file_args(req)[source]
classmethod sim_files_to_run_dir(data, run_dir, post_init=False)[source]

Copy files from sim repo dir to run_dir

Calls sim_file_basenames to get list of sim files.

Parameters:
  • data (PKDict) – used to identify simulation

  • run_dir (py.path) – directory to write to

sirepo.sim_data.raydata module

simulation data operations

copyright:

Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.raydata.SimData[source]

Bases: SimDataBase

classmethod does_api_reply_with_file(api, method)[source]

Identify which job_api calls expect files

Parameters:
  • api (str) – job_api method, e.g. api_statelessCompute

  • method (str) – template sub-method of api, e.g. sample_preview

Returns:

True if method can return a file

Return type:

bool

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.shadow module

sirepo.sim_data.silas module

SILAS simulation data operations

copyright:

Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.silas.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'colorMap'})
SOURCE_REPORTS = frozenset({'laserPulse2Animation', 'laserPulseAnimation'})
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.srw module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.srw.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'aspectRatio', 'colorMap', 'copyCharacteristic', 'horizontalOffset', 'horizontalSize', 'intensityPlotsWidth', 'maxIntensityLimit', 'minIntensityLimit', 'notes', 'plotAxisX', 'plotAxisY', 'plotAxisY2', 'plotScale', 'rotateAngle', 'rotateReshape', 'showPlotSize', 'useIntensityLimits', 'usePlotRange', 'verticalOffset', 'verticalSize'})
EXPORT_RSOPT = 'exportRsOpt'
ML_OUTPUT = 'results.h5'
ML_REPORT = 'machineLearningAnimation'
SRW_FILE_TYPE_EXTENSIONS = {'arbitraryField': ['dat', 'txt'], 'mirror': ['dat', 'txt'], 'multiElectronAnimation-coherentModesFile': ['h5'], 'sample': ['tif', 'tiff', 'png', 'bmp', 'gif', 'jpg', 'jpeg'], 'undulatorTable': ['zip']}
SRW_RUN_ALL_MODEL = 'simulation'
classmethod does_api_reply_with_file(api, method)[source]

Identify which job_api calls expect files

Parameters:
  • api (str) – job_api method, e.g. api_statelessCompute

  • method (str) – template sub-method of api, e.g. sample_preview

Returns:

True if method can return a file

Return type:

bool

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Fixup data to match the most recent schema.

classmethod is_for_ml(report)[source]
classmethod is_for_rsopt(report)[source]
classmethod is_run_mpi(data)[source]
classmethod lib_file_name_with_type(filename, file_type)[source]
classmethod lib_file_name_without_type(filename)[source]

Strip the file type prefix

See lib_file_name which prefixes with model-field.

Parameters:

basename – lib file name with type

Returns:

basename without type prefix

Return type:

str

classmethod lib_file_names_for_type(file_type, qcall=None)[source]

Return sorted list of files which match file_type

Parameters:

file_type (str) – in the format of model-field

Returns:

sorted list of file names stripped of file_type

Return type:

list

classmethod sim_type()
classmethod srw_compute_crystal_grazing_angle(model)[source]
classmethod srw_find_closest_angle(angle, allowed_angles)[source]

Find closest string value from the input list to the specified angle (in radians).

classmethod srw_format_float(v)[source]
classmethod srw_is_arbitrary_source(sim)[source]
classmethod srw_is_background_report(report)[source]
classmethod srw_is_beamline_report(report)[source]
classmethod srw_is_dipole_source(sim)[source]
classmethod srw_is_gaussian_source(sim)[source]
classmethod srw_is_idealized_undulator(source_type, undulator_type)[source]
classmethod srw_is_tabulated_undulator_source(sim)[source]
classmethod srw_is_tabulated_undulator_with_magnetic_file(source_type, undulator_type)[source]
classmethod srw_is_undulator_source(sim)[source]
classmethod srw_is_user_defined_model(model)[source]
classmethod srw_is_valid_file(file_type, path)[source]
classmethod srw_is_valid_file_type(file_type, path)[source]
classmethod srw_lib_file_paths_for_type(file_type, op, want_user_lib_dir, qcall=None)[source]

Search for files of type

classmethod srw_uses_tabulated_zipfile(data)[source]
classmethod want_browser_frame_cache(report)[source]

sirepo.sim_data.warppba module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.warppba.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'colorMap', 'notes'})
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

sirepo.sim_data.warpvnd module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.warpvnd.SimData[source]

Bases: SimDataBase

ANALYSIS_ONLY_FIELDS = frozenset({'axes', 'color', 'colorMap', 'impactColorMap', 'notes', 'slice'})
classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation

classmethod warpvnd_is_3d(data)[source]

sirepo.sim_data.zgoubi module

simulation data operations

copyright:

Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.

license:

http://www.apache.org/licenses/LICENSE-2.0.html

class sirepo.sim_data.zgoubi.SimData[source]

Bases: SimDataBase

classmethod fixup_old_data(data, qcall, **kwargs)[source]

Update model data to latest schema

Modifies data in place.

Parameters:

data (dict) – simulation