From 2a312b836f0d883ed0c2b47aaf8fce8f1055e731 Mon Sep 17 00:00:00 2001 From: vaitkus Date: Mon, 15 May 2023 11:24:14 +0300 Subject: [PATCH 1/5] Add _units.code to the length_neutron save frame. --- templ_enum.cif | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templ_enum.cif b/templ_enum.cif index 11cc215..581ba50 100644 --- a/templ_enum.cif +++ b/templ_enum.cif @@ -1117,6 +1117,8 @@ save_radius_bond save_length_neutron + _units.code femtometres + loop_ _enumeration_default.index _enumeration_default.value From d45efc30eb0b8001c78dadf3658ffbfae31efd21 Mon Sep 17 00:00:00 2001 From: rowlesmr Date: Sat, 3 Jun 2023 13:25:55 +0800 Subject: [PATCH 2/5] add more units to the enumerations but questions still remain --- templ_enum.cif | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/templ_enum.cif b/templ_enum.cif index 581ba50..59581ad 100644 --- a/templ_enum.cif +++ b/templ_enum.cif @@ -867,6 +867,8 @@ save_units_code save_atomic_number + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -917,6 +919,8 @@ save_atomic_number save_electron_count + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1017,6 +1021,8 @@ save_ion_to_element save_atomic_mass + _units.code dalton + loop_ _enumeration_default.index _enumeration_default.value @@ -1067,6 +1073,8 @@ save_atomic_mass save_radius_bond + _units.code angstroms + loop_ _enumeration_default.index _enumeration_default.value @@ -1169,6 +1177,8 @@ save_length_neutron save_dispersion_real_cu + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1220,6 +1230,8 @@ save_dispersion_real_cu save_dispersion_imag_cu + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1270,6 +1282,8 @@ save_dispersion_imag_cu save_dispersion_real_mo + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1320,6 +1334,8 @@ save_dispersion_real_mo save_dispersion_imag_mo + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1370,6 +1386,8 @@ save_dispersion_imag_mo save_cromer_mann_a1 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1420,6 +1438,8 @@ save_cromer_mann_a1 save_cromer_mann_b1 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1470,6 +1490,8 @@ save_cromer_mann_b1 save_cromer_mann_a2 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1520,6 +1542,8 @@ save_cromer_mann_a2 save_cromer_mann_b2 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1570,6 +1594,8 @@ save_cromer_mann_b2 save_cromer_mann_a3 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1620,6 +1646,8 @@ save_cromer_mann_a3 save_cromer_mann_b3 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1670,7 +1698,9 @@ save_cromer_mann_b3 save_cromer_mann_a4 - loop_ + _units.code none + + loop_ _enumeration_default.index _enumeration_default.value H .04081 D .04081 H1- .116973 He 0.178 Li .4653 @@ -1720,6 +1750,8 @@ save_cromer_mann_a4 save_cromer_mann_b4 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1770,6 +1802,8 @@ save_cromer_mann_b4 save_cromer_mann_c + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1820,6 +1854,8 @@ save_cromer_mann_c save_hi_ang_fox_c0 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1870,6 +1906,8 @@ save_hi_ang_fox_c0 save_hi_ang_fox_c1 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1920,6 +1958,8 @@ save_hi_ang_fox_c1 save_hi_ang_fox_c2 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value @@ -1970,6 +2010,8 @@ save_hi_ang_fox_c2 save_hi_ang_fox_c3 + _units.code none + loop_ _enumeration_default.index _enumeration_default.value From 581145a5f715903381281304fd15cd84940602ba Mon Sep 17 00:00:00 2001 From: vaitkus Date: Mon, 26 Jun 2023 15:11:10 +0300 Subject: [PATCH 3/5] Update import statements to replace duplicate items. --- cif_core.dic | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/cif_core.dic b/cif_core.dic index b57fe9a..0aced9b 100644 --- a/cif_core.dic +++ b/cif_core.dic @@ -23914,7 +23914,8 @@ save_atom_type.atomic_mass _enumeration.def_index_id '_atom_type.symbol' _units.code dalton - _import.get [{'file':templ_enum.cif 'save':atomic_mass}] + _import.get + [{'dupl':replace 'file':templ_enum.cif 'save':atomic_mass}] save_ @@ -23937,7 +23938,7 @@ save_atom_type.atomic_number _units.code none _import.get - [{'file':templ_enum.cif 'save':atomic_number}] + [{'dupl':replace 'file':templ_enum.cif 'save':atomic_number}] save_ @@ -24011,7 +24012,7 @@ save_atom_type.electron_count _units.code none _import.get - [{'file':templ_enum.cif 'save':electron_count}] + [{'dupl':replace 'file':templ_enum.cif 'save':electron_count}] save_ @@ -24160,7 +24161,8 @@ save_atom_type.radius_bond _enumeration.def_index_id '_atom_type.symbol' _units.code angstroms - _import.get [{'file':templ_enum.cif 'save':radius_bond}] + _import.get + [{'dupl':replace 'file':templ_enum.cif 'save':radius_bond}] save_ @@ -24251,7 +24253,7 @@ save_atom_type_scat.cromer_mann_a1 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_a1} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a1} ] save_ @@ -24272,7 +24274,7 @@ save_atom_type_scat.cromer_mann_a2 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_a2} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a2} ] save_ @@ -24293,7 +24295,7 @@ save_atom_type_scat.cromer_mann_a3 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_a3} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a3} ] save_ @@ -24314,7 +24316,7 @@ save_atom_type_scat.cromer_mann_a4 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_a4} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a4} ] save_ @@ -24335,7 +24337,7 @@ save_atom_type_scat.cromer_mann_b1 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_b1} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b1} ] save_ @@ -24356,7 +24358,7 @@ save_atom_type_scat.cromer_mann_b2 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_b2} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b2} ] save_ @@ -24377,7 +24379,7 @@ save_atom_type_scat.cromer_mann_b3 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_b3} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b3} ] save_ @@ -24398,7 +24400,7 @@ save_atom_type_scat.cromer_mann_b4 _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_b4} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b4} ] save_ @@ -24419,7 +24421,7 @@ save_atom_type_scat.cromer_mann_c _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'file':templ_enum.cif 'save':cromer_mann_c} + {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_c} ] save_ @@ -24541,7 +24543,7 @@ save_atom_type_scat.dispersion_imag_cu _units.code none _import.get - [{'file':templ_enum.cif 'save':dispersion_imag_cu}] + [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_imag_cu}] save_ @@ -24564,7 +24566,7 @@ save_atom_type_scat.dispersion_imag_mo _units.code none _import.get - [{'file':templ_enum.cif 'save':dispersion_imag_mo}] + [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_imag_mo}] save_ @@ -24622,7 +24624,7 @@ save_atom_type_scat.dispersion_real_cu _units.code none _import.get - [{'file':templ_enum.cif 'save':dispersion_real_cu}] + [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_real_cu}] save_ @@ -24645,7 +24647,7 @@ save_atom_type_scat.dispersion_real_mo _units.code none _import.get - [{'file':templ_enum.cif 'save':dispersion_real_mo}] + [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_real_mo}] save_ @@ -24861,7 +24863,7 @@ save_atom_type_scat.hi_ang_fox_c0 _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'file':templ_enum.cif 'save':hi_ang_fox_c0} + {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c0} ] save_ @@ -24876,7 +24878,7 @@ save_atom_type_scat.hi_ang_fox_c1 _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'file':templ_enum.cif 'save':hi_ang_fox_c1} + {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c1} ] save_ @@ -24891,7 +24893,7 @@ save_atom_type_scat.hi_ang_fox_c2 _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'file':templ_enum.cif 'save':hi_ang_fox_c2} + {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c2} ] save_ @@ -24906,7 +24908,7 @@ save_atom_type_scat.hi_ang_fox_c3 _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'file':templ_enum.cif 'save':hi_ang_fox_c3} + {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c3} ] save_ From 8eca8e880aa474d18f2c14515fc9ab9632776e22 Mon Sep 17 00:00:00 2001 From: vaitkus Date: Mon, 26 Jun 2023 15:23:47 +0300 Subject: [PATCH 4/5] Update the units in several save frames. --- templ_enum.cif | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templ_enum.cif b/templ_enum.cif index 83b59da..d31e478 100644 --- a/templ_enum.cif +++ b/templ_enum.cif @@ -1339,7 +1339,7 @@ save_cromer_mann_a1 save_cromer_mann_b1 - _units.code none + _units.code angstrom_squared loop_ _enumeration_default.index @@ -1443,7 +1443,7 @@ save_cromer_mann_a2 save_cromer_mann_b2 - _units.code none + _units.code angstrom_squared loop_ _enumeration_default.index @@ -1547,7 +1547,7 @@ save_cromer_mann_a3 save_cromer_mann_b3 - _units.code none + _units.code angstrom_squared loop_ _enumeration_default.index @@ -1651,7 +1651,7 @@ save_cromer_mann_a4 save_cromer_mann_b4 - _units.code none + _units.code angstrom_squared loop_ _enumeration_default.index @@ -1807,7 +1807,7 @@ save_hi_ang_fox_c0 save_hi_ang_fox_c1 - _units.code none + _units.code angstroms loop_ _enumeration_default.index @@ -1859,7 +1859,7 @@ save_hi_ang_fox_c1 save_hi_ang_fox_c2 - _units.code none + _units.code angstrom_squared loop_ _enumeration_default.index @@ -1911,7 +1911,7 @@ save_hi_ang_fox_c2 save_hi_ang_fox_c3 - _units.code none + _units.code angstrom_cubed loop_ _enumeration_default.index From dc9e698494c9ab3e1ca19de5cf9b77eb694297b6 Mon Sep 17 00:00:00 2001 From: vaitkus Date: Wed, 28 Jun 2023 12:16:45 +0300 Subject: [PATCH 5/5] Remove units from cif_core.dic in favour of those in templ_enum.cif. --- cif_core.dic | 65 +++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/cif_core.dic b/cif_core.dic index bb26b3f..f22f3d3 100644 --- a/cif_core.dic +++ b/cif_core.dic @@ -23929,10 +23929,8 @@ save_atom_type.atomic_mass _type.container Single _type.contents Real _enumeration.def_index_id '_atom_type.symbol' - _units.code dalton - _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':atomic_mass}] + _import.get [{'file':templ_enum.cif 'save':atomic_mass}] save_ @@ -23952,10 +23950,9 @@ save_atom_type.atomic_number _type.contents Integer _enumeration.range 1: _enumeration.def_index_id '_atom_type.element_symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':atomic_number}] + [{'file':templ_enum.cif 'save':atomic_number}] save_ @@ -24026,10 +24023,9 @@ save_atom_type.electron_count _type.contents Integer _enumeration.range 1: _enumeration.def_index_id '_atom_type.symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':electron_count}] + [{'file':templ_enum.cif 'save':electron_count}] save_ @@ -24176,10 +24172,8 @@ save_atom_type.radius_bond _type.contents Real _enumeration.range 0.0:5.0 _enumeration.def_index_id '_atom_type.symbol' - _units.code angstroms - _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':radius_bond}] + _import.get [{'file':templ_enum.cif 'save':radius_bond}] save_ @@ -24265,12 +24259,11 @@ save_atom_type_scat.cromer_mann_a1 _name.category_id atom_type_scat _name.object_id Cromer_Mann_a1 - _units.code none _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a1} + {'file':templ_enum.cif 'save':cromer_mann_a1} ] save_ @@ -24286,12 +24279,11 @@ save_atom_type_scat.cromer_mann_a2 _name.category_id atom_type_scat _name.object_id Cromer_Mann_a2 - _units.code none _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a2} + {'file':templ_enum.cif 'save':cromer_mann_a2} ] save_ @@ -24307,12 +24299,11 @@ save_atom_type_scat.cromer_mann_a3 _name.category_id atom_type_scat _name.object_id Cromer_Mann_a3 - _units.code none _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a3} + {'file':templ_enum.cif 'save':cromer_mann_a3} ] save_ @@ -24328,12 +24319,11 @@ save_atom_type_scat.cromer_mann_a4 _name.category_id atom_type_scat _name.object_id Cromer_Mann_a4 - _units.code none _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_a4} + {'file':templ_enum.cif 'save':cromer_mann_a4} ] save_ @@ -24349,12 +24339,11 @@ save_atom_type_scat.cromer_mann_b1 _name.category_id atom_type_scat _name.object_id Cromer_Mann_b1 - _units.code angstrom_squared _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b1} + {'file':templ_enum.cif 'save':cromer_mann_b1} ] save_ @@ -24370,12 +24359,11 @@ save_atom_type_scat.cromer_mann_b2 _name.category_id atom_type_scat _name.object_id Cromer_Mann_b2 - _units.code angstrom_squared _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b2} + {'file':templ_enum.cif 'save':cromer_mann_b2} ] save_ @@ -24391,12 +24379,11 @@ save_atom_type_scat.cromer_mann_b3 _name.category_id atom_type_scat _name.object_id Cromer_Mann_b3 - _units.code angstrom_squared _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b3} + {'file':templ_enum.cif 'save':cromer_mann_b3} ] save_ @@ -24412,12 +24399,11 @@ save_atom_type_scat.cromer_mann_b4 _name.category_id atom_type_scat _name.object_id Cromer_Mann_b4 - _units.code angstrom_squared _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_b4} + {'file':templ_enum.cif 'save':cromer_mann_b4} ] save_ @@ -24433,12 +24419,11 @@ save_atom_type_scat.cromer_mann_c _name.category_id atom_type_scat _name.object_id Cromer_Mann_c - _units.code none _import.get [ {'file':templ_attr.cif 'save':cromer_mann_coeff} - {'dupl':replace 'file':templ_enum.cif 'save':cromer_mann_c} + {'file':templ_enum.cif 'save':cromer_mann_c} ] save_ @@ -24557,10 +24542,9 @@ save_atom_type_scat.dispersion_imag_cu _type.container Single _type.contents Real _enumeration.def_index_id '_atom_type.element_symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_imag_cu}] + [{'file':templ_enum.cif 'save':dispersion_imag_cu}] save_ @@ -24580,10 +24564,9 @@ save_atom_type_scat.dispersion_imag_mo _type.container Single _type.contents Real _enumeration.def_index_id '_atom_type.element_symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_imag_mo}] + [{'file':templ_enum.cif 'save':dispersion_imag_mo}] save_ @@ -24638,10 +24621,9 @@ save_atom_type_scat.dispersion_real_cu _type.container Single _type.contents Real _enumeration.def_index_id '_atom_type.element_symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_real_cu}] + [{'file':templ_enum.cif 'save':dispersion_real_cu}] save_ @@ -24661,10 +24643,9 @@ save_atom_type_scat.dispersion_real_mo _type.container Single _type.contents Real _enumeration.def_index_id '_atom_type.element_symbol' - _units.code none _import.get - [{'dupl':replace 'file':templ_enum.cif 'save':dispersion_real_mo}] + [{'file':templ_enum.cif 'save':dispersion_real_mo}] save_ @@ -24875,12 +24856,11 @@ save_atom_type_scat.hi_ang_fox_c0 _definition.id '_atom_type_scat.hi_ang_Fox_c0' _name.category_id atom_type_scat _name.object_id hi_ang_Fox_c0 - _units.code none _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c0} + {'file':templ_enum.cif 'save':hi_ang_fox_c0} ] save_ @@ -24890,12 +24870,11 @@ save_atom_type_scat.hi_ang_fox_c1 _definition.id '_atom_type_scat.hi_ang_Fox_c1' _name.category_id atom_type_scat _name.object_id hi_ang_Fox_c1 - _units.code angstroms _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c1} + {'file':templ_enum.cif 'save':hi_ang_fox_c1} ] save_ @@ -24905,12 +24884,11 @@ save_atom_type_scat.hi_ang_fox_c2 _definition.id '_atom_type_scat.hi_ang_Fox_c2' _name.category_id atom_type_scat _name.object_id hi_ang_Fox_c2 - _units.code angstrom_squared _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c2} + {'file':templ_enum.cif 'save':hi_ang_fox_c2} ] save_ @@ -24920,12 +24898,11 @@ save_atom_type_scat.hi_ang_fox_c3 _definition.id '_atom_type_scat.hi_ang_Fox_c3' _name.category_id atom_type_scat _name.object_id hi_ang_Fox_c3 - _units.code angstrom_cubed _import.get [ {'file':templ_attr.cif 'save':hi_ang_fox_coeffs} - {'dupl':replace 'file':templ_enum.cif 'save':hi_ang_fox_c3} + {'file':templ_enum.cif 'save':hi_ang_fox_c3} ] save_