aesp.func package#
Submodules#
aesp.func.args_setup module#
- aesp.func.args_setup.args_setup()#
aesp.func.database module#
- class aesp.func.database.DataConnection(db_file_name)#
Bases:
object
Class that handles all database communication.
All data communication is collected in this class in order to make a decoupling of the data representation and the GA method.
A new candidate must be added with one of the functions add_unrelaxed_candidate or add_relaxed_candidate this will correctly initialize a configuration id used to keep track of candidates in the database. After one of the add_*_candidate functions have been used, if the candidate is further modified or relaxed the functions add_unrelaxed_step or add_relaxed_step must be used. This way the configuration id carries through correctly.
Parameters:
db_file_name: Path to the ase.db data file.
- add_relaxed_stage(candidate, **kwargs)#
- add_unrelaxed_candidate(candidate, **kwargs)#
Adds a new candidate which needs to be relaxed.
- get_atoms(id, add_info=True)#
Return the atoms object with the specified id
- get_candidates(value='all', **kwargs)#
Return all unrelaxed candidates, useful if they can all be evaluated quickly.
- get_diversity(**kwargs)#
种群的多样性
- get_energy_base_operator(oper_type_list, **kwargs)#
- get_max_continuous_opt_num(population)#
- get_max_generation()#
- get_max_stage(generation)#
- get_next_id()#
Get the id of the next candidate to be added to the database. This is a hacky way of obtaining the id and it only works on a sqlite database.
- get_next_s_id()#
获得下一个s_id
- get_number_of_candidates(**kwargs)#
Returns the number of candidates not yet queued or relaxed.
- get_param(parameter)#
Get a parameter saved when creating the database.
- get_participation_in_pairing()#
Get information about how many direct offsprings each candidate has, and which specific pairings have been made. This information is used for the extended fitness calculation described in L.B. Vilhelmsen et al., JACS, 2012, 134 (30), pp 12807-12816
- is_duplicate(**kwargs)#
Check if the key-value pair is already present in the database
- update_population(generation, pop_size)#
aesp.func.entrypoint_func module#
- aesp.func.entrypoint_func.change_logger()#
- aesp.func.entrypoint_func.config_check(config)#
- aesp.func.entrypoint_func.get_last_step(wf)#
- aesp.func.entrypoint_func.get_step_dict(wf)#
- aesp.func.entrypoint_func.get_step_list(step_dict)#
- aesp.func.entrypoint_func.global_config_workflow(wf_config)#
- aesp.func.entrypoint_func.normalize(data)#
- aesp.func.entrypoint_func.print_citation()#
- aesp.func.entrypoint_func.print_logo()#
- aesp.func.entrypoint_func.write_input(config, config_name)#
aesp.func.population module#
- class aesp.func.population.Population(pop_list)#
Bases:
object
Population class which maintains the current population and proposes which candidates to pair together.
Parameters:
- data_connection: DataConnection object
Bla bla bla.
- population_size: int
The number of candidates in the population.
- comparator: Comparator object
this will tell if two configurations are equal. Default compare atoms objects directly.
- logfile: str
Text file that contains information about the population The format is:
timestamp: generation(if available): id1,id2,id3...
Using this file greatly speeds up convergence checks. Default None meaning that no file is written.
- use_extinct: boolean
Set this to True if mass extinction and the extinct key are going to be used. Default is False.
- rng: Random number generator
By default numpy.random.
- get_candidates(size=1)#
Returns two candidates for pairing employing the fitness criteria from L.B. Vilhelmsen et al., JACS, 2012, 134 (30), pp 12807-12816 and the roulete wheel selection scheme described in R.L. Johnston Dalton Transactions, Vol. 22, No. 22. (2003), pp. 4193-4207
- get_diversity(comp)#
种群的多样性
- aesp.func.population.count_looks_like(a, all_cand, comp)#
Utility method for counting occurrences.
aesp.func.scheduler module#
- class aesp.func.scheduler.DPScheduler(max_generation, max_stage, fatal_at_max)#
Bases:
STScheduler
- next_stage(stage_complete)#
- property s_converged#