diff --git a/news/MP.rst b/news/MP.rst new file mode 100644 index 0000000..37d10c1 --- /dev/null +++ b/news/MP.rst @@ -0,0 +1,24 @@ +**Added:** + +* CifEnsemble support for ICSD, COD, MP files +* Support CCDC CIF files + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Preprocess .cif files in CifEnsemble before initializing into CIF objects + +**Security:** + +* diff --git a/src/cifkit/models/cif.py b/src/cifkit/models/cif.py index 64ad00d..e015a8f 100644 --- a/src/cifkit/models/cif.py +++ b/src/cifkit/models/cif.py @@ -1,10 +1,4 @@ -""" -Import statements placed bottom to avoid cluttering. -""" - import logging - -# Polyhedron import os # Bond pair @@ -42,18 +36,16 @@ # Coordination number from cifkit.preprocessors.environment_util import flat_site_connections -# Edit .cif file -from cifkit.preprocessors.format import preprocess_label_element_loop_values - # Supercell generation from cifkit.preprocessors.supercell import get_supercell_points from cifkit.preprocessors.supercell_util import get_cell_atom_count from cifkit.utils.bond_pair import get_bond_pairs, get_pairs_sorted_by_mendeleev -from cifkit.utils.cif_editor import add_hashtag_in_first_line, remove_author_loop + +# Edit .cif file +from cifkit.utils.cif_editor import edit_cif_file_based_on_db # Parser .cif file from cifkit.utils.cif_parser import ( - check_unique_atom_site_labels, get_cif_block, get_formula_structure_weight_s_group, get_loop_values, @@ -132,15 +124,7 @@ def _log_info(self, message): def _preprocess(self): """Preprocess each .cif file and check any error.""" self._log_info(CifLog.PREPROCESSING.value) - - if self.db_source == "ICSD": - add_hashtag_in_first_line(self.file_path) - - elif self.db_source == "PCD": - remove_author_loop(self.file_path) - - preprocess_label_element_loop_values(self.file_path) - check_unique_atom_site_labels(self.file_path) + edit_cif_file_based_on_db(self.file_path) def _load_data(self): """Load data from the .cif file and process it.""" diff --git a/src/cifkit/models/cif_ensemble.py b/src/cifkit/models/cif_ensemble.py index 67d3102..47e379e 100644 --- a/src/cifkit/models/cif_ensemble.py +++ b/src/cifkit/models/cif_ensemble.py @@ -6,8 +6,7 @@ from cifkit import Cif from cifkit.figures.histogram import plot_histogram from cifkit.preprocessors.error import move_files_based_on_errors -from cifkit.preprocessors.format import preprocess_label_element_loop_values -from cifkit.utils.cif_editor import remove_author_loop +from cifkit.utils.cif_editor import edit_cif_file_based_on_db from cifkit.utils.folder import copy_files, get_file_paths, move_files from cifkit.utils.log_messages import CifEnsembleLog @@ -30,12 +29,7 @@ def __init__( if preprocess: self._log_info(CifEnsembleLog.PREPROCESSING.value) for file_path in file_paths: - try: - remove_author_loop(file_path) - preprocess_label_element_loop_values(file_path) - except Exception as e: - print(f"Error processing {file_path}: {e}") - + edit_cif_file_based_on_db(file_path) # Move ill-formatted files after processing move_files_based_on_errors(cif_dir_path, file_paths) diff --git a/src/cifkit/utils/cif_editor.py b/src/cifkit/utils/cif_editor.py index 3e7a967..fdd8a38 100644 --- a/src/cifkit/utils/cif_editor.py +++ b/src/cifkit/utils/cif_editor.py @@ -1,7 +1,12 @@ import os +from cifkit.preprocessors.format import preprocess_label_element_loop_values from cifkit.utils import cif_parser +# Parser .cif file +from cifkit.utils.cif_parser import check_unique_atom_site_labels +from cifkit.utils.cif_sourcer import get_cif_db_source + def remove_author_loop(file_path: str) -> None: """ @@ -47,3 +52,19 @@ def add_hashtag_in_first_line(file_path: str): # Write the modified content back to the file with open(file_path, "w") as file: file.writelines(lines) + + +def edit_cif_file_based_on_db(file_path: str): + """ + Edit a CIF file based on the database it is from. + PCD: Remove author loop and preprocess label element loop values + ICSD: Add a hashtag in the first line + """ + db_source = get_cif_db_source(file_path) + if db_source == "ICSD": + add_hashtag_in_first_line(file_path) + elif db_source == "PCD": + remove_author_loop(file_path) + preprocess_label_element_loop_values(file_path) + + check_unique_atom_site_labels(file_path) diff --git a/src/cifkit/utils/cif_sourcer.py b/src/cifkit/utils/cif_sourcer.py index 5702dcd..b3f64a5 100644 --- a/src/cifkit/utils/cif_sourcer.py +++ b/src/cifkit/utils/cif_sourcer.py @@ -7,6 +7,8 @@ def get_cif_db_source(file_path): "ICSD": "_database_code_ICSD", "MS": "'Materials Studio'", "PCD": "#_database_code_PCD", + "MP": "# generated using pymatgen", + "CCDC": "# Cambridge Structural Database (CSD)", } if os.path.exists(file_path) and file_path.endswith(".cif"): diff --git a/tests/core/models/test_cif.py b/tests/core/models/test_cif.py index 5a79dcc..d210378 100644 --- a/tests/core/models/test_cif.py +++ b/tests/core/models/test_cif.py @@ -651,56 +651,44 @@ def test_init_without_mendeeleve_number(): """ -1. Test ICSD file +Test CIF various db sources """ -@pytest.mark.fast -def test_init_ICSD_file(tmpdir): - file_path = "tests/data/cif/sources/ICSD/EntryWithCollCode43054.cif" - - copied_file_path = os.path.join(tmpdir, "EntryWithCollCode43054.cif") - - shutil.copyfile(file_path, copied_file_path) - cif_ICSD = Cif(copied_file_path) - assert cif_ICSD.db_source == "ICSD" - assert cif_ICSD.unique_elements == {"Fe", "Ge"} - assert cif_ICSD.CN_unique_values_by_best_methods == {7, 13} - - -""" -2. Test MS file -""" - - -@pytest.mark.fast -def test_init_MS_file(tmpdir): - file_path = "tests/data/cif/sources/MS/U13Rh4.cif" - - copied_file_path = os.path.join(tmpdir, "U13Rh4.cif") - - shutil.copyfile(file_path, copied_file_path) - cif_MS = Cif(copied_file_path) - - assert cif_MS.db_source == "MS" - assert cif_MS.unique_elements == {"U", "Fe"} - assert cif_MS.supercell_atom_count == 2988 - - -""" -3. Test COD file -""" - - -@pytest.mark.fast -def test_init_COD_file(tmpdir): - file_path = "tests/data/cif/sources/COD/1010581.cif" - - copied_file_path = os.path.join(tmpdir, "1010581.cif") - +@pytest.mark.parametrize( + "file_path, expected_db_source, expected_elements, expected_atom_count", + [ + ( + "tests/data/cif/sources/ICSD/EntryWithCollCode43054.cif", + "ICSD", + {"Fe", "Ge"}, + 216, + ), + ("tests/data/cif/sources/MS/U13Rh4.cif", "MS", {"U", "Fe"}, 2988), + ("tests/data/cif/sources/MS/U13Rh4.cif", "MS", {"U", "Fe"}, 2988), + ("tests/data/cif/sources/COD/1010581.cif", "COD", {"Cu", "Se"}, 1383), + ("tests/data/cif/sources/CCDC/2294753.cif", "CCDC", {'Er', 'In', 'Co'}, 3844), + ( + "tests/data/cif/sources/MP/LiFeP2O7.cif", + "MP", + {"Fe", "Li", "O", "P"}, + 594, + ), + ], +) +@pytest.mark.now +def test_init_cif_file( + tmpdir, + file_path, + expected_db_source, + expected_elements, + expected_atom_count, +): + copied_file_path = os.path.join(tmpdir, os.path.basename(file_path)) shutil.copyfile(file_path, copied_file_path) - cif_COD = Cif(copied_file_path) + cif = Cif(copied_file_path) - assert cif_COD.db_source == "COD" - assert cif_COD.unique_elements == {"Cu", "Se"} - assert cif_COD.supercell_atom_count == 1383 + # Perform assertions + assert cif.db_source == expected_db_source + assert cif.unique_elements == expected_elements + assert cif.supercell_atom_count == expected_atom_count diff --git a/tests/core/models/test_cif_ensemble.py b/tests/core/models/test_cif_ensemble.py index 9b674c3..7d9d5e9 100644 --- a/tests/core/models/test_cif_ensemble.py +++ b/tests/core/models/test_cif_ensemble.py @@ -6,7 +6,7 @@ import pytest from cifkit import CifEnsemble -from cifkit.utils.folder import get_file_count, get_file_paths +from cifkit.utils.folder import copy_files, get_file_count, get_file_paths @pytest.mark.fast @@ -268,26 +268,6 @@ def test_filter_by_CN_best_methods_exact_matching( """ -# assert cif_ensemble_test.filter_by_CN_min_dist_method_exact_matching( -# [16] -# ) == { -# "tests/data/cif/ensemble_test/300169.cif", -# "tests/data/cif/ensemble_test/300170.cif", -# "tests/data/cif/ensemble_test/300171.cif", -# } - -# assert cif_ensemble_test.filter_by_CN_min_dist_method_exact_matching( -# [9, 12, 16] -# ) == { -# "tests/data/cif/ensemble_test/300171.cif", -# } - - -# """ -# Test filter by rang -# """ - - @pytest.mark.fast def test_filter_by_supercell_count(cif_ensemble_test: CifEnsemble): result = cif_ensemble_test.filter_by_supercell_count(200, 400) @@ -531,3 +511,26 @@ def test_init_without_preprocessing( with caplog.at_level(logging.INFO): assert "Preprocessing tests/data/cif/folder" not in caplog.text + + +@pytest.mark.parametrize( + "cif_folder_path, expected_file_count, expected_supercell_stats", + [ + ("tests/data/cif/sources/ICSD", 4, {216: 2, 307: 1, 320: 1}), + ("tests/data/cif/sources/COD", 2, {519: 1, 1383: 1}), + ("tests/data/cif/sources/MP", 2, {108: 1, 594: 1}), + ("tests/data/cif/sources/PCD", 1, {364: 1}), + ("tests/data/cif/sources/MS", 1, {2988: 1}), + ("tests/data/cif/sources/CCDC", 1, {3844: 1}), + ], +) +@pytest.mark.fast +def test_init_cif_files( + tmpdir, cif_folder_path, expected_file_count, expected_supercell_stats +): + cif_file_paths = get_file_paths(cif_folder_path) + copy_files(tmpdir, cif_file_paths) + ensemble = CifEnsemble(tmpdir) + + assert ensemble.file_count == expected_file_count + assert ensemble.supercell_size_stats == expected_supercell_stats diff --git a/tests/data/cif/sources/CCDC/2294753.cif b/tests/data/cif/sources/CCDC/2294753.cif new file mode 100644 index 0000000..4ab326c --- /dev/null +++ b/tests/data/cif/sources/CCDC/2294753.cif @@ -0,0 +1,284 @@ +####################################################################### +# +# This file contains crystal structure data downloaded from the +# Cambridge Structural Database (CSD) hosted by the Cambridge +# Crystallographic Data Centre (CCDC). +# +# Full information about CCDC data access policies and citation +# guidelines are available at http://www.ccdc.cam.ac.uk/access/V1 +# +# Audit and citation data items may have been added by the CCDC. +# Please retain this information to preserve the provenance of +# this file and to allow appropriate attribution of the data. +# +####################################################################### + +data_Er23Co7In20 +_audit_block_doi 10.25505/fiz.icsd.cc2h0w9q +_database_code_depnum_ccdc_archive 'CCDC 2294753' +loop_ +_citation_id +_citation_doi +_citation_year +1 10.1016/j.jallcom.2023.173241 2024 +loop_ +_audit_author_name +_audit_author_address +'Volodymyr Smetana' +;Stockholm University +Sweden +; +_audit_update_record +; +2023-11-24 deposited with the CCDC. 2024-10-27 downloaded from the CCDC. +; + +_audit_creation_method SHELXL-2019/1 +_shelx_SHELXL_version_number 2019/1 +_chemical_name_systematic ? +_chemical_name_common ? +_chemical_melting_point ? +_chemical_formula_moiety ? +_chemical_formula_sum 'Co6.71 Er23 In20.30' +_chemical_formula_weight 6573.16 + +loop_ +_atom_type_symbol +_atom_type_description +_atom_type_scat_dispersion_real +_atom_type_scat_dispersion_imag +_atom_type_scat_source +Co Co 0.3494 0.9721 'International Tables Vol C Tables 4.2.6.8 and 6.1.1.4' +In In -0.7276 1.3100 'International Tables Vol C Tables 4.2.6.8 and 6.1.1.4' +Er Er -0.2586 4.9576 'International Tables Vol C Tables 4.2.6.8 and 6.1.1.4' + +_space_group_crystal_system orthorhombic +_space_group_IT_number 55 +_space_group_name_H-M_alt 'P b a m' +_space_group_name_Hall '-P 2 2ab' + +_shelx_space_group_comment +; +The symmetry employed for this shelxl refinement is uniquely defined +by the following loop, which should always be used as a source of +symmetry information in preference to the above space-group names. +They are only intended as comments. +; + +# start Validation Reply Form +_vrf_PLAT971_Er23Co7In20 +; +PROBLEM: Check Calcd Resid. Dens. +RESPONSE: The residual electron map could not properly +be reduced due to crystal quality but is balanced. Multiple +samples were prepared and multiple crystals measured to improve +quality but without success. The model is consistent and was +confirmed by consequent Rietveld refinements. See Figure 2. +; +_vrf_PLAT972_Er23Co7In20 +; +PROBLEM: Check Calcd Resid. Dens. +RESPONSE: The residual electron map could not properly +be reduced due to crystal quality but is balanced. Multiple +samples were prepared and multiple crystals measured to improve +quality but without success. The model is consistent and was +confirmed by consequent Rietveld refinements. See Figure 2. +; +# end Validation Reply Form + +loop_ +_space_group_symop_operation_xyz +'x, y, z' +'x+1/2, -y+1/2, -z' +'-x+1/2, y+1/2, -z' +'-x, -y, z' +'-x, -y, -z' +'-x-1/2, y-1/2, z' +'x-1/2, -y-1/2, z' +'x, y, -z' + +_cell_length_a 23.203(5) +_cell_length_b 28.399(5) +_cell_length_c 3.5306(6) +_cell_angle_alpha 90 +_cell_angle_beta 90 +_cell_angle_gamma 90 +_cell_volume 2326.5(8) +_cell_formula_units_Z 2 +_cell_measurement_temperature 273(2) +_cell_measurement_reflns_used 45265 +_cell_measurement_theta_min 1.896 +_cell_measurement_theta_max 25.998 + +_exptl_crystal_description block +_exptl_crystal_colour ? +_exptl_crystal_density_meas ? +_exptl_crystal_density_method ? +_exptl_crystal_density_diffrn 9.383 +_exptl_crystal_F_000 5480 +_exptl_transmission_factor_min ? +_exptl_transmission_factor_max ? +_exptl_crystal_size_max ? +_exptl_crystal_size_mid ? +_exptl_crystal_size_min ? +_exptl_absorpt_coefficient_mu 53.066 +_shelx_estimated_absorpt_T_min ? +_shelx_estimated_absorpt_T_max ? +_exptl_absorpt_correction_type Multi-scan +_exptl_absorpt_correction_T_min 0.05 +_exptl_absorpt_correction_T_max 0.09 +_exptl_absorpt_process_details SADABS +_exptl_absorpt_special_details ? +_diffrn_ambient_temperature 273(2) +_diffrn_radiation_wavelength 0.71073 +_diffrn_radiation_type MoK\a +_diffrn_source ? +_diffrn_measurement_device_type 'Bruker Venture' +_diffrn_measurement_method 'w and f scans' +_diffrn_detector_area_resol_mean ? +_diffrn_reflns_number 45265 +_diffrn_reflns_av_unetI/netI 0.0438 +_diffrn_reflns_av_R_equivalents 0.0984 +_diffrn_reflns_limit_h_min -28 +_diffrn_reflns_limit_h_max 28 +_diffrn_reflns_limit_k_min -35 +_diffrn_reflns_limit_k_max 35 +_diffrn_reflns_limit_l_min -4 +_diffrn_reflns_limit_l_max 4 +_diffrn_reflns_theta_min 1.896 +_diffrn_reflns_theta_max 25.998 +_diffrn_reflns_theta_full 25.242 +_diffrn_measured_fraction_theta_max 0.997 +_diffrn_measured_fraction_theta_full 0.997 +_diffrn_reflns_Laue_measured_fraction_max 0.997 +_diffrn_reflns_Laue_measured_fraction_full 0.997 +_diffrn_reflns_point_group_measured_fraction_max 0.997 +_diffrn_reflns_point_group_measured_fraction_full 0.997 +_reflns_number_total 2686 +_reflns_number_gt 2432 +_reflns_threshold_expression 'I > 2\s(I)' +_reflns_Friedel_coverage 0.000 +_reflns_Friedel_fraction_max . +_reflns_Friedel_fraction_full . + +_reflns_special_details +; + Reflections were merged by SHELXL according to the crystal + class for the calculation of statistics and refinement. + + _reflns_Friedel_fraction is defined as the number of unique + Friedel pairs measured divided by the number that would be + possible theoretically, ignoring centric projections and + systematic absences. +; + +_computing_data_collection ? +_computing_cell_refinement ? +_computing_data_reduction ? +_computing_structure_solution ? +_computing_structure_refinement 'SHELXL-2019/1 (Sheldrick, 2019)' +_computing_molecular_graphics ? +_computing_publication_material ? +_refine_special_details ? +_refine_ls_structure_factor_coef Fsqd +_refine_ls_matrix_type full +_refine_ls_weighting_scheme calc +_refine_ls_weighting_details +'w=1/[\s^2^(Fo^2^)+621.9436P] where P=(Fo^2^+2Fc^2^)/3' +_atom_sites_solution_primary ? +_atom_sites_solution_secondary ? +_atom_sites_solution_hydrogens . +_refine_ls_hydrogen_treatment undef +_refine_ls_extinction_method none +_refine_ls_extinction_coef . +_refine_ls_number_reflns 2686 +_refine_ls_number_parameters 156 +_refine_ls_number_restraints 0 +_refine_ls_R_factor_all 0.0682 +_refine_ls_R_factor_gt 0.0622 +_refine_ls_wR_factor_ref 0.1204 +_refine_ls_wR_factor_gt 0.1183 +_refine_ls_goodness_of_fit_ref 1.191 +_refine_ls_restrained_S_all 1.191 +_refine_ls_shift/su_max 0.000 +_refine_ls_shift/su_mean 0.000 + +loop_ +_atom_site_label +_atom_site_type_symbol +_atom_site_fract_x +_atom_site_fract_y +_atom_site_fract_z +_atom_site_U_iso_or_equiv +_atom_site_adp_type +_atom_site_occupancy +_atom_site_site_symmetry_order +_atom_site_calc_flag +_atom_site_refinement_flags_posn +_atom_site_refinement_flags_adp +_atom_site_refinement_flags_occupancy +_atom_site_disorder_assembly +_atom_site_disorder_group +Er1 Er 0.07748(8) 0.05652(6) 0.500000 0.0142(4) Uani 1 2 d S T P . . +Er2 Er 0.08595(7) 0.30947(6) 0.500000 0.0120(4) Uani 1 2 d S T P . . +Er3 Er 0.10456(7) 0.17922(6) 0.500000 0.0106(4) Uani 1 2 d S T P . . +Er4 Er 0.13093(7) 0.43511(6) 0.500000 0.0104(4) Uani 1 2 d S T P . . +Er5 Er 0.25432(7) 0.17093(6) 0.500000 0.0108(4) Uani 1 2 d S T P . . +Er6 Er 0.27041(7) 0.03909(6) 0.500000 0.0114(4) Uani 1 2 d S T P . . +Er7 Er 0.28309(7) 0.41410(6) 0.500000 0.0108(4) Uani 1 2 d S T P . . +Er8 Er 0.28332(8) 0.29107(6) 0.500000 0.0126(4) Uani 1 2 d S T P . . +Er9 Er 0.39889(7) 0.12119(6) 0.500000 0.0127(4) Uani 1 2 d S T P . . +Er10 Er 0.43243(8) 0.43616(6) 0.500000 0.0154(4) Uani 1 2 d S T P . . +Er11 Er 0.45377(7) 0.27772(6) 0.500000 0.0123(4) Uani 1 2 d S T P . . +Er12 Er 0.000000 0.500000 0.500000 0.0121(5) Uani 1 4 d S T P . . +In1 In 0.00590(11) 0.13767(9) 0.000000 0.0126(6) Uani 1 2 d S T P . . +In2 In 0.01855(12) 0.40539(9) 0.000000 0.0151(6) Uani 1 2 d S T P . . +In3 In 0.17656(11) 0.24925(9) 0.000000 0.0118(5) Uani 1 2 d S T P . . +In4 In 0.18106(11) 0.10191(9) 0.000000 0.0112(5) Uani 1 2 d S T P . . +In5 In 0.19366(11) 0.35672(9) 0.000000 0.0121(6) Uani 1 2 d S T P . . +In6 In 0.33472(11) 0.49473(9) 0.000000 0.0128(6) Uani 1 2 d S T P . . +In7 In 0.35370(11) 0.21223(9) 0.000000 0.0135(6) Uani 1 2 d S T P . . +In8 In 0.37378(11) 0.35183(9) 0.000000 0.0140(6) Uani 1 2 d S T P . . +In9 In 0.38378(11) 0.02818(9) 0.000000 0.0135(6) Uani 1 2 d S T P . . +In10 In 0.47597(11) 0.18988(9) 0.000000 0.0138(6) Uani 1 2 d S T P . . +Co1 Co 0.0496(2) 0.23684(16) 0.000000 0.0118(11) Uani 1 2 d S T P . . +Co2 Co 0.2156(2) 0.46222(17) 0.000000 0.0116(10) Uani 1 2 d S T P . . +Co3 Co 0.3080(2) 0.11152(17) 0.000000 0.0109(10) Uani 1 2 d S T P . . +In11 In 0.000000 0.000000 0.000000 0.017(2) Uani 0.27(4) 4 d S T P . . +Co4 Co 0.000000 0.000000 0.000000 0.017(2) Uani 0.73(4) 4 d S T P . . + +loop_ +_atom_site_aniso_label +_atom_site_aniso_U_11 +_atom_site_aniso_U_22 +_atom_site_aniso_U_33 +_atom_site_aniso_U_23 +_atom_site_aniso_U_13 +_atom_site_aniso_U_12 +Er1 0.0166(9) 0.0100(8) 0.0161(9) 0.000 0.000 0.0028(6) +Er2 0.0159(9) 0.0104(8) 0.0097(9) 0.000 0.000 -0.0019(6) +Er3 0.0134(8) 0.0079(7) 0.0105(9) 0.000 0.000 0.0010(6) +Er4 0.0130(8) 0.0083(7) 0.0099(8) 0.000 0.000 0.0015(6) +Er5 0.0136(8) 0.0091(8) 0.0097(9) 0.000 0.000 -0.0004(6) +Er6 0.0143(8) 0.0094(8) 0.0104(9) 0.000 0.000 0.0001(6) +Er7 0.0133(8) 0.0079(7) 0.0111(9) 0.000 0.000 -0.0010(6) +Er8 0.0178(9) 0.0077(8) 0.0123(9) 0.000 0.000 0.0003(6) +Er9 0.0144(8) 0.0137(8) 0.0100(9) 0.000 0.000 -0.0001(6) +Er10 0.0145(9) 0.0144(8) 0.0175(10) 0.000 0.000 0.0026(7) +Er11 0.0154(8) 0.0115(8) 0.0100(9) 0.000 0.000 0.0007(6) +Er12 0.0148(12) 0.0119(11) 0.0097(12) 0.000 0.000 0.0001(9) +In1 0.0150(13) 0.0080(11) 0.0149(14) 0.000 0.000 0.0004(10) +In2 0.0168(13) 0.0093(12) 0.0194(15) 0.000 0.000 -0.0032(10) +In3 0.0141(13) 0.0085(11) 0.0128(14) 0.000 0.000 0.0000(10) +In4 0.0135(13) 0.0064(11) 0.0138(14) 0.000 0.000 0.0005(9) +In5 0.0147(13) 0.0070(11) 0.0144(14) 0.000 0.000 0.0004(10) +In6 0.0135(13) 0.0081(12) 0.0168(14) 0.000 0.000 -0.0003(10) +In7 0.0140(13) 0.0116(12) 0.0147(14) 0.000 0.000 0.0017(10) +In8 0.0137(13) 0.0102(12) 0.0183(15) 0.000 0.000 0.0010(10) +In9 0.0149(13) 0.0115(12) 0.0140(14) 0.000 0.000 -0.0002(10) +In10 0.0127(13) 0.0103(12) 0.0185(15) 0.000 0.000 0.0001(10) +Co1 0.019(3) 0.003(2) 0.013(3) 0.000 0.000 0.0020(19) +Co2 0.012(2) 0.011(2) 0.012(3) 0.000 0.000 0.0020(19) +Co3 0.015(3) 0.010(2) 0.008(3) 0.000 0.000 0.0011(19) +In11 0.021(4) 0.013(3) 0.019(4) 0.000 0.000 -0.002(2) +Co4 0.021(4) 0.013(3) 0.019(4) 0.000 0.000 -0.002(2) diff --git a/tests/data/cif/sources/MP/GaN.cif b/tests/data/cif/sources/MP/GaN.cif new file mode 100644 index 0000000..20ce4e7 --- /dev/null +++ b/tests/data/cif/sources/MP/GaN.cif @@ -0,0 +1,35 @@ +# generated using pymatgen +data_GaN +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 3.18893040 +_cell_length_b 3.18893040 +_cell_length_c 5.19235725 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 90.00000000 +_cell_angle_gamma 120.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural GaN +_chemical_formula_sum 'Ga2 N2' +_cell_volume 45.72832351 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_type_symbol + _atom_type_oxidation_number + Ga3+ 3.0 + N3- -3.0 +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Ga3+ Ga0 1 0.66666667 0.33333333 0.49908371 1 + Ga3+ Ga1 1 0.33333333 0.66666667 0.99908371 1 + N3- N2 1 0.66666667 0.33333333 0.87591629 1 + N3- N3 1 0.33333333 0.66666667 0.37591629 1 diff --git a/tests/data/cif/sources/MP/LiFeP2O7.cif b/tests/data/cif/sources/MP/LiFeP2O7.cif new file mode 100644 index 0000000..0c68bb6 --- /dev/null +++ b/tests/data/cif/sources/MP/LiFeP2O7.cif @@ -0,0 +1,55 @@ +# generated using pymatgen +data_LiFeP2O7 +_symmetry_space_group_name_H-M 'P 1' +_cell_length_a 4.82762213 +_cell_length_b 8.07703221 +_cell_length_c 6.96158233 +_cell_angle_alpha 90.00000000 +_cell_angle_beta 109.45942315 +_cell_angle_gamma 90.00000000 +_symmetry_Int_Tables_number 1 +_chemical_formula_structural LiFeP2O7 +_chemical_formula_sum 'Li2 Fe2 P4 O14' +_cell_volume 255.94602695 +_cell_formula_units_Z 2 +loop_ + _symmetry_equiv_pos_site_id + _symmetry_equiv_pos_as_xyz + 1 'x, y, z' +loop_ + _atom_type_symbol + _atom_type_oxidation_number + Li+ 1.0 + Fe3+ 3.0 + P5+ 5.0 + O2- -2.0 +loop_ + _atom_site_type_symbol + _atom_site_label + _atom_site_symmetry_multiplicity + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_occupancy + Li+ Li0 1 0.17294612 0.13915679 0.66463828 1 + Li+ Li1 1 0.82705388 0.63915679 0.33536172 1 + Fe3+ Fe2 1 0.78050669 0.99792751 0.26550646 1 + Fe3+ Fe3 1 0.21949331 0.49792751 0.73449354 1 + P5+ P4 1 0.20548570 0.21297560 0.08083707 1 + P5+ P5 1 0.79451430 0.71297560 0.91916293 1 + P5+ P6 1 0.40314469 0.81816472 0.52459157 1 + P5+ P7 1 0.59685531 0.31816472 0.47540843 1 + O2- O8 1 0.39732413 0.34503550 0.24224724 1 + O2- O9 1 0.93625658 0.17310480 0.13536771 1 + O2- O10 1 0.06374342 0.67310480 0.86463229 1 + O2- O11 1 0.13245826 0.30062499 0.87730694 1 + O2- O12 1 0.19101954 0.96249718 0.48190827 1 + O2- O13 1 0.24679036 0.65296590 0.51245875 1 + O2- O14 1 0.39487039 0.31718948 0.60127658 1 + O2- O15 1 0.80898046 0.46249718 0.51809173 1 + O2- O16 1 0.60267587 0.84503550 0.75775276 1 + O2- O17 1 0.60895046 0.56019754 0.91485876 1 + O2- O18 1 0.39104954 0.06019754 0.08514124 1 + O2- O19 1 0.60512961 0.81718948 0.39872342 1 + O2- O20 1 0.75320964 0.15296590 0.48754125 1 + O2- O21 1 0.86754174 0.80062499 0.12269306 1