Skip to content

Commit

Permalink
Merge pull request #521 from hakonanes/remove-python38-39-compat
Browse files Browse the repository at this point in the history
Update Python version compatibility to range 3.10-12
  • Loading branch information
hakonanes authored Sep 18, 2024
2 parents 5367787 + 11a617b commit 3e31b35
Show file tree
Hide file tree
Showing 105 changed files with 66 additions and 159 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- uses: isort/isort-action@master
with:
Expand All @@ -44,14 +44,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11']
python-version: ['3.11', '3.12']
include:
- os: ubuntu-latest
python-version: 3.8
DEPENDENCIES: diffpy.structure==3.0.2 matplotlib==3.5
python-version: '3.10'
DEPENDENCIES: diffpy.structure==3.0.2 matplotlib==3.6.1
LABEL: -oldest
- os: ubuntu-latest
python-version: 3.11
python-version: '3.12'
LABEL: -minimum_requirement
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ Unreleased

Added
-----
- Support for Python 3.12.

Changed
-------
- numpy-quaternion is now an optional dependency and will not be installed with ``pip``
unless ``pip install orix[all]`` is used.

Deprecated
----------

Removed
-------
- Support for Python 3.8 and 3.9.

Fixed
-----
Expand Down
18 changes: 10 additions & 8 deletions doc/dev/running_writing_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Run and write tests
All functionality in orix is tested with :doc:`pytest <pytest:index>`.
The tests reside in a ``tests`` module.
Tests are short methods that call functions in ``orix`` and compare resulting output
values with known answers. Install necessary dependencies to run the tests::
values with known answers.
Install necessary dependencies to run the tests::

pip install --editable ".[tests]"

Expand All @@ -15,23 +16,24 @@ Some useful :doc:`fixtures <pytest:explanation/fixtures>` are available in the

Some :mod:`orix.data` module tests check that data not part of the package
distribution can be downloaded from the web, thus downloading some small datasets to
your local cache. See the section on the
:ref:`data module <adding-data-to-data-module>` for more details.
your local cache.
See the section on the :ref:`data module <adding-data-to-data-module>` for more
details.

To run the tests::

pytest --cov --pyargs orix

The ``--cov`` flag makes :doc:`coverage.py <coverage:index>` prints a nice report in the
terminal.
The ``--cov`` flag makes :doc:`coverage.py <coverage:index>` print a nice report.
For an even nicer presentation, you can use ``coverage.py`` directly::

coverage html

Then, you can open the created ``htmlcov/index.html`` in the browser and inspect the
coverage in more detail.
Coverage can then be inspected in the browser by opening ``htmlcov/index.html``.

Docstring examples are tested :doc:`with pytest <pytest:how-to/doctest>` as well.
We strive for 100% test coverage of lines when all dependencies are installed.

Docstring examples are tested with :doc:`pytest <pytest:how-to/doctest>` as well.
:mod:`numpy` and :mod:`matplotlib.pyplot` should not be imported in examples as they are
already available in the namespace as ``np`` and ``plt``, respectively.
The docstring tests can be run from the top directory::
Expand Down
12 changes: 6 additions & 6 deletions doc/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation

orix can be installed with `pip <https://pypi.org/project/orix/>`__,
`conda <https://anaconda.org/conda-forge/orix>`__ or from source, and supports Python
>= 3.8.
>= 3.10.
All alternatives are available on Windows, macOS and Linux.

.. _install-with-pip:
Expand All @@ -29,9 +29,9 @@ To update orix to the latest release::

pip install --upgrade orix

To install a specific version of orix (say version 0.8.1)::
To install a specific version of orix (say version 0.12.1)::

pip install orix==0.8.1
pip install orix==0.12.1

.. _install-with-anaconda:

Expand All @@ -43,7 +43,7 @@ To install with Anaconda, we recommend you install it in a `conda environment
with the `Miniconda distribution <https://docs.conda.io/en/latest/miniconda.html>`__.
To create an environment and activate it, run the following::

conda create --name orix-env python=3.11
conda create --name orix-env python=3.12
conda activate orix-env

If you prefer a graphical interface to manage packages and environments, you can install
Expand All @@ -64,9 +64,9 @@ To update orix to the latest release::

conda update orix

To install a specific version of orix (say version 0.8.1)::
To install a specific version of orix (say version 0.12.1)::

conda install orix==0.8.1 -c conda-forge
conda install orix==0.12.1 -c conda-forge

.. _install-from-source:

Expand Down
1 change: 0 additions & 1 deletion orix/_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
2 changes: 1 addition & 1 deletion orix/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
try:
_ = version(pkg)
installed[pkg] = True
except ImportError:
except ImportError: # pragma: no cover
installed[pkg] = False

# Typical tolerances for comparisons in need of a precision. We
Expand Down
1 change: 0 additions & 1 deletion orix/crystal_map/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/crystal_map/crystal_map.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/crystal_map/crystal_map_properties.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/crystal_map/phase_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/data/_registry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/_h5ebsd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
3 changes: 1 addition & 2 deletions orix/io/plugins/ang.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down Expand Up @@ -108,7 +107,7 @@ def file_reader(filename: str) -> CrystalMap:
data_dict["phase_list"] = PhaseList(**phases)

# Set which data points are not indexed
# TODO: Add not-indexed convention for INDEX ASTAR
# TODO: Add not-indexed convention for ASTAR INDEX
if vendor in ["orix", "tsl"]:
not_indexed = data_dict["prop"]["ci"] == -1
data_dict["phase_id"][not_indexed] = -1
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/bruker_h5ebsd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/ctf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/emsoft_h5ebsd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/io/plugins/orix_hdf5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/measure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
3 changes: 1 addition & 2 deletions orix/measure/pole_density_function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down Expand Up @@ -34,7 +33,7 @@ def pole_density_function(
hemisphere: str = "upper",
symmetry: Optional[Symmetry] = None,
log: bool = False,
mrd: bool = True
mrd: bool = True,
) -> Tuple[np.ma.MaskedArray, Tuple[np.ndarray, np.ndarray]]:
"""Compute the Pole Density Function (PDF) of vectors in the
stereographic projection. See :cite:`rohrer2004distribution`.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/_symmetry_marker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
3 changes: 0 additions & 3 deletions orix/plot/crystal_map_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down Expand Up @@ -428,8 +427,6 @@ def _override_status_bar(
n_rows, n_cols = self._data_shape

# Get rotations, ensuring correct masking
# TODO: Show orientations in Euler angles (computationally
# intensive...)
r = crystal_map.get_map_data("rotations", decimals=3)

# Get image data, overwriting potentially masked regions set to 0.0
Expand Down
1 change: 0 additions & 1 deletion orix/plot/direction_color_keys/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/direction_color_keys/_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/direction_color_keys/direction_color_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/direction_color_keys/direction_color_key_tsl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/inverse_pole_figure_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/orientation_color_keys/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/orientation_color_keys/euler_color_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/orientation_color_keys/ipf_color_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/orientation_color_keys/ipf_color_key_tsl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/rotation_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/stereographic_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/plot/unit_cell_plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/projections/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/projections/stereographic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/quaternion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/quaternion/_conversions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/quaternion/misorientation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/quaternion/orientation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
1 change: 0 additions & 1 deletion orix/quaternion/orientation_region.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018-2024 the orix developers
#
# This file is part of orix.
Expand Down
Loading

0 comments on commit 3e31b35

Please sign in to comment.