para_io
Parse the input file that defines the system and various options.
- para_io.read_log_string(s)[source]
Read the log created by a diffusion simulation.
- Parameters:
s (str) – Simulation log.
- Returns:
di – Parameters and options defining the simulation.
- Return type:
dict
- para_io.scrap_simu_attributes()[source]
Generate list of valid attributes.
Get list of all attributes of
alloy_system.AlloySystem
andsimu.Simulation
.
- para_io.find_parameter_name(ref_name, di)[source]
Find key used for the parameter ref_name in the input dict.
For some parameters in the user input file, there exists one prefered name and one or more aliases. This function recognizes the name used as an alias of the reference name as key of the input dictionary and returns it. This was implemented for backward compatibility reasons (aliases are former parameter names).
- Parameters:
ref_name (str) – Reference name of the parameter.
di (dict) – Input parameters.
- Raises:
Exception – If input dict contains two or more keys that correspond to the same parameter.
- Returns:
par_name – Key used for the parameter in the input dict.
- Return type:
str
- para_io.handle_aliases(di, logger)[source]
Replace aliases by their prefered equivalent name.
Use
find_parameter_name()
to find all possible aliases in input dict, and then replace them by the prefered parameter name.
- para_io.handle_phase_aliases(phase, logger)[source]
Replace phase alias by the prefered phase name.
Main purpose is backward compatibility.
- para_io.get_independent_constituents(inds_raw)[source]
Make list of independent constituents from string.
- para_io.preprocess_initial_profile(profile_string)[source]
Separate initial profile input into keyword and option.
- para_io.check_profile_config(di, var)[source]
Make sure input related to initial profile of var is consistent.
- para_io.process_x_profile(x_string)[source]
Make dict of atom fractions from initial condition input string.
- para_io.process_var_profile(var_string, side)[source]
Make dict of var values from initial condition input string.
- para_io.make_BC_type(di, side)[source]
Guess BC type from input dict and make sure input is consistent.
- para_io.check_time_multiplier_config(di)[source]
Make sure input related to time multipliers is consistent.
- para_io.read_parameter_string(s, logger)[source]
Parse input file to get set of parameters.
In the file, parameter names and values must be separated by ‘=’. Commented lines (#) and blank lines are ignored. Blank spaces around ‘=’ delimiters are ignored. Blank spaces in future dictionaries (x_left, x_right) are ignored. See
simu.System
for role of parameters.- Parameters:
s (str) – Input file given as str.
- Returns:
compacted_string (str) – Input string without unnecessary lines.
di (dict) – Set of parameters that define a system, simulation conditions and various options.