Skip to content

Commit

Permalink
Merge pull request #429 from hakonanes/v0.5.0
Browse files Browse the repository at this point in the history
Prepare for release of v0.5.0
  • Loading branch information
hakonanes authored Aug 31, 2021
2 parents 1aa0f94 + 0c73e59 commit 696c154
Show file tree
Hide file tree
Showing 70 changed files with 2,939 additions and 2,367 deletions.
14 changes: 12 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"commit": false,
"contributorsPerLine": 7,
"contributorsSortAlphabetically": true,
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-yellow.svg)](#contributors)",
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-yellow.svg)](#contributors-)",
"projectName": "kikuchipy",
"projectOwner": "pyxem",
"repoType": "github",
Expand Down Expand Up @@ -57,6 +57,16 @@
"code",
"review"
]
},
{
"login": "ericpre",
"name": "Eric Prestat",
"avatar_url": "https://avatars.githubusercontent.com/u/11851990?v=4",
"profile": "https://github.com/ericpre",
"contributions": [
"code",
"maintenance"
]
}
]
}
}
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#### Description of the change
<!-- Remember to branch off the develop branch for new features and the main branch for patches. -->


#### Progress of the PR
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- os: ubuntu-latest
python-version: 3.7
OLDEST_SUPPORTED_VERSION: true
DEPENDENCIES: dask==2.18 diffsims==0.4.0 hyperspy==1.5.2 matplotlib==3.3 numpy==1.19 orix==0.6.0 scikit-image==0.16.2
DEPENDENCIES: dask==2021.8.1 diffsims==0.4.0 hyperspy==1.6.4 matplotlib==3.3 numba==0.48 numpy==1.19 orix==0.6.0 scikit-image==0.16.2
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -49,12 +49,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display versions
run: python -V; pip -V
- name: Install depedencies and package
shell: bash
run: pip install -U -e .'[tests]'
- name: Install oldest supported version
if: ${{ matrix.OLDEST_SUPPORTED_VERSION }}
run: pip install ${{ matrix.DEPENDENCIES }}
- name: Install depedencies and package
shell: bash
run: pip install -U -e .'[tests]'
- name: Run docstring tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pytest --doctest-modules --ignore-glob=kikuchipy/*/tests
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test_documentation_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test documentation notebooks

on:
schedule:
- cron: '15 6 * * 1'

jobs:
test-documentation-notebooks:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MPLBACKEND: agg
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Display versions
run: python -V; pip -V
- name: Install dependencies and package
shell: bash
run: |
pip install -U -e .'[tests]'
pip install nbval
- name: Test documentation notebooks
run: |
pytest -v --nbval doc/user_guide doc/examples
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<img align="right" width="200px" src="https://kikuchipy.org/en/stable/_static/plasma_logo.svg">

## kikuchipy
<div align="center">
<a href="https://kikuchipy.org">
<img width="60%" src="doc/_static/logo/plasma_banner.png">
</a>
</div>

kikuchipy is an open-source Python library for processing and analysis of electron
backscatter diffraction (EBSD) patterns. The library builds on the tools for
Expand All @@ -10,11 +12,11 @@ multi-dimensional data analysis provided by the HyperSpy library.
[![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pyxem/kikuchipy)
[![Documentation status](https://readthedocs.org/projects/kikuchipy/badge/?version=latest)](https://kikuchipy.org/en/latest/)
[![Build status](https://github.com/pyxem/kikuchipy/workflows/build/badge.svg)](https://github.com/pyxem/kikuchipy/actions)
[![Coverage status](https://coveralls.io/repos/github/pyxem/kikuchipy/badge.svg?branch=master)](https://coveralls.io/github/pyxem/kikuchipy?branch=master)
[![Coverage status](https://coveralls.io/repos/github/pyxem/kikuchipy/badge.svg?branch=develop)](https://coveralls.io/github/pyxem/kikuchipy?branch=develop)
[![PyPI version](https://img.shields.io/pypi/v/kikuchipy.svg)](https://pypi.python.org/pypi/kikuchipy)
[![Downloads per month](https://pepy.tech/badge/kikuchipy/month)](https://pepy.tech/project/kikuchipy)
[![Zenodo DOI](https://zenodo.org/badge/doi/10.5281/zenodo.3597646.svg)](https://doi.org/10.5281/zenodo.3597646)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-yellow.svg)](#contributors)
[![All Contributors](https://img.shields.io/badge/contributors-5-b1aee3.svg)](#contributors-)

- **User guide and API reference**: https://kikuchipy.org. The guide consists of Jupyter
Notebooks with many links to detailed explanations of the input parameters and output
Expand All @@ -37,6 +39,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/ericpre"><img src="https://avatars.githubusercontent.com/u/11851990?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Eric Prestat</b></sub></a><br /><a href="https://github.com/pyxem/kikuchipy/commits?author=ericpre" title="Code">💻</a> <a href="#maintenance-ericpre" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://www.ntnu.edu/employees/hakon.w.anes"><img src="https://avatars.githubusercontent.com/u/12139781?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Håkon Wiik Ånes</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/friedkitteh"><img src="https://avatars.githubusercontent.com/u/11888052?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lars Lervik</b></sub></a><br /><a href="https://github.com/pyxem/kikuchipy/issues?q=author%3Afriedkitteh" title="Bug reports">🐛</a> <a href="https://github.com/pyxem/kikuchipy/commits?author=friedkitteh" title="Code">💻</a> <a href="https://github.com/pyxem/kikuchipy/commits?author=friedkitteh" title="Documentation">📖</a> <a href="#question-friedkitteh" title="Answering Questions">💬</a> <a href="https://github.com/pyxem/kikuchipy/pulls?q=is%3Apr+reviewed-by%3Afriedkitteh" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/pyxem/kikuchipy/commits?author=friedkitteh" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/onatlandsmyr"><img src="https://avatars.githubusercontent.com/u/34620114?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ole Natlandsmyr</b></sub></a><br /><a href="https://github.com/pyxem/kikuchipy/commits?author=onatlandsmyr" title="Code">💻</a> <a href="https://github.com/pyxem/kikuchipy/commits?author=onatlandsmyr" title="Documentation">📖</a> <a href="#question-onatlandsmyr" title="Answering Questions">💬</a> <a href="https://github.com/pyxem/kikuchipy/pulls?q=is%3Apr+reviewed-by%3Aonatlandsmyr" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/pyxem/kikuchipy/commits?author=onatlandsmyr" title="Tests">⚠️</a></td>
Expand Down
47 changes: 22 additions & 25 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
How to make a new release of ``kikuchipy``
==========================================

- Create a release branch v<major>.<minor>.x. If a new minor release is to be
made, branch off of master via the GitHub repo, and pull this branch locally.
If a new patch release is to be made, pull the existing minor branch locally
and branch off of it.
- Review and clean up `doc/changelog.rst` as per Keep a Changelog. Make sure all
contributors and reviewers are acknowledged. Increment the version number in
`release.py`. Make a PR to the release branch.
- Create a PR from the release branch to master. Discuss the changelog with
others, and make any changes *directly* to the release branch.
- On the master branch, increment the version number in `release.py` to the next
v<major>.<minor>.dev0.
- If a release candidate (RC) is to be made, make a PR to the release branch
with `-rc.1` added to the version name, like v0.42.0-rc.1, merge the PR after
all checks pass, and publish an RC release off of the release branch. See that
it is made available via PyPI, download it with the `dev` dependencies, and
run the tests to make sure everything is as it should be. Also check that
Binder can build the repository successfully by going to the Read the Docs PR
check in the RC PR above after the RC release.
- Create a release draft (tag) via the GitHub repo from the release branch with
the correct tag version name, e.g. v0.42.0, and release title
"kikuchipy 0.42.0". Add the new release notes from the changelog, and convert
any reStructuredText formatting to Markdown by hand. Publish the release.
- Monitor the publish GitHub Action to ensure the release is successfully
published to PyPI.
kikuchipy's branching model is similar to the Gitflow Workflow (`original blog post
<https://nvie.com/posts/a-successful-git-branching-model/>`_).

- If a minor release is to be made, create a release branch v<major>.<minor>.0 off of
the `develop` branch locally. If a patch release is to be made, create a release
branch v<major>.<minor>.<patch> off of the `main` branch locally instead. Ideally, a
patch release should be made immediately after a bug fix has been made. Therefore, it
might be best to do the release updates, listed in the following steps, directly on
the bug fix branch, so that no separate patch release branch has to be made. The bug
fix branch should of course be branched off of `main`.
- Increment the version number in `release.py`. Review and clean up `doc/changelog.rst`
as per Keep a Changelog. Make sure all contributors and reviewers are acknowledged.
- Make a PR of the release branch to `main`. Discuss the changelog with others, and
make any changes *directly* to the release branch. Merge the branch into `main`. Then
make a PR of `main` to `develop`, and merge this.
- Create a release draft (tag) via the GitHub repo from main with the correct tag
version name, e.g. v0.42.0, and release title "kikuchipy 0.42.0". Add the new release
notes from the changelog, and convert any reStructuredText formatting to Markdown by
hand. Publish the release.
- Monitor the publish GitHub Action to ensure the release is successfully published to
PyPI.
- Download the new version from PyPI with the `dev` dependencies with
`pip install kikuchipy[dev]==0.42.0` locally and run the tests with
`pytest --pyargs kikuchipy` to make sure everything is as it should be.
- Make a PR to master with any updates to this guide if necessary.
- Make a PR to `develop` with any updates to this guide if necessary.

conda-forge
-----------
Expand Down
14 changes: 3 additions & 11 deletions doc/_static/data/pattern_match_ni_large.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
from orix import sampling, io

import kikuchipy as kp


s_large = kp.data.nickel_ebsd_large()

s_large.remove_static_background()
s_large.remove_dynamic_background()
s_large.average_neighbour_patterns(window="gaussian", std=2)

mp = kp.data.nickel_ebsd_master_pattern_small(projection="lambert")

r = sampling.get_sample_fundamental(
resolution=5, space_group=mp.phase.space_group.number
resolution=4, space_group=mp.phase.space_group.number
)

detector = kp.detectors.EBSDDetector(
shape=s_large.axes_manager.signal_shape[::-1],
pc=[0.421, 0.7794, 0.5049],
convention="tsl",
sample_tilt=70,
)
sim = mp.get_patterns(rotations=r, detector=detector, energy=20, compute=False)

sim = mp.get_patterns(
rotations=r, detector=detector, energy=20, dtype_out=np.uint8, compute=True
)

xmap = s_large.dictionary_indexing(sim, keep_n=1, n_slices=10, metric="ncc")

xmap = s_large.dictionary_indexing(sim, keep_n=1, metric="ncc")
io.save("/home/hakon/ni_large.h5", xmap)
Binary file not shown.
Binary file not shown.
File renamed without changes
Binary file added doc/_static/logo/plasma_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 151 additions & 0 deletions doc/_static/logo/plasma_banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
46 changes: 42 additions & 4 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ kikuchipy is an open-source Python library for processing and analysis of electr
backscatter diffraction patterns: https://kikuchipy.org.

All notable changes to this project will be documented in this file. The format is based
on `Keep a Changelog <https://keepachangelog.com/en/1.1.0>`_, and this project adheres
to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
on `Keep a Changelog <https://keepachangelog.com/en/1.1.0>`_, and this project tries its
best to adhere to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

Contributors to each release are listed in alphabetical order by first name. List
entries are sorted in descending chronological order.

Unreleased
==========
0.5.0 (2021-08-31)
==================

Contributors
------------
- Eric Prestat
- Håkon Wiik Ånes
- Lars Andreas Hastad Lervik

Added
-----
- Possibility to specify whether to rechunk experimental and simulated data sets and
which data type to use for dictionary indexing.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- How to use the new orientation and/or projection center refinements to the pattern
matching notebook. (`#405 <https://github.com/pyxem/kikuchipy/pull/405>`_)
- Notebooks to the documentation as shorter or longer "Examples" that don't fit in the
Expand All @@ -32,15 +36,49 @@ Added

Changed
-------
- If a custom metric is to be used for dictionary indexing, it must now be a class
inheriting from an abstract *SimilarityMetric* class. This replaces the previous
*SimilarityMetric* class and the *make_similarity_metric()* function.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- Dictionary indexing parameter *n_slices* to *n_per_iteration*.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- *merge_crystal_maps* parameter *metric* to *greater_is_better*.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- *orientation_similarity_map* parameter *normalized* is by default False.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- Dependency versions for dask >= 2021.8.1, fixing some memory issues encountered after
2021.3.1, and HyperSpy >= 1.6.4. Remove importlib_metadata from package dependencies.
(`#418 <https://github.com/pyxem/kikuchipy/pull/418>`_)
- Performance improvements to EBSD dictionary generation, giving a substantial speed-up.
(`#405 <https://github.com/pyxem/kikuchipy/pull/405>`_)
- Rename projection methods from `project()`/`iproject()` to
`vector2xy()`/`xy2vector()`. (`#405 <https://github.com/pyxem/kikuchipy/pull/405>`_)
- URLs of user guide topics have an extra "/user_guide/<topic>" added to them.
(`#403 <https://github.com/pyxem/kikuchipy/pull/403>`_)

Deprecated
----------
- Custom EBSD metadata, meaning the *Acquisition_instrument.SEM.EBSD.Detector* and
*Sample.Phases* nodes, as well as the EBSD *set_experimental_parameters()* and
*set_phase_parameters()* methods. This will be removed in v0.6 The *static_background*
metadata array will become available as an EBSD property.
(`#428 <https://github.com/pyxem/kikuchipy/pull/428>`_)

Removed
-------
- *make_similarity_metric()* function is replaced by the need to create a class inheriting
from a new abstract *SimilarityMetric* class, which provides more freedom over
preparations of arrays before dictionary indexing.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- *EBSD.match_patterns()* is removed, use *EBSD.dictionary_indexing()* instead.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)
- kikuchipy.pattern.correlate module.
(`#419 <https://github.com/pyxem/kikuchipy/pull/419>`_)

Fixed
-----
- Allow static background in EBSD metadata to be a Dask array.
(`#413 <https://github.com/pyxem/kikuchipy/pull/413>`_)
- Set newest supported version of Sphinx to 4.0.2 so that nbsphinx works.
(`#403 <https://github.com/pyxem/kikuchipy/pull/403>`_)

Expand Down
4 changes: 1 addition & 3 deletions doc/cite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ Cite

If analysis using kikuchipy forms a part of published work please consider
recognizing the code development by citing this DOI:

.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.3597646.svg
:target: https://doi.org/10.5281/zenodo.3597646
`https://doi.org/10.5281/zenodo.3597646 <https://doi.org/10.5281/zenodo.3597646>`_.
24 changes: 16 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. This image also
# affects html_static_path and html_extra_path.
exclude_patterns = ["build", "_static/icon/*.ipynb"]
exclude_patterns = ["build", "_static/logo/*.ipynb"]

# The theme to use for HTML and HTML Help pages. See the documentation
# for a list of builtin themes.
Expand All @@ -86,16 +86,16 @@
pygments_style = "friendly"

# Logo
html_logo = "_static/icon/plasma_logo.svg"
html_favicon = "_static/icon/plasma_favicon.png"
html_logo = "_static/logo/plasma_logo.svg"
html_favicon = "_static/logo/plasma_favicon.png"

# nbsphinx configuration
# Taken from nbsphinx' own nbsphinx configuration file, with slight
# modification to point nbviewer and Binder to the GitHub master links
# when the documentation is launched from a kikuchipy version with
# modification 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 version:
release_version = "master"
release_version = "develop"
else:
release_version = "v" + version
# This is processed by Jinja2 and inserted before each notebook
Expand Down Expand Up @@ -148,11 +148,19 @@
bibtex_bibfiles = ["bibliography.bib"]


# Relevant for the PDF build with LaTeX
latex_elements = {
# pdflatex doesn't like some Unicode characters, so a replacement
# for one of them is made here
"preamble": r"\DeclareUnicodeCharacter{2588}{-}"
}


def linkcode_resolve(domain, info):
"""Determine the URL corresponding to Python object.
This is taken from SciPy's conf.py:
https://github.com/scipy/scipy/blob/master/doc/source/conf.py.
https://github.com/scipy/scipy/blob/develop/doc/source/conf.py.
"""
if domain != "py":
return None
Expand Down Expand Up @@ -202,7 +210,7 @@ def linkcode_resolve(domain, info):
if m:
return pre_link + "%s/%s%s" % (m.group(1), fn, linespec)
elif "dev" in kikuchipy.__version__:
return pre_link + "master/%s%s" % (fn, linespec)
return pre_link + "develop/%s%s" % (fn, linespec)
else:
return pre_link + "v%s/%s%s" % (kikuchipy.__version__, fn, linespec)
else:
Expand Down
Loading

0 comments on commit 696c154

Please sign in to comment.