Skip to content

Commit

Permalink
Merge #523 which prepares us for a 0.13.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pc494 authored Sep 20, 2024
2 parents aca9a84 + 9672758 commit 8f6cb1a
Show file tree
Hide file tree
Showing 125 changed files with 1,106 additions and 984 deletions.
46 changes: 19 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
name: code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: psf/black@stable

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

- uses: isort/isort-action@master
with:
Expand All @@ -34,23 +34,6 @@ jobs:
run: |
black --diff --line-length 77 doc/tutorials/*.ipynb
# Make sure all necessary files will be included in a release
manifest:
name: check manifest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4

- name: Install dependencies
run: |
pip install manifix
- name: Check MANIFEST.in file
run: |
python setup.py manifix
build-with-pip:
name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}
Expand All @@ -61,24 +44,33 @@ 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.12'
LABEL: -minimum_requirement
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install depedencies and package
- name: Install core depedencies and package
shell: bash
run: |
pip install -U -e .'[tests,coverage]'
- name: Install optional dependencies
if: ${{ !contains(matrix.LABEL, 'minimum_requirement') }}
shell: bash
run: |
pip install -U -e .'[doc, tests]'
pip install -e .'[all]'
- name: Install oldest supported version
if: ${{ contains(matrix.LABEL, 'oldest') }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ instance/
.scrapy

# Sphinx documentation
doc/build/
_build/
doc/examples/
doc/reference/generated/
doc/source/_autosummary/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- id: black-jupyter
Expand Down
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Håkon Wiik Ånes",
"orcid": "0000-0002-1213-2911",
"affiliation": "Norwegian University of Science and Technology"
"affiliation": "Xnovo Technology ApS"
},
{
"name": "Ben Martineau"
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ All user facing changes to this project are documented in this file. The format
on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`__, and this project tries
its best to adhere to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`__.

2024-09-20 - version 0.13.1
===========================

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.

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

Fixed
-----
- ``Phase.from_cif()`` still gives a valid phase even though the space group could not
be read.

2024-09-03 - version 0.13.0
===========================

Expand Down
14 changes: 0 additions & 14 deletions MANIFEST.in

This file was deleted.

17 changes: 5 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
.. raw:: html

<p>
<h1>
<a href="https://orix.readthedocs.io"><img valign="middle" src="https://raw.githubusercontent.com/pyxem/orix/develop/doc/_static/img/orix_logo.png" width="50" alt="orix logo"/></a>
orix
</h1>
</p>

.. Content above here until EXCLUDE plus one line is excluded from the long description
.. in the source distributions uploaded to PyPI
.. EXCLUDE
|logo| orix
===========

.. |logo| image:: https://raw.githubusercontent.com/pyxem/orix/develop/doc/_static/img/orix_logo.png
:width: 50

orix is an open-source Python library for analysing orientations and crystal symmetry.

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
How to make a new release of ``orix``
=====================================

After version 0.9.0, orix' branching model changed to one similar to the Gitflow
After version 0.9.0, orix's branching model changed to one similar to the Gitflow
Workflow (`original blog post
<https://nvie.com/posts/a-successful-git-branching-model/>`__).

Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SPHINXOPTS =
SPHINXBUILD = PYDEVD_DISABLE_FILE_VALIDATION=1 python -Xfrozen_modules=off -m sphinx
SOURCEDIR = .
BUILDDIR = build
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
20 changes: 11 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
sys.path.append("../")

project = "orix"
copyright = f"2018-{str(datetime.now().year)}, {orix.__author__}"
author = orix.__author__
author = "orix developers"
copyright = f"2018-{str(datetime.now().year)}, {author}"
release = orix.__version__

# Add any Sphinx extension module names here, as strings. They can be
Expand Down Expand Up @@ -59,8 +59,10 @@
"matplotlib": ("https://matplotlib.org/stable", None),
"nbsphinx": ("https://nbsphinx.readthedocs.io/en/latest", None),
"nbval": ("https://nbval.readthedocs.io/en/latest", None),
"numba": ("https://numba.readthedocs.io/en/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
"numpydoc": ("https://numpydoc.readthedocs.io/en/latest", None),
"pooch": ("https://www.fatiando.org/pooch/latest", None),
"pytest": ("https://docs.pytest.org/en/stable", None),
"python": ("https://docs.python.org/3", None),
"pyxem": ("https://pyxem.readthedocs.io/en/latest", None),
Expand All @@ -78,7 +80,7 @@
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
"build",
"_build",
"Thumbs.db",
".DS_Store",
# Suppress warnings from Sphinx regarding "duplicate source files":
Expand Down Expand Up @@ -120,10 +122,10 @@
# modifications to point nbviewer and Binder to the GitHub develop
# branch links when the documentation is launched from a kikuchipy
# version with "dev" in the version
if "dev" in orix.__version__:
if "dev" in release:
release_version = "develop"
else:
release_version = "v" + orix.__version__
release_version = "v" + release
# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = (
r"""
Expand Down Expand Up @@ -234,14 +236,14 @@ def linkcode_resolve(domain, info):
fn = relpath(fn, start=startdir).replace(os.path.sep, "/")

if fn.startswith("orix/"):
m = re.match(r"^.*dev0\+([a-f\d]+)$", orix.__version__)
m = re.match(r"^.*dev0\+([a-f\d]+)$", release)
pre_link = "https://github.com/pyxem/orix/blob/"
if m:
return pre_link + "%s/%s%s" % (m.group(1), fn, linespec)
elif "dev" in orix.__version__:
elif "dev" in release:
return pre_link + "develop/%s%s" % (fn, linespec)
else:
return pre_link + "v%s/%s%s" % (orix.__version__, fn, linespec)
return pre_link + "v%s/%s%s" % (release, fn, linespec)
else:
return None

Expand Down Expand Up @@ -329,7 +331,7 @@ def _str_examples(self):
"filename_pattern": "^((?!sgskip).)*$",
"gallery_dirs": "examples",
"reference_url": {"orix": None},
"run_stale_examples": True,
"run_stale_examples": False,
"show_memory": True,
}
autosummary_generate = True
Expand Down
2 changes: 1 addition & 1 deletion doc/dev/building_writing_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ We use :doc:`nbval <nbval:index>` for this.
The tutorial notebooks can be run interactively in the browser with the help of Binder.
When creating a server from the orix source code, Binder installs the packages listed in
the ``environment.yml`` configuration file, which must include all ``doc`` dependencies
in ``setup.py`` necessary to run the notebooks.
in ``pyproject.toml`` necessary to run the notebooks.

Writing API reference
---------------------
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
4 changes: 2 additions & 2 deletions doc/tutorials/crystal_map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@
" vmax=angles.max() - 10,\n",
" overlay=xmap.iq,\n",
" colorbar=True,\n",
" colorbar_label=\"Rotation angle, $\\omega$ [$^{\\circ}$]\",\n",
" colorbar_label=r\"Rotation angle, $\\omega$ [$\\degree$]\",\n",
")"
]
},
Expand Down Expand Up @@ -1492,7 +1492,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.12.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions doc/tutorials/pole_density_function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,19 @@
"v = Vector3d.random(1_000_000)\n",
"\n",
"ax[0].pole_density_function(v, log=False, resolution=1)\n",
"ax[0].set(title=\"Sampling resolution: 1$\\degree$\")\n",
"ax[0].set(title=r\"Sampling resolution: 1$\\degree$\")\n",
"\n",
"# change sampling resolution on S2\n",
"ax[1].pole_density_function(v, log=False, resolution=5)\n",
"ax[1].set(title=\"Sampling resolution: 5$\\degree$\")\n",
"ax[1].set(title=r\"Sampling resolution: 5$\\degree$\")\n",
"\n",
"# increase peak broadening\n",
"ax[2].pole_density_function(v, log=False, resolution=1, sigma=15)\n",
"ax[2].set(title=\"Sampling resolution: 1$\\degree$\\n$\\sigma$: 15$\\degree$\")\n",
"ax[2].set(title=\"Sampling resolution: 1$\\\\degree$\\n$\\\\sigma$: 15$\\\\degree$\")\n",
"\n",
"# change colormap\n",
"ax[3].pole_density_function(v, log=False, resolution=1, cmap=\"gray_r\")\n",
"ax[3].set(title='Sampling resolution: 1$\\degree$\\ncmap: \"gray_r\"')\n",
"ax[3].set(title=\"Sampling resolution: 1$\\\\degree$\\ncmap: 'gray_r'\")\n",
"\n",
"for a in ax:\n",
" a.set_labels(\"X\", \"Y\", None)"
Expand Down Expand Up @@ -352,7 +352,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.12.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8f6cb1a

Please sign in to comment.