From 8c0f4e33cdce4327f385ab4669d8877cfd87cbc5 Mon Sep 17 00:00:00 2001 From: Alessandra da Silva Date: Wed, 17 Apr 2024 10:01:23 -0300 Subject: [PATCH 01/14] remove lattice alignment in from_cif --- orix/crystal_map/phase_list.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/orix/crystal_map/phase_list.py b/orix/crystal_map/phase_list.py index cf36dd27..db99ab97 100644 --- a/orix/crystal_map/phase_list.py +++ b/orix/crystal_map/phase_list.py @@ -339,9 +339,6 @@ def from_cif(cls, filename: str) -> Phase: parser = p_cif.P_cif() name = os.path.splitext(os.path.split(filename)[1])[0] structure = parser.parseFile(filename) - lattice = structure.lattice - new_base = _new_structure_matrix_from_alignment(lattice.base, x="a", z="c*") - lattice.setLatBase(new_base) space_group = parser.spacegroup.number return cls(name, space_group, structure=structure) From 142bf0d3356be9418aa751348f78eca0be71beef Mon Sep 17 00:00:00 2001 From: Alessandra da Silva Date: Wed, 17 Apr 2024 10:01:32 -0300 Subject: [PATCH 02/14] add test --- orix/tests/test_phase_list.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/orix/tests/test_phase_list.py b/orix/tests/test_phase_list.py index 78b8c6ad..0b9e45d4 100644 --- a/orix/tests/test_phase_list.py +++ b/orix/tests/test_phase_list.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with orix. If not, see . -from diffpy.structure import Atom, Lattice, Structure +from diffpy.structure import Atom, Lattice, Structure, loadStructure from diffpy.structure.spacegroups import GetSpaceGroup import numpy as np import pytest @@ -395,6 +395,12 @@ def test_from_cif(self, cif_file): assert np.allclose( lattice.base, [[15.5, 0, 0], [0, 4.05, 0], [-1.779, 0, 6.501]], atol=1e-3 ) + # check result is the same when defining structure directly + structure = loadStructure(cif_file) + phase2 = Phase(structure=structure) + assert np.allclose(phase.structure.lattice.base, phase2.structure.lattice.base) + assert np.allclose(phase.structure.xyz, phase2.structure.xyz) + assert np.allclose(phase.structure.xyz_cartn, phase2.structure.xyz_cartn) class TestPhaseList: From ac9e461162c29c6ecb5bef95d2c4dce48c7b93bf Mon Sep 17 00:00:00 2001 From: Alessandra da Silva Date: Wed, 17 Apr 2024 21:54:31 -0300 Subject: [PATCH 03/14] update zenodo --- .zenodo.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.zenodo.json b/.zenodo.json index 61795a30..9b81059b 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -46,6 +46,10 @@ "name": "Viljar Johan Femoen", "affiliation": "Norwegian University of Science and Technology" }, + { + "name": "Alessandra da Silva", + "orcid": "0000-0003-0465-504X" + }, { "name": "Alexander Clausen", "orcid": "0000-0002-9555-7455", From a175c19567651a75018edd401eb14a1a9db1ec9b Mon Sep 17 00:00:00 2001 From: Alessandra da Silva Date: Wed, 17 Apr 2024 21:54:45 -0300 Subject: [PATCH 04/14] update credits --- orix/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/orix/__init__.py b/orix/__init__.py index 5da4e507..c0d05907 100644 --- a/orix/__init__.py +++ b/orix/__init__.py @@ -16,5 +16,6 @@ "Carter Francis", "Simon Høgås", "Viljar Johan Femoen", + "Alessandra da Silva", "Alexander Clausen", ] From 3db66f57c8e50d953f68a9d6e254c3a9a253fc93 Mon Sep 17 00:00:00 2001 From: Alessandra da Silva Date: Thu, 18 Apr 2024 11:54:50 -0300 Subject: [PATCH 05/14] run black --- orix/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orix/__init__.py b/orix/__init__.py index c0d05907..164d7fee 100644 --- a/orix/__init__.py +++ b/orix/__init__.py @@ -16,6 +16,6 @@ "Carter Francis", "Simon Høgås", "Viljar Johan Femoen", - "Alessandra da Silva", + "Alessandra da Silva", "Alexander Clausen", ] From dea92bdb790c74ded4e841dc4c932a0adf044f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Thu, 18 Apr 2024 18:56:24 +0200 Subject: [PATCH 06/14] Separate out comparison of same Phase.structure into its own test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- orix/tests/test_phase_list.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/orix/tests/test_phase_list.py b/orix/tests/test_phase_list.py index 0b9e45d4..5e3782bf 100644 --- a/orix/tests/test_phase_list.py +++ b/orix/tests/test_phase_list.py @@ -395,12 +395,13 @@ def test_from_cif(self, cif_file): assert np.allclose( lattice.base, [[15.5, 0, 0], [0, 4.05, 0], [-1.779, 0, 6.501]], atol=1e-3 ) - # check result is the same when defining structure directly + + def test_from_cif_same_structure(self, cif_file): + phase1 = Phase.from_cif(cif_file) structure = loadStructure(cif_file) phase2 = Phase(structure=structure) - assert np.allclose(phase.structure.lattice.base, phase2.structure.lattice.base) - assert np.allclose(phase.structure.xyz, phase2.structure.xyz) - assert np.allclose(phase.structure.xyz_cartn, phase2.structure.xyz_cartn) + assert np.allclose(phase1.structure.lattice.base, phase2.structure.lattice.base) + assert np.allclose(phase1.structure.xyz, phase2.structure.xyz) class TestPhaseList: From bddc1ef7345614fc63eda1f648da807c13273ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Thu, 18 Apr 2024 18:57:01 +0200 Subject: [PATCH 07/14] Prepare changelog for 0.12.1 patch release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- CHANGELOG.rst | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0d156d69..63298ece 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,24 +6,14 @@ All user facing changes to this project are documented in this file. The format on `Keep a Changelog `__, and this project tries its best to adhere to `Semantic Versioning `__. -Unreleased -========== - -Added ------ - -Changed -------- - -Removed -------- - -Deprecated ----------- +2024-04-20 - version 0.12.1 +=========================== Fixed ----- - +- ``Phase.from_cif()`` now correctly adjust atom positions when forcing + ``Phase.structure.lattice.base`` to use the crystal axes alignment ``e1 || a``, + ``e3 || c*``. 2024-04-13 - version 0.12.0 =========================== From 88ec3f4645380cf28184644b2fa02dfdf524246d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Thu, 18 Apr 2024 18:57:16 +0200 Subject: [PATCH 08/14] Change to patch release version 0.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- orix/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orix/__init__.py b/orix/__init__.py index 164d7fee..c24b46a4 100644 --- a/orix/__init__.py +++ b/orix/__init__.py @@ -1,5 +1,5 @@ __name__ = "orix" -__version__ = "0.13.dev0" +__version__ = "0.12.1" __author__ = "orix developers" __author_email__ = "pyxem.team@gmail.com" __description__ = "orix is an open-source Python library for handling crystal orientation mapping data." From a71aa0d1479aea974e8ff589847dcd8901ec387d Mon Sep 17 00:00:00 2001 From: Paddy Harrison Date: Thu, 18 Apr 2024 14:34:10 -0300 Subject: [PATCH 09/14] fix final dimension 1 bug --- orix/quaternion/_conversions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orix/quaternion/_conversions.py b/orix/quaternion/_conversions.py index c739adab..6fa2c1b6 100644 --- a/orix/quaternion/_conversions.py +++ b/orix/quaternion/_conversions.py @@ -554,7 +554,7 @@ def ax2qu(axes: np.ndarray, angles: np.ndarray) -> np.ndarray: if axes.shape[-1] != 3: raise ValueError("Final dimension of axes array must be 3.") - if angles.shape[-1] != 1 or angles.shape == (1,): + if angles.shape[-1] != 1 or angles.shape == (1,) or axes.shape[:-1] == angles.shape: angles = angles.reshape(angles.shape + (1,)) axes_shape = axes.shape[:-1] From d70a92d6bf442521ba784c14c244f5e8660e8426 Mon Sep 17 00:00:00 2001 From: Paddy Harrison Date: Thu, 18 Apr 2024 14:35:48 -0300 Subject: [PATCH 10/14] add test --- orix/tests/quaternion/test_quaternion.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/orix/tests/quaternion/test_quaternion.py b/orix/tests/quaternion/test_quaternion.py index 6764c0b8..bc69ca94 100644 --- a/orix/tests/quaternion/test_quaternion.py +++ b/orix/tests/quaternion/test_quaternion.py @@ -511,7 +511,10 @@ class TestFromToAxesAngles: axis-angle vectors. """ - def test_from_axes_angles(self, rotations): + @pytest.mark.parametrize("extra_dim", [True, False]) + def test_from_axes_angles(self, rotations, extra_dim): + if extra_dim: + rotations = rotations.__class__(rotations.data[..., np.newaxis, :]) ax = AxAngle.from_rotation(rotations) with pytest.warns(np.VisibleDeprecationWarning): q2 = Quaternion.from_neo_euler(ax) From 64c169396cbbf302311fa5159e5bf76aef65028e Mon Sep 17 00:00:00 2001 From: Paddy Harrison Date: Thu, 18 Apr 2024 14:35:57 -0300 Subject: [PATCH 11/14] update changelog --- CHANGELOG.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0d156d69..660aeaed 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,6 +23,8 @@ Deprecated Fixed ----- +- ``ax2qu`` and ``Quaternion.from_axes_angles()`` would raise if the input arrays were + broadcastable but the final dimension was ``1``. This has been fixed. 2024-04-13 - version 0.12.0 From d91d7b60845b126763cd08db8ac4cad99d9a09b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Sat, 20 Apr 2024 11:51:59 +0200 Subject: [PATCH 12/14] Specify that the Phase.from_cif() bug was introduced in 0.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- CHANGELOG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 63298ece..de2b99dc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,9 +11,9 @@ its best to adhere to `Semantic Versioning Fixed ----- -- ``Phase.from_cif()`` now correctly adjust atom positions when forcing +- ``Phase.from_cif()`` now correctly adjusts atom positions when forcing ``Phase.structure.lattice.base`` to use the crystal axes alignment ``e1 || a``, - ``e3 || c*``. + ``e3 || c*``. This bug was introduced in 0.12.0. 2024-04-13 - version 0.12.0 =========================== From 9420cd02dfef8331bf0ad4ec69d1f68c8a1af2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Sun, 21 Apr 2024 13:30:13 +0200 Subject: [PATCH 13/14] Add unreleased section to changelog after 0.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- CHANGELOG.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5368fb05..103fa4dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,25 @@ All user facing changes to this project are documented in this file. The format on `Keep a Changelog `__, and this project tries its best to adhere to `Semantic Versioning `__. +Unreleased +========== + +Added +----- + +Changed +------- + +Removed +------- + +Deprecated +---------- + +Fixed +----- + + 2024-04-21 - version 0.12.1 =========================== From 804300852c9a2d5ee2a36d04938a617592c61bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Wiik=20A=CC=8Anes?= Date: Sun, 21 Apr 2024 13:30:32 +0200 Subject: [PATCH 14/14] Change version from 0.12.1 to 0.13.dev1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- orix/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orix/__init__.py b/orix/__init__.py index c24b46a4..c3bb483d 100644 --- a/orix/__init__.py +++ b/orix/__init__.py @@ -1,5 +1,5 @@ __name__ = "orix" -__version__ = "0.12.1" +__version__ = "0.13.dev1" __author__ = "orix developers" __author_email__ = "pyxem.team@gmail.com" __description__ = "orix is an open-source Python library for handling crystal orientation mapping data."