def test_check_datasets_raises_with_incorrect_components(): """Passed datasets that have incorrect components entered vs. used should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_single_incorrect_components_overspecified) with pytest.raises(DatasetError): check_dataset(dataset_single_incorrect_components_underspecified) with pytest.raises(DatasetError): check_dataset(dataset_multi_incorrect_components_overspecified) with pytest.raises(DatasetError): check_dataset(dataset_multi_incorrect_components_underspecified)
def test_check_datasets_raises_with_malformed_zpf(): """Passed datasets that have malformed ZPF values should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_multi_malformed_zpfs_components_not_list) with pytest.raises(DatasetError): check_dataset(dataset_multi_malformed_zpfs_fractions_do_not_match_components) with pytest.raises(DatasetError): check_dataset(dataset_multi_malformed_zpfs_components_do_not_match_fractions)
def test_non_equilibrium_thermo_data_with_species_passes_checker(): """Non-equilibrium thermochemical data that use species in the configurations should pass the dataset checker. """ check_dataset(LI_SN_LIQUID_DATA)
def test_check_datasets_raises_if_configs_occupancies_not_aligned(datasets_db): """Checking datasets that don't have the same number/shape of configurations/occupancies should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_mismatched_configs_occupancies)
def test_check_datasets_raises_with_unsorted_interactions(): """Passed datasets that have sublattice interactions not in sorted order should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_single_unsorted_interaction)
def test_check_datasets_raises_with_zpf_fractions_greater_than_one(): """Passed datasets that have mole fractions greater than one should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_multi_mole_fractions_as_percents)
def test_check_datasets_works_on_activity_data(): """Passed activity datasets should work correctly.""" check_dataset(CU_MG_EXP_ACTIVITY)
def test_check_datasets_raises_with_malformed_sublattice_configurations(): """Passed datasets that have malformed ZPF values should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_single_malformed_site_occupancies) with pytest.raises(DatasetError): check_dataset(dataset_single_malformed_site_ratios)
def test_check_datasets_raises_with_incorrect_zpf_phases(): """Passed datasets that have incorrect phases entered than used should raise.""" with pytest.raises(DatasetError): check_dataset(dataset_multi_incorrect_phases)
def test_check_datasets_raises_on_misaligned_data(): """Passed datasets that have misaligned data and conditions should raise DatasetError.""" with pytest.raises(DatasetError): check_dataset(dataset_single_misaligned) with pytest.raises(DatasetError): check_dataset(dataset_multi_misaligned)
def test_check_datasets_run_on_good_data(): """Passed valid datasets that should raise DatasetError.""" check_dataset(dataset_single_valid) check_dataset(dataset_multi_valid) check_dataset(dataset_multi_valid_ternary)