Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e94d603
Start of gnomonic projection correction.
drowenhorst-nrl Jan 29, 2026
1f29267
Fixed band detect pipeline for a better bandwidth estimate from peak …
Feb 5, 2026
dabac72
Beginning of a gnomonic correction.
Feb 5, 2026
2db5968
Check point
Feb 6, 2026
250b37a
Testing divide by zero
drowenhorst-nrl Feb 9, 2026
e46e26f
Attempt to fix divide by zero error.
drowenhorst-nrl Feb 9, 2026
70f2a66
Attempt to fix divide by zero again.
drowenhorst-nrl Feb 9, 2026
31607a5
Checkpoint
drowenhorst-nrl Feb 10, 2026
1e42877
First attempts at a gnomonic correction. Added in band-specific misf…
Feb 12, 2026
9da55e7
Checkpoint
Mar 6, 2026
618a235
Merge commit '55701fb1eb9cf8f2858e0aeaa8df953950814ca9' into develop
Mar 7, 2026
21ac720
Attempt at planar optimization of PC
Mar 11, 2026
061cd62
Update PSO class to work with normalized coordinates.
drowenhorst-nrl Mar 12, 2026
00deb70
Fix zero error?
drowenhorst-nrl Mar 12, 2026
7d5c6d8
Remove gnomonic correction for now.
drowenhorst-nrl Mar 12, 2026
668b743
Checkpoint
Mar 14, 2026
b9732a0
Added adaptive speed constraint to PSO. Better handling of multi-dim…
Mar 27, 2026
794e262
Fix PCOpt tests
Mar 27, 2026
2f793c5
More testing fixes.
Mar 27, 2026
b8f0db0
Rare divide by zero protection.
Mar 30, 2026
870feef
More multithreaded support for CPU indexing. Should see speedups for…
Apr 9, 2026
fdf5e70
Update dependencies to avoid certain versions of Ray & update to 3.11…
Apr 9, 2026
06cb8a2
Little FFT math incase of poorly sized radon images for convolution.
Apr 9, 2026
158bcfb
Fix oldest test
Apr 9, 2026
3f9c2b2
Preliminary support for EMSoft H5 files.
Apr 13, 2026
3a59407
Attempt to fix windows reading of UP files by chunks.
Apr 13, 2026
b12658c
Revert back to letting fromfile do the work.
Apr 15, 2026
49c683a
Checkpoint
drowenhorst-nrl Apr 21, 2026
c882cce
Attempt to optimize convolutions.
Apr 21, 2026
d923b8c
Fix link to documentation in the readme.
May 7, 2026
48ae39f
Migrate from setup.py/setup.cfg to pyproject.toml
May 7, 2026
9db98f6
Update MANIFEST.in and CI for pyproject.toml
May 7, 2026
b0685ac
Switch to hatchling backend.
May 8, 2026
3745b3d
Remove MANIFEST.in after Hatchling migration
May 8, 2026
175b78c
Test github ray test
May 11, 2026
dce9e88
checkpoint
May 11, 2026
2e0d0db
Checkpoint 2
May 11, 2026
b538782
Trying to reduce RAM for github actions.
May 11, 2026
d78dea6
checkpoint
May 11, 2026
f0eb56e
Print memory usage?
May 11, 2026
e38dc8f
Remove macos from multi-processor version.
May 11, 2026
07f5c10
Strange RAM limit error on GitHub actions on macOS with Ray > 0.53. …
May 11, 2026
64d7b98
Prepare for version release.
May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:

- name: Install dependencies
run: |
pip install manifix
pip install check-manifest

- name: Check MANIFEST.in file
run: |
python setup.py manifix
check-manifest

tests:
name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }}
Expand All @@ -42,10 +42,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.11', '3.12', '3.13']
include:
- os: ubuntu-latest
python-version: 3.10
python-version: '3.10'
DEPENDENCIES: matplotlib==3.8 numba==0.56.4 pyopencl==2023.1.2
LABEL: -oldest
steps:
Expand All @@ -67,13 +67,15 @@ jobs:
pip install ${{ matrix.DEPENDENCIES }}

- name: Install support for multiprocessing and GPU support
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
if: ${{ matrix.os == 'ubuntu-latest'}} # || matrix.os == 'macos-latest' }}
# GitHub RAM limits for macOS are not working properly with Ray > 0.53
# I hope to reverse this sometime in the future.

# The second line is redundant but added for testing of pip
# selectors
run: |
pip install -U -e .'[gpu,parallel]'
pip install -U -e .'[all]'

- name: Display versions of Python, pip and packages
run: |
python -V
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ Changelog
All notable changes to PyEBSDIndex will be documented in this file. The format is based
on `Keep a Changelog <https://keepachangelog.com/en/1.1.0>`_.

0.3.10 (2026-05-11)
==================
Added
-----

Changed
-------
- Updated CPU band detection to use more numba-based multi threading.
- Changed default values for ``ebsd_index.index_pats_distributed()`` for using CPU only indexing.
- Converted the project from ``setup.py`` to ``pyproject.toml`` and build backend now is hatchling.
- Package version now located in __version.py to avoid issues with building with hatchling.


Fixed
-----
- Removed multiprocess (with Ray) testing for macOS on GitHub due to hitting RAM limits. Unclear as to root cause.
This was the former root cause of tests failing with Ray versions ``>0.53.1``; however these versions of Ray work
perfectly well on local machines.

0.3.9.2 (2026-03-06)
==================
Expand Down Expand Up @@ -179,7 +197,7 @@ Changed

Removed
-------
- Removed ``band_vote`` modual as that is now wrapped into triplevote.
- Removed ``band_vote`` module as that is now wrapped into triplevote.

Fixed
-----
Expand Down
17 changes: 0 additions & 17 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ and contributing guide is available at https://pyebsdindex.readthedocs.io.

## Installation

See [the documentation](https://pyebsdindex.readthedocs.io/en/stable/installation.html)
See [the documentation](https://pyebsdindex.readthedocs.io/en/stable/index.html)
for installation instructions.
4 changes: 2 additions & 2 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Preparation
-----------
- Review the contributor list ``__credits__`` in ``pyebsdindex/__init__.py`` to ensure
all contributors are included and sorted correctly.
- Bump ``__version__`` in ``pyebsdindex/__init__.py``, for example to "0.4.2".
- Bump ``__version__`` in ``pyebsdindex/__version.py``, for example to "0.4.2".
- Update the changelog ``CHANGELOG.rst``.
- Let the PR collect comments for a day to ensure that other maintainers are
comfortable with releasing. Merge.
Expand All @@ -25,6 +25,6 @@ Post-release action
- Monitor the `documentation build
<https://readthedocs.org/projects/pyebsdindex/builds>`_ to ensure that the new stable
documentation is successfully built from the release.
- Make a post-release PR to ``main`` with ``__version__`` in ``__init__.py`` updated (or reverted),
- Make a post-release PR to ``main`` with ``__version__`` in ``__version.py`` updated (or reverted),
and in ``CHANGELOG.rst`` e.g. to "0.4.dev0", and any updates to this guide if necessary
- Tidy up GitHub issues.
3 changes: 2 additions & 1 deletion pyebsdindex/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pyebsdindex.__version import __version__

__author__ = "Dave Rowenhorst"
__author_email__ = ""
# Initial committer first, then sorted by line contributions
Expand All @@ -7,7 +9,6 @@
]
__description__ = "Python based tool for Radon based EBSD indexing"
__name__ = "pyebsdindex"
__version__ = "0.3.9.2"


# Try to import only once - also will perform check that at least one GPU is found.
Expand Down
1 change: 1 addition & 0 deletions pyebsdindex/__version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.3.9.2"
4 changes: 2 additions & 2 deletions pyebsdindex/_ebsd_index_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def index_pats_distributed(
#ncpu = max(1,min(os.cpu_count(), int(len(indexer.phaseLib)*16)))
# this is a heuristic, and may be highly dependent on hardware
else:
ncpu = max(1,os.cpu_count()//4)
ncpu = min(4,os.cpu_count())#max(1,os.cpu_count()//4)
if ncpu != -1:
n_cpu_nodes = int(ncpu)

Expand Down Expand Up @@ -361,7 +361,7 @@ def index_pats_distributed(
ncpucpu_per_worker = 0.5 - 1.0e-3
ncpugpu_per_wrker = 0.5 - 1.0e-3
if chunksize <= 0:
chunksize = 1000
chunksize = 256
ncpuwrker = n_cpu_nodes

PCpat = indexer._fillPCarray(PC, npats)
Expand Down
16 changes: 15 additions & 1 deletion pyebsdindex/_ebsd_index_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
else:
from pyebsdindex import band_detect as band_detect

from pyebsdindex import gnomonic_correction

RADEG = 180.0 / np.pi

Expand Down Expand Up @@ -80,6 +81,7 @@ def index_pats(
verbose=0,
chunksize=528,
gpu_id=None,
useCPU = False,
**kwargs,
):
"""Index EBSD patterns on a single thread.
Expand Down Expand Up @@ -229,6 +231,7 @@ def index_pats(
nBands=nBands,
patDim=pdim,
gpu_id=gpu_id,
useCPU=useCPU,
)
else:
indexer = ebsd_indexer_obj
Expand Down Expand Up @@ -406,6 +409,9 @@ def __init__(
)

self.nband_earlyexit = nband_earlyexit

self.gnomonic = gnomonic_correction.GnomoicCorrection(radonPlan=self.bandDetectPlan.radonPlan, PC=self.PC)

self.dataTemplate = np.dtype(
[
("quat", np.float64, 4),
Expand Down Expand Up @@ -554,6 +560,7 @@ def index_pats(
except:
pass

self.gnomonic.calccorrection(PCpat)
banddata, bandnorm = self._detectbands(pats, PCpat, xyloc=xyloc, clparams=clparams, verbose=verbose,
chunksize=chunksize, gpu_id=gpuid)
tic = timer()
Expand Down Expand Up @@ -695,8 +702,11 @@ def _getpats(self, patsin=None, patstart=0, npats=-1, xyloc=None):
def _detectbands(self, pats, PC, xyloc=None, clparams=None, verbose=0, chunksize=528, gpu_id=None):

banddata = self.bandDetectPlan.find_bands(
pats, clparams=clparams, verbose=verbose, chunksize=chunksize, gpu_id=gpu_id,
pats, verbose=verbose, chunksize=chunksize, clparams=clparams, gpu_id=gpu_id,
)

#banddata = self.gnomonic.applycorrection(banddata, self.bandDetectPlan.rSigma)

# shpBandDat = banddata.shape
if PC is None:
PC_0 = self.PC
Expand All @@ -719,6 +729,7 @@ def _indexbandsphase(self, banddata, bandnorm, verbose=0):
indxData = np.zeros((nPhases + 1, npoints), dtype=self.dataTemplate)
#bandmatchindex = np.zeros((nPhases, npoints,shpBandDat[-1],2), dtype=np.int32)-100
bandmatchindex = np.zeros((npoints,nBands, nPhases), dtype=np.int32)-100
bandfit_out = np.zeros((npoints,nBands, nPhases), dtype=np.float64)+180
banddataout = banddata.copy()

indxData["phase"] = -1
Expand Down Expand Up @@ -775,6 +786,7 @@ def _indexbandsphase(self, banddata, bandnorm, verbose=0):
nMatch,
matchAttempts,
totvotes,
bandfit,
) = self.phaseLib[j].bandindex(
bandnorm[p2do, ...],
band_intensity=adj_intensity[p2do, ...],
Expand All @@ -792,6 +804,7 @@ def _indexbandsphase(self, banddata, bandnorm, verbose=0):
indxData["matchattempts"][j, whgood2] = matchAttempts[whgood, ...]
indxData["totvotes"][j, whgood2] = totvotes[whgood]
bandmatchindex[whgood2, ..., j] = bandmatch[whgood, ...].reshape(whgood.size,nBands )
bandfit_out[whgood2, ..., j] = bandfit[whgood, ...].reshape(whgood.size, nBands)



Expand All @@ -804,6 +817,7 @@ def _indexbandsphase(self, banddata, bandnorm, verbose=0):
indxData["quat"][0:nPhases, :, :] = q
indxData[-1, :] = indxData[0, :]
banddataout['band_match_index'][:,:, 0:nPhases] = bandmatchindex[:,:,:]#.squeeze()
banddataout['bandfit'][:,:, 0:nPhases] = bandfit_out[:,:,:]
if nPhases > 1:
for j in range(1, nPhases):
# indxData[-1, :] = np.where(
Expand Down
Loading
Loading