Simulation Module#
- class nexus.simulation.SimulationInput[source]#
Bases:
NexusCore- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
incorporate_system
is_valid
items
keys
leave
load
read
read_file_text
read_text
return_structure
return_system
update
values
warn
write
write_file_text
write_text
- class nexus.simulation.SimulationAnalyzer(sim)[source]#
Bases:
NexusCore- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])analyze
clear
error
items
keys
leave
load
update
values
warn
- class nexus.simulation.SimulationEmulator[source]#
Bases:
NexusCore- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
items
keys
leave
load
run
update
values
warn
- class nexus.simulation.SimulationImage[source]#
Bases:
NexusCore- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
items
keys
leave
load
load_image
save_image
update
values
warn
- save_only_fields = frozenset({'block', 'block_subcascade', 'imlocdir', 'imremdir', 'imresdir', 'locdir', 'remdir', 'resdir'})#
- load_fields = frozenset({'analyzed', 'analyzer_image', 'app_name', 'app_props', 'errfile', 'failed', 'files', 'finished', 'got_output', 'identifier', 'image_dir', 'infile', 'input_image', 'outfile', 'outputs', 'path', 'process_id', 'sent_files', 'setup', 'sim_image', 'subcascade_finished', 'submitted', 'timestamps'})#
- save_fields = frozenset({'analyzed', 'analyzer_image', 'app_name', 'app_props', 'block', 'block_subcascade', 'errfile', 'failed', 'files', 'finished', 'got_output', 'identifier', 'image_dir', 'imlocdir', 'imremdir', 'imresdir', 'infile', 'input_image', 'locdir', 'outfile', 'outputs', 'path', 'process_id', 'remdir', 'resdir', 'sent_files', 'setup', 'sim_image', 'subcascade_finished', 'submitted', 'timestamps'})#
- class nexus.simulation.Simulation(*, job: Job, identifier: str | None = None, path: PathLike = '', infile: PathLike | None = None, outfile: PathLike | None = None, errfile: PathLike | None = None, nexus_logfile: PathLike | None = None, imagefile: PathLike | None = None, input: SimulationInput | None = None, files: Collection[PathLike] | None = None, dependencies: tuple[Simulation, str] | list[tuple[Simulation, str]] | None = None, analysis_request: QmcpackAnalysisRequest | None = None, block: bool = False, block_subcascade: bool = False, app_name: str | PathLike | None = None, app_props: Collection[str] | None = None, system: PhysicalSystem | None = None, skip_submit: bool | None = None, force_write: bool = False, simlabel: str | None = None, fake_sim: bool | None = None, restartable: bool = False, force_restart: bool = False)[source]#
Bases:
NexusCore- Attributes:
- working_directory
Methods
acquire_dependents(sim)copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])separate_inputs(kwargs[, overlapping_kw, sim_kw])traverse_full_cascade(operation, *args, **kwargs)active
analyze
analyzer_type
app_command
attempt_files
block_dependents
check_dependencies
check_result
check_sim_status
check_status
check_subcascade
clear
clear_all_sims
code_name
completed
condense_name
copy_file
create_directories
depends
downstream_simids
errfile_text
error
execute
fake
fill_produces
fill_products
get_dependencies
get_output
get_output_files
get_result
has_generic_input
idstr
incorporate_result
init_job
init_job_extra
input_type
items
keys
leave
load
load_analyzer_image
load_image
outfile_text
post_analyze
post_init
post_submit
pre_check_status
pre_create_directories
pre_init
pre_send_files
pre_write_inputs
progress
propagate_identifier
ready
reconstruct_cascade
record_timestamp
reset_indicators
reset_wait_ids
save_analyzer_image
save_attempt
save_image
send_files
set_app_name
set_directories
show_input
submit
traverse_cascade
undo_depends
update
update_process_id
values
warn
write_dependents
write_inputs
write_prep
- input_type#
alias of
SimulationInput
- analyzer_type#
alias of
SimulationAnalyzer
- generic_identifier = 'sim'#
- infile_extension = '.in'#
- outfile_extension = '.out'#
- errfile_extension = '.err'#
- application = 'simapp'#
- application_properties = frozenset({'serial'})#
- application_results = frozenset({})#
- allow_overlapping_files = False#
- sim_imagefile = 'sim.p'#
- input_imagefile = 'input.p'#
- analyzer_imagefile = 'analyzer.p'#
- image_directory = 'sim'#
- supports_restarts = False#
- renew_app_command = False#
- is_bundle = False#
- sim_count = 0#
- creating_fake_sims = False#
- classmethod separate_inputs(kwargs: Mapping, overlapping_kw: set[str] | None = frozenset({'system'}), sim_kw: Collection[str] | None = None) tuple[obj, obj][source]#
- allowed_inputs = frozenset({'analysis_request', 'app_name', 'app_props', 'block', 'block_subcascade', 'dependencies', 'errfile', 'fake_sim', 'files', 'force_restart', 'force_write', 'identifier', 'imagefile', 'infile', 'input', 'job', 'nexus_logfile', 'outfile', 'path', 'restartable', 'simlabel', 'skip_submit', 'system'})#
- class nexus.simulation.NullSimulationInput[source]#
Bases:
SimulationInput- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
incorporate_system
is_valid
items
keys
leave
load
read
read_file_text
read_text
return_structure
return_system
update
values
warn
write
write_file_text
write_text
- class nexus.simulation.NullSimulationAnalyzer(sim)[source]#
Bases:
SimulationAnalyzer- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])analyze
clear
error
items
keys
leave
load
update
values
warn
- class nexus.simulation.GenericSimulation(**kwargs)[source]#
Bases:
Simulation- Attributes:
- working_directory
Methods
acquire_dependents(sim)copy()eliminate()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])separate_inputs(kwargs[, overlapping_kw, sim_kw])traverse_full_cascade(operation, *args, **kwargs)active
analyze
analyzer_type
app_command
attempt_files
block_dependents
check_dependencies
check_result
check_sim_status
check_status
check_subcascade
clear
clear_all_sims
code_name
completed
condense_name
copy_file
create_directories
depends
downstream_simids
errfile_text
error
execute
fake
fill_produces
fill_products
get_dependencies
get_output
get_output_files
get_result
has_generic_input
idstr
incorporate_result
init_job
init_job_extra
input_type
items
keys
leave
load
load_analyzer_image
load_image
outfile_text
post_analyze
post_init
post_submit
pre_check_status
pre_create_directories
pre_init
pre_send_files
pre_write_inputs
progress
propagate_identifier
ready
reconstruct_cascade
record_timestamp
reset_indicators
reset_wait_ids
save_analyzer_image
save_attempt
save_image
send_files
set_app_name
set_directories
show_input
submit
traverse_cascade
undo_depends
update
update_process_id
values
warn
write_dependents
write_inputs
write_prep
- allowed_inputs = frozenset({'analysis_request', 'app_name', 'app_props', 'block', 'block_subcascade', 'dependencies', 'errfile', 'fake_sim', 'files', 'force_restart', 'force_write', 'identifier', 'imagefile', 'infile', 'input', 'job', 'nexus_logfile', 'outfile', 'outfiles', 'path', 'restartable', 'simlabel', 'skip_submit', 'system'})#
- class nexus.simulation.SimulationInputTemplateDev(filepath=None, text=None)[source]#
Bases:
SimulationInput- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])allow_no_assign
assign
clear
error
incorporate_system
is_valid
items
keys
leave
load
preprocess
read
read_file_text
read_text
reset
return_structure
return_system
update
values
warn
write
write_file_text
write_text
- class nexus.simulation.SimulationInputMultiTemplateDev(**file_templates)[source]#
Bases:
SimulationInput- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
incorporate_system
is_valid
items
keys
leave
load
read
read_file_text
read_text
return_structure
return_system
set_templates
update
values
warn
write
write_file_text
write_text
- class nexus.simulation.SimulationInputTemplate(filepath=None, text=None)[source]#
Bases:
SimulationInputTemplateDev,GenericSimulationInput- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])allow_no_assign
assign
clear
error
incorporate_system
is_valid
items
keys
leave
load
preprocess
read
read_file_text
read_text
reset
return_structure
return_system
update
values
warn
write
write_file_text
write_text
- class nexus.simulation.SimulationInputMultiTemplate(**file_templates)[source]#
Bases:
SimulationInputMultiTemplateDev,GenericSimulationInput- Attributes:
- working_directory
Methods
copy()enter(directory, *[, changedir, msg])Have Nexus enter a directory and change its current working directory.
nxs_print(*texts[, n, progress])Write text to standard output.
save([filepath])clear
error
incorporate_system
is_valid
items
keys
leave
load
read
read_file_text
read_text
return_structure
return_system
set_templates
update
values
warn
write
write_file_text
write_text
- nexus.simulation.graph_sims(sims=None, savefile=None, *, useid=False, exit=True, quants=True, display=True)[source]#
- class nexus.simulation.DynamicProcess(dpid, sim, requires)[source]#
Bases:
DevBaseNexusEnables dynamic workflows execution
Basic DP contains a single simulation. Derived classes may perform more elaborate processes, i.e. recovery for failed jobs, resetting the primary simulation object (sim data member) to point at the final sim in the process.
Takes the place of Simulation in user scripts. All generate_* simulation functions return DP’s when executing dynamic workflows.
- Attributes:
- analyzed
- analyzer_image
- block
- charge_density
- done
- fail
- failed
- finished
- got_output
- identifier
- input
- jastrow
- job
- orbitals
- products
- pwscf_orbitals
- sent_files
- setup
- simid
- skip_submit
- structure
- submitted
- succ
- system
- wavefunction
Methods
copy()Check if all input/dependency requirements are met
save([filepath])check_first_gen
clear
error
items
keys
load
nxs_print
show_input
update
values
warn
- all_dynamic_processes#
- allowed_requirements = frozenset({'charge_density', 'jastrow', 'none', 'orbitals', 'pwscf_orbitals', 'structure', 'wavefunction'})#
- property products#
- property structure#
- property charge_density#
- property orbitals#
- property jastrow#
- property wavefunction#
- property pwscf_orbitals#
- property simid#
- property identifier#
- property job#
- property input#
- property system#
- property analyzer_image#
- property setup#
- property sent_files#
- property submitted#
- property finished#
- property got_output#
- property analyzed#
- property failed#
- property skip_submit#
- property block#
- property done#
- property succ#
- property fail#
- class nexus.simulation.sim_err_handler(sim: Simulation)[source]#
Bases:
objectContext manager for simulation-specific error handling/reporting.
- class nexus.simulation.sim_log_handler(sim: Simulation)[source]#
Bases:
objectContext manager for simulation-specific logging.