Skip to content

Commit

Permalink
Merge pull request #348 from hakonanes/python3.9-support
Browse files Browse the repository at this point in the history
Support Python 3.9
  • Loading branch information
hakonanes committed Apr 27, 2021
2 parents ef1f4ab + 5e7b1fb commit bddf53b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8]
python-version: [3.8, 3.9]
include:
# Oldest supported version of main dependencies on Python 3.7
- os: ubuntu-latest
python-version: 3.7
OLDEST_SUPPORTED_VERSION: true
DEPENDENCIES: dask==2.18 diffsims==0.4 hyperspy==1.5.2 matplotlib==3.3 numpy==1.19 orix==0.5.1 scikit-image==0.16.2
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,6 +31,9 @@ jobs:
- name: Install depedencies and package
shell: bash
run: pip install -U -e .'[doc, tests]'
- name: Install oldest supported version
if: ${{ matrix.OLDEST_SUPPORTED_VERSION }}
run: pip install ${{ matrix.DEPENDENCIES }}
- name: Run tests
run: pytest --cov=kikuchipy --pyargs kikuchipy
- name: Generate line coverage
Expand All @@ -43,4 +52,4 @@ jobs:
- name: Coveralls finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
parallel-finished: true
2 changes: 2 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Contributors

Added
-----
- Support for Python 3.9.
(`#348 <https://github.com/pyxem/kikuchipy/pull/348>)`_
- Projection/pattern center calibration via the moving screen technique in a
kikuchipy.detectors.calibration module.
(`#322 <https://github.com/pyxem/kikuchipy/pull/322>`_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# along with kikuchipy. If not, see <http://www.gnu.org/licenses/>.

from diffsims.crystallography import ReciprocalLatticePoint
import matplotlib.colors as mcolors
import numpy as np
import pytest
from orix.crystal_map import Phase
Expand Down
13 changes: 7 additions & 6 deletions kikuchipy/detectors/ebsd_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from matplotlib.axes import Axes
from matplotlib.figure import Figure
from matplotlib.markers import MarkerStyle
import matplotlib.pyplot as plt
import numpy as np

Expand Down Expand Up @@ -584,12 +585,12 @@ def plot(
if show_pc:
if pc_kwargs is None:
pc_kwargs = {}
default_params_pc = {
"s": 300,
"facecolor": "gold",
"edgecolor": "k",
"marker": "*",
}
default_params_pc = dict(
s=300,
facecolor="gold",
edgecolor="k",
marker=MarkerStyle(marker="*", fillstyle="full"),
)
[pc_kwargs.setdefault(k, v) for k, v in default_params_pc.items()]
ax.scatter(x=pcx, y=pcy, **pc_kwargs)

Expand Down
2 changes: 0 additions & 2 deletions kikuchipy/io/plugins/tests/test_h5ebsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ def test_load_readonly(self):
)
mm = s.data.dask[k]
assert isinstance(mm, Dataset)
with pytest.raises(NotImplementedError):
s.data[:] = 23

def test_save_fresh(self, save_path_hdf5, tmp_path):
scan_size = (10, 3)
Expand Down
2 changes: 0 additions & 2 deletions kikuchipy/io/plugins/tests/test_nordif.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ def test_load_readonly(self):
mm = s.data.dask[k]
assert isinstance(mm, np.memmap)
assert not mm.flags["WRITEABLE"]
with pytest.raises(NotImplementedError):
s.data[:] = 23

@pytest.mark.parametrize("lazy", [True, False])
def test_load_inplace(self, lazy):
Expand Down
2 changes: 1 addition & 1 deletion kikuchipy/signals/tests/test_ebsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def test_get_decomposition_model(

# Decomposition
dummy_signal.change_dtype(np.float32)
dummy_signal.decomposition(algorithm="SVD")
dummy_signal.decomposition()

# Get decomposition model
model_signal = dummy_signal.get_decomposition_model(
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
(
Expand Down Expand Up @@ -115,18 +116,18 @@
# Dependencies
extras_require=extra_feature_requirements,
install_requires=[
"dask[array] >= 2.14",
"dask[array] >= 2.18",
"diffsims >= 0.4",
"hyperspy >= 1.5.2",
"h5py >= 2.10",
"matplotlib >= 3.2",
"numpy >= 1.18",
"matplotlib >= 3.3",
"numpy >= 1.19",
"numba >= 0.48",
"orix >= 0.5",
"orix >= 0.5.1",
"pooch >= 0.13",
"psutil",
"tqdm >= 0.5.2",
"scikit-image >= 0.16",
"scikit-image >= 0.16.2",
"scikit-learn",
"scipy",
],
Expand Down

0 comments on commit bddf53b

Please sign in to comment.