allomorph.constants =================== .. py:module:: allomorph.constants Attributes ---------- .. autoapisummary:: allomorph.constants.LMP_DATA_DIR allomorph.constants.MNP_DIR allomorph.constants.BNP_DIR allomorph.constants.TNP_DIR allomorph.constants.CS_DIR allomorph.constants.GOLDEN_RATIO allomorph.constants.VACUUM_THICKNESS allomorph.constants.RANDOM_DISTRIB_NO allomorph.constants.ELE_DICT allomorph.constants.DIAMETER_LIST allomorph.constants.SHAPE_LIST allomorph.constants.BNP_DISTRIB_LIST allomorph.constants.TNP_DISTRIB_LIST allomorph.constants.RATIO_LIST allomorph.constants.CUSTOM_SHAPES Functions --------- .. autoapisummary:: allomorph.constants.update_constants allomorph.constants.load_config allomorph.constants.validate_ele_dict allomorph.constants.load_ele_dict_from_file allomorph.constants.dist_1d allomorph.constants.dist_3d allomorph.constants.calc_rcs_prob allomorph.constants.parse_ele_comb Module Contents --------------- .. py:data:: LMP_DATA_DIR :value: '.' .. py:data:: MNP_DIR :value: 'MNP' .. py:data:: BNP_DIR :value: 'BNP' .. py:data:: TNP_DIR :value: 'TNP' .. py:data:: CS_DIR :value: 'CS' .. py:data:: GOLDEN_RATIO .. py:data:: VACUUM_THICKNESS :value: 40.0 .. py:data:: RANDOM_DISTRIB_NO :value: 3 .. py:data:: ELE_DICT .. py:data:: DIAMETER_LIST :value: [10, 15, 20] .. py:data:: SHAPE_LIST :value: ['OT', 'SP', 'IC', 'CU', 'DH', 'TH', 'RD', 'TO', 'CO'] .. py:data:: BNP_DISTRIB_LIST :value: ['L10', 'RAL', 'RCS'] .. py:data:: TNP_DISTRIB_LIST :value: ['L10R', 'CS', 'CL10S', 'CRALS', 'RRAL', 'CSRAL', 'CSL10', 'CRSR', 'LL10'] .. py:data:: RATIO_LIST :value: [20, 40] .. py:data:: CUSTOM_SHAPES .. py:function:: update_constants(config) Update global constants from a dictionary. :param config: Dictionary containing constant names and their new values. .. py:function:: load_config(path) Load configuration from a JSON, YAML, or TOML file. :param path: Path to the configuration file. :returns: The loaded configuration dictionary. .. py:function:: validate_ele_dict(ele_dict) Validate a user-supplied element dictionary. :param ele_dict: Dictionary mapping element symbols to property dicts. :returns: The validated dictionary. :raises ValueError: If required keys are missing or invalid. .. py:function:: load_ele_dict_from_file(path) Load an element dictionary from a JSON file. :param path: Path to a JSON file containing the element dictionary. :returns: Validated element dictionary. .. py:function:: dist_1d(coord1, coord2, dim) Compute distance between 2 points in one of their real space coordinates. .. py:function:: dist_3d(coord1, coord2) Compute real space distance between 2 points. .. py:function:: calc_rcs_prob(obj, shape) Compute the core-shell probability for each atom in *obj*. Returns a list where higher values correspond to surface-like positions. :param obj: ASE Atoms object. :param shape: Nanoparticle shape string (e.g. 'IC', 'DH', 'OT'). :returns: List of probabilities, one per atom. .. py:function:: parse_ele_comb(ele_comb, ele_dict=None) Parse a concatenated element combination string into individual symbols. :param ele_comb: String like 'AuPtPd' or 'CuAgAu'. :param ele_dict: Optional element dictionary to use for matching. If None, the built-in ELE_DICT is used. :returns: List of element symbols, e.g. ['Au', 'Pt', 'Pd']. :raises ValueError: If the string cannot be parsed.