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 and simu.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.process_xrange(xr_raw_string)[source]

Make dict of atom fraction ranges from input string.

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.make_BC_dict(di, var)[source]

Convert raw BC input into BC dict.

para_io.check_num_out(di)[source]

Make sure num_out is greater than 2 if present.

para_io.check_time_multiplier_config(di)[source]

Make sure input related to time multipliers is consistent.

para_io.check_sink_config(di)[source]

Make sure input related to sink strength is consistent.

para_io.compact(s)[source]

Remove empty lines and commented entries in input string.

para_io.input_string_to_dict(s)[source]

Convert input string into a dictionary.

para_io.make_valid_entries()[source]

List all recognized parameters for user input file.

para_io.check_valid_entries(di)[source]

Make sure all entries in input dict are valid.

para_io.check_required_entries(di)[source]

Make sure all required entries are present in dict.

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.