From ec69c0e9bc3fa1694f65deab0f74dfcf2d70a029 Mon Sep 17 00:00:00 2001 From: Ralf Meyer Date: Sat, 17 Feb 2024 16:40:37 -0500 Subject: [PATCH] Add test cases for new geometries --- tests/inputs/geometry_type/linear.xyz | 9 ++ .../geometry_type/square_antiprismatic.xyz | 84 +++++++++++++++++++ .../tricapped_trigonal_prismatic.xyz | 84 +++++++++++++++++++ tests/test_mol3D.py | 7 +- 4 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 tests/inputs/geometry_type/linear.xyz create mode 100644 tests/inputs/geometry_type/square_antiprismatic.xyz create mode 100644 tests/inputs/geometry_type/tricapped_trigonal_prismatic.xyz diff --git a/tests/inputs/geometry_type/linear.xyz b/tests/inputs/geometry_type/linear.xyz new file mode 100644 index 00000000..37f39644 --- /dev/null +++ b/tests/inputs/geometry_type/linear.xyz @@ -0,0 +1,9 @@ +7 +02/17/2024 14:53, XYZ structure generated by mol3D Class, molSimplify +Fe 0.000000 0.000000 0.000000 +O 2.120000 0.000000 0.000000 +H 2.726198 0.027327 -0.782547 +H 2.726184 -0.027327 0.782547 +O -2.120000 0.000000 0.000000 +H -2.726198 0.463603 0.631029 +H -2.726184 -0.463603 -0.631029 diff --git a/tests/inputs/geometry_type/square_antiprismatic.xyz b/tests/inputs/geometry_type/square_antiprismatic.xyz new file mode 100644 index 00000000..752cff13 --- /dev/null +++ b/tests/inputs/geometry_type/square_antiprismatic.xyz @@ -0,0 +1,84 @@ +82 + +Zr 0.19770 4.54500 1.35640 +O -1.82300 4.70570 2.64860 +O 0.85670 2.45010 2.38160 +O 0.64690 4.99650 3.67140 +O -0.94780 2.89200 0.22810 +O -2.59820 1.85970 -0.85970 +O 0.00750 6.86860 1.29000 +O 0.42400 8.85670 0.36190 +O 2.37860 5.27840 1.42900 +O 4.52140 5.28560 0.80660 +N -3.77100 5.70130 3.22430 +N -2.11320 5.33010 0.05840 +N 0.68730 5.51840 -1.01200 +N 1.87090 3.01140 -0.02200 +N 1.35710 0.24150 2.21600 +C -4.98060 3.06490 3.82820 +C -5.80970 1.98450 4.07970 +C -6.45020 1.87450 5.29280 +C -6.26780 2.84930 6.25860 +C -5.45230 3.93750 5.99330 +C -4.78480 4.04160 4.78130 +C -3.81960 5.19510 4.58070 +C -2.78530 5.45070 2.37310 +C -2.84260 6.14760 1.03480 +C -1.74020 6.09110 -1.14520 +C -0.53710 5.48890 -1.83930 +C 1.76420 4.78000 -1.74060 +C 1.69970 3.29980 -1.45720 +C 1.57080 1.59980 0.25050 +C 1.24100 1.46090 1.71620 +C 1.03770 -0.08900 3.59580 +C -0.33560 -0.68490 3.78360 +C -1.45940 -0.07190 3.26460 +C -2.73080 -0.59890 3.50130 +C -2.84550 -1.76530 4.26440 +C -1.73020 -2.37920 4.77910 +C -0.48960 -1.84020 4.53500 +C 1.88030 4.86000 4.37800 +C -2.90950 4.12880 -0.29400 +C -2.08260 2.86310 -0.31420 +C 1.12860 6.93050 -0.81620 +C 0.46270 7.60850 0.36620 +C 3.24890 3.31220 0.41820 +C 3.40440 4.74450 0.91060 +H -4.54160 3.13410 2.98760 +H -5.93570 1.31740 3.41430 +H -7.01590 1.13090 5.46690 +H -6.70070 2.77320 7.10020 +H -5.34880 4.62000 6.64710 +H -4.38270 6.20810 2.93990 +H 1.63110 -0.36090 1.69810 +H -1.36660 0.71590 2.74140 +H -3.50450 -0.17140 3.15110 +H -3.70450 -2.13850 4.42780 +H -1.81570 -3.17020 5.29810 +H 0.28100 -2.26790 4.88950 +H 0.13210 5.22450 4.09670 +H -4.07840 5.93440 5.18670 +H -2.91200 4.89970 4.84180 +H -3.78470 6.25620 0.75040 +H -2.43040 7.04420 1.10270 +H -3.31770 4.26200 -1.18550 +H -3.64340 4.02440 0.36190 +H -1.53600 7.02620 -0.89040 +H -2.50540 6.10580 -1.77240 +H -0.74060 4.55080 -2.07910 +H -0.36880 5.98550 -2.67980 +H 0.92730 7.44730 -1.63660 +H 2.10900 6.94500 -0.68350 +H 2.64800 5.12830 -1.46250 +H 1.66640 4.93280 -2.71380 +H 0.82470 2.94760 -1.75970 +H 2.40900 2.83630 -1.97090 +H 3.87060 3.16120 -0.33750 +H 3.49990 2.68900 1.14620 +H 2.35420 1.03770 0.02440 +H 0.80370 1.30240 -0.30040 +H 1.10500 0.73390 4.14340 +H 1.71160 -0.73090 3.93330 +H 2.36740 4.08160 4.03620 +H 1.69700 4.73730 5.33310 +H 2.42190 5.66670 4.24950 diff --git a/tests/inputs/geometry_type/tricapped_trigonal_prismatic.xyz b/tests/inputs/geometry_type/tricapped_trigonal_prismatic.xyz new file mode 100644 index 00000000..a8bf65f1 --- /dev/null +++ b/tests/inputs/geometry_type/tricapped_trigonal_prismatic.xyz @@ -0,0 +1,84 @@ +82 + +Y 0.19770 4.54500 1.35640 +O -1.82300 4.70570 2.64860 +O 0.85670 2.45010 2.38160 +O 0.64690 4.99650 3.67140 +O -0.94780 2.89200 0.22810 +O -2.59820 1.85970 -0.85970 +O 0.00750 6.86860 1.29000 +O 0.42400 8.85670 0.36190 +O 2.37860 5.27840 1.42900 +O 4.52140 5.28560 0.80660 +N -3.77100 5.70130 3.22430 +N -2.11320 5.33010 0.05840 +N 0.68730 5.51840 -1.01200 +N 1.87090 3.01140 -0.02200 +N 1.35710 0.24150 2.21600 +C -4.98060 3.06490 3.82820 +C -5.80970 1.98450 4.07970 +C -6.45020 1.87450 5.29280 +C -6.26780 2.84930 6.25860 +C -5.45230 3.93750 5.99330 +C -4.78480 4.04160 4.78130 +C -3.81960 5.19510 4.58070 +C -2.78530 5.45070 2.37310 +C -2.84260 6.14760 1.03480 +C -1.74020 6.09110 -1.14520 +C -0.53710 5.48890 -1.83930 +C 1.76420 4.78000 -1.74060 +C 1.69970 3.29980 -1.45720 +C 1.57080 1.59980 0.25050 +C 1.24100 1.46090 1.71620 +C 1.03770 -0.08900 3.59580 +C -0.33560 -0.68490 3.78360 +C -1.45940 -0.07190 3.26460 +C -2.73080 -0.59890 3.50130 +C -2.84550 -1.76530 4.26440 +C -1.73020 -2.37920 4.77910 +C -0.48960 -1.84020 4.53500 +C 1.88030 4.86000 4.37800 +C -2.90950 4.12880 -0.29400 +C -2.08260 2.86310 -0.31420 +C 1.12860 6.93050 -0.81620 +C 0.46270 7.60850 0.36620 +C 3.24890 3.31220 0.41820 +C 3.40440 4.74450 0.91060 +H -4.54160 3.13410 2.98760 +H -5.93570 1.31740 3.41430 +H -7.01590 1.13090 5.46690 +H -6.70070 2.77320 7.10020 +H -5.34880 4.62000 6.64710 +H -4.38270 6.20810 2.93990 +H 1.63110 -0.36090 1.69810 +H -1.36660 0.71590 2.74140 +H -3.50450 -0.17140 3.15110 +H -3.70450 -2.13850 4.42780 +H -1.81570 -3.17020 5.29810 +H 0.28100 -2.26790 4.88950 +H 0.13210 5.22450 4.09670 +H -4.07840 5.93440 5.18670 +H -2.91200 4.89970 4.84180 +H -3.78470 6.25620 0.75040 +H -2.43040 7.04420 1.10270 +H -3.31770 4.26200 -1.18550 +H -3.64340 4.02440 0.36190 +H -1.53600 7.02620 -0.89040 +H -2.50540 6.10580 -1.77240 +H -0.74060 4.55080 -2.07910 +H -0.36880 5.98550 -2.67980 +H 0.92730 7.44730 -1.63660 +H 2.10900 6.94500 -0.68350 +H 2.64800 5.12830 -1.46250 +H 1.66640 4.93280 -2.71380 +H 0.82470 2.94760 -1.75970 +H 2.40900 2.83630 -1.97090 +H 3.87060 3.16120 -0.33750 +H 3.49990 2.68900 1.14620 +H 2.35420 1.03770 0.02440 +H 0.80370 1.30240 -0.30040 +H 1.10500 0.73390 4.14340 +H 1.71160 -0.73090 3.93330 +H 2.36740 4.08160 4.03620 +H 1.69700 4.73730 5.33310 +H 2.42190 5.66670 4.24950 diff --git a/tests/test_mol3D.py b/tests/test_mol3D.py index e074567c..cdf016c3 100644 --- a/tests/test_mol3D.py +++ b/tests/test_mol3D.py @@ -108,6 +108,7 @@ def test_mutating_atoms(): @pytest.mark.parametrize('name, coordination_number, geometry_str', [ + ('linear', 2, 'linear'), ('trigonal_planar', 3, 'trigonal planar'), ('t_shape', 3, 'T shape'), ('trigonal_pyramidal', 3, 'trigonal pyramidal'), @@ -121,7 +122,9 @@ def test_mutating_atoms(): # ('pentagonal_pyramidal', 6, 'pentagonal pyramidal'), ('trigonal_prismatic', 6, 'trigonal prismatic'), # ('pentagonal_bipyramidal', 7, 'pentagonal bipyramidal') - ]) + # ('square_antiprismatic', 8, 'square antiprismatic'), + # ('tricapped_trigonal_prismatic', 9, 'tricapped trigonal prismatic'), +]) def test_get_geometry_type(name, coordination_number, geometry_str): xyz_file = resource_filename( Requirement.parse("molSimplify"), @@ -130,7 +133,7 @@ def test_get_geometry_type(name, coordination_number, geometry_str): mol = mol3D() mol.readfromxyz(xyz_file) - geo_report = mol.get_geometry_type(num_coord=coordination_number) + geo_report = mol.get_geometry_type(num_coord=coordination_number, debug=True) assert geo_report['geometry'] == geometry_str assert geo_report['allconnect'] is False