espei.tests package¶
Submodules¶
espei.tests.fixtures module¶
Fixtures for use in tests
espei.tests.test_core_utils module¶
-
espei.tests.test_core_utils.
test_get_data_for_a_minimal_example
()¶ Given a dataset and the congfiguration pertaining to that dataset, we should find the values.
-
espei.tests.test_core_utils.
test_recursive_map
()¶ Test that recursive map function works
espei.tests.test_datasets module¶
-
espei.tests.test_datasets.
test_check_datasets_raises_on_misaligned_data
()¶ Passed datasets that have misaligned data and conditions should raise DatasetError.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_incorrect_components
()¶ Passed datasets that have incorrect components entered vs. used should raise.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_incorrect_zpf_phases
()¶ Passed datasets that have incorrect phases entered than used should raise.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_malformed_sublattice_configurations
()¶ Passed datasets that have malformed ZPF values should raise.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_malformed_zpf
()¶ Passed datasets that have malformed ZPF values should raise.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_unsorted_interactions
()¶ Passed datasets that have sublattice interactions not in sorted order should raise.
-
espei.tests.test_datasets.
test_check_datasets_raises_with_zpf_fractions_greater_than_one
()¶ Passed datasets that have mole fractions greater than one should raise.
-
espei.tests.test_datasets.
test_check_datasets_run_on_good_data
()¶ Passed valid datasets that should raise DatasetError.
-
espei.tests.test_datasets.
test_check_datasets_works_on_activity_data
()¶ Passed activity datasets should work correctly.
-
espei.tests.test_datasets.
test_datasets_convert_thermochemical_string_values_producing_correct_value
(datasets_db)¶ Strings where floats are expected should give correct answers for thermochemical datasets
-
espei.tests.test_datasets.
test_datasets_convert_zpf_string_values_producing_correct_value
(datasets_db)¶ Strings where floats are expected should give correct answers for ZPF datasets
espei.tests.test_error_functions module¶
Test different error functions as isolated units.
-
espei.tests.test_error_functions.
test_activity_error
(datasets_db)¶ Test that activity error returns a correct result
-
espei.tests.test_error_functions.
test_thermochemical_error_for_mixing_entropy_error_is_excess_only
(datasets_db)¶ Tests that error in mixing entropy data is excess only (the ideal part is removed).
-
espei.tests.test_error_functions.
test_thermochemical_error_for_of_enthalpy_mixing
(datasets_db)¶ Tests that error in mixing entropy data is excess only (the ideal part is removed).
-
espei.tests.test_error_functions.
test_thermochemical_error_with_multiple_T_X_points
(datasets_db)¶ Multiple temperature and composition datapoints in a dataset for a mixing phase should be successful.
-
espei.tests.test_error_functions.
test_thermochemical_error_with_multiple_T_points
(datasets_db)¶ Multiple temperature datapoints in a dataset for a stoichiometric comnpound should be successful.
-
espei.tests.test_error_functions.
test_thermochemical_error_with_multiple_X_points
(datasets_db)¶ Multiple composition datapoints in a dataset for a mixing phase should be successful.
-
espei.tests.test_error_functions.
test_zpf_error_zero
(datasets_db)¶ Test that sum of square ZPF errors returns 0 for an exactly correct result
espei.tests.test_mcmc module¶
-
espei.tests.test_mcmc.
test_lnprob_calculates_multi_phase_probability_for_success
(datasets_db)¶ lnprob() successfully calculates the probability for equilibrium
-
espei.tests.test_mcmc.
test_lnprob_calculates_single_phase_probability_for_success
(datasets_db)¶ lnprob() succesfully calculates the probability from single phase data
-
espei.tests.test_mcmc.
test_parameter_initialization
()¶ Determinisitically generated parameters should match.
espei.tests.test_parameter_generation module¶
The test_parameter_generation module tests that parameter selection is correct
-
espei.tests.test_parameter_generation.
test_mixing_data_is_excess_only
(datasets_db)¶ Tests that given an entropy of mixing datapoint of 0, no excess parameters are fit (meaning datasets do not include ideal mixing).
-
espei.tests.test_parameter_generation.
test_mixing_energies_are_fit
(datasets_db)¶ Tests that given mixing energy data, the excess parameter is fit.
-
espei.tests.test_parameter_generation.
test_multi_sublattice_mixing_energies_are_fit
(datasets_db)¶ Tests the correct excess parameter is fit for phases with multiple sublattices with vacancies.
-
espei.tests.test_parameter_generation.
test_sgte_reference_state_naming_is_correct_for_character_element
(datasets_db)¶ Elements with single character names should get the correct GHSER reference state name (V => GHSERVV)
espei.tests.test_plotting module¶
espei.tests.test_schema module¶
Tests for input file validation
-
espei.tests.test_schema.
test_SR2016_refdata
()¶
-
espei.tests.test_schema.
test_chains_per_parameter_read_correctly
()¶ The chains per parameter option should take effect when passed.
-
espei.tests.test_schema.
test_correct_defaults_are_applied_from_minimal_specification
()¶ A minimal run should generate several default settings for i/o and optional settings.
-
espei.tests.test_schema.
test_input_yaml_invalid_for_mcmc_when_input_is_overspecified
()¶ An MCMC run must get input from only generate_parameters or an input tdb (w/ or w/o a restart).
-
espei.tests.test_schema.
test_input_yaml_invalid_for_mcmc_when_input_not_defined
()¶ An MCMC run must get input from generate_parameters, an input tdb, or a restart and input tdb.
-
espei.tests.test_schema.
test_input_yaml_valid_for_full_run
()¶ A minimal full run input file should validate
-
espei.tests.test_schema.
test_input_yaml_valid_for_generate_parameters_only
()¶ A minimal generate parameters only input file should validate
-
espei.tests.test_schema.
test_input_yaml_valid_for_mcmc_from_restart
()¶ A minimal mcmc run from a restart should validate
-
espei.tests.test_schema.
test_input_yaml_valid_for_mcmc_from_tdb
()¶ A minimal mcmc run from tdb input file should validate
espei.tests.test_utils module¶
Test espei.utils classes and functions.
-
espei.tests.test_utils.
test_adding_bibtex_entries_to_bibliography_db
(datasets_db)¶ Adding a BibTeX entries to a database works and the database can be searched.
-
espei.tests.test_utils.
test_bib_marker_map
()¶ bib_marker_map should return a proper dict
-
espei.tests.test_utils.
test_flexible_open_string_file_like
(tmp_file)¶ File-like objects support read methods should have their content returned by flexible_open_string.
-
espei.tests.test_utils.
test_flexible_open_string_path_like
(tmp_file)¶ Path-like strings should be opened, read and returned
-
espei.tests.test_utils.
test_flexible_open_string_raw_string
()¶ Raw multiline strings should be directly returned by flexible_open_string.
-
espei.tests.test_utils.
test_immediate_client_returns_map_results_directly
()¶ Calls ImmediateClient.map should return the results, instead of Futures.
-
espei.tests.test_utils.
test_pickelable_tinydb_can_be_pickled_and_unpickled
()¶ PickleableTinyDB should be able to be pickled and unpickled.
-
espei.tests.test_utils.
test_sympy_build_functions_can_be_cloudpickled
()¶ Wrapped, compiled code from build_functions should be pickleable by cloudpickle
espei.tests.testing_data module¶
Databases and datasets used in common tests