airsspy.search#
Reusable helpers for AIRSS search workflows.
Module Contents#
Classes#
Options for sampling buildcell |
|
Precomputed state for formula sampling. |
|
Options for pruning relaxed RSS candidates before final output. |
|
A relaxed structure considered for pruning. |
Functions#
Return pymatgen’s canonical reduced formula string. |
|
Inject |
|
Build a formula sampling context from user options. |
|
Return a callable that rewrites seed text for one sampled formula. |
|
Parse |
|
Parse |
|
Validate pruning options and return options for convenient chaining. |
|
Return mean and median energy-per-atom statistics for a candidate pool. |
|
Return |
|
Select low-energy unique candidates and return |
|
Return the candidates kept after post-relax pruning. |
|
Create a pruning candidate from an AIRSS |
Data#
API#
- airsspy.search.DEFAULT_FORMULA_REMOVE_DIRECTIVES#
(‘NATOM’, ‘SPECIES’, ‘FORMULA’, ‘VARVOL’, ‘TARGVOL’)
- class airsspy.search.FormulaSamplingOptions[source]#
Options for sampling buildcell
#FORMULAdirectives.- formulas: collections.abc.Sequence[str]#
()
- elements: collections.abc.Sequence[str]#
()
- oxidation_states: dict[str, collections.abc.Sequence[int]]#
‘field(…)’
- remove_directives: collections.abc.Sequence[str]#
None
- class airsspy.search.RssPruneOptions[source]#
Options for pruning relaxed RSS candidates before final output.
- class airsspy.search.RssCandidate[source]#
A relaxed structure considered for pruning.
- res_path: pathlib.Path | None#
None
- record: airsspy.ranking.StructureRecord | None#
None
- airsspy.search.canonicalize_formula(formula: str) str[source]#
Return pymatgen’s canonical reduced formula string.
- airsspy.search.inject_formula_directive(seed_text: str, formula: str, varvol: float | None = None, remove_directives: collections.abc.Sequence[str] = DEFAULT_FORMULA_REMOVE_DIRECTIVES) str[source]#
Inject
#FORMULAand optional#VARVOLdirectives into seed text.
- airsspy.search.build_formula_sampling_context(options: airsspy.search.FormulaSamplingOptions, seed_text: str | None = None) airsspy.search.FormulaSamplingContext[source]#
Build a formula sampling context from user options.
- airsspy.search.make_seed_text_transform(context: airsspy.search.FormulaSamplingContext, rng: random.Random | None = None) collections.abc.Callable[[str], str][source]#
Return a callable that rewrites seed text for one sampled formula.
- airsspy.search.parse_key_float(text: str) tuple[str, float][source]#
Parse
KEY=valueinto a string key and float value.
- airsspy.search.parse_key_ints(text: str) tuple[str, list[int]][source]#
Parse
KEY=a,binto a string key and list of integers.
- airsspy.search.validate_prune_options(options: airsspy.search.RssPruneOptions) airsspy.search.RssPruneOptions[source]#
Validate pruning options and return options for convenient chaining.
- airsspy.search.pool_statistics(candidates: collections.abc.Sequence[airsspy.search.RssCandidate]) dict[str, float][source]#
Return mean and median energy-per-atom statistics for a candidate pool.
- airsspy.search.should_flush_prune_pool(candidates: collections.abc.Sequence[airsspy.search.RssCandidate], stats_history: collections.abc.Sequence[dict[str, float]], options: airsspy.search.RssPruneOptions) tuple[str, bool][source]#
Return
(reason, should_flush)for a pruning pool.
- airsspy.search.select_pruned_candidates(candidates: collections.abc.Sequence[airsspy.search.RssCandidate], options: airsspy.search.RssPruneOptions, remaining: int | None = None) tuple[list[airsspy.search.RssCandidate], list[airsspy.search.RssCandidate]][source]#
Select low-energy unique candidates and return
(kept, rejected).
- airsspy.search.prune_relaxed_pool(candidates: collections.abc.Sequence[airsspy.search.RssCandidate], options: airsspy.search.RssPruneOptions, remaining: int | None = None) list[airsspy.search.RssCandidate][source]#
Return the candidates kept after post-relax pruning.
- airsspy.search.candidate_from_res(path: str | pathlib.Path) airsspy.search.RssCandidate[source]#
Create a pruning candidate from an AIRSS
.resfile.