Git Product home page Git Product logo

pyebsdindex's Introduction

PyEBSDIndex

Python based tool for Radon based EBSD orientation indexing.

Tests status Documentation status PyPI version

The pattern processing is based on a GPU pipeline. Details can be found in D. J. Rowenhorst, P. G. Callahan, H. W. Ånes. Fast Radon transforms for high-precision EBSD orientation determination using PyEBSDIndex. Journal of Applied Crystallography, 57(1):3–19, 2024. and is based on the work of S. I. Wright and B. L. Adams. Metallurgical Transactions A-Physical Metallurgy and Materials Science, 23(3):759–767, 1992, and N. Krieger Lassen. Automated Determination of Crystal Orientations from Electron Backscattering Patterns. PhD thesis, The Technical University of Denmark, 1994.

The band indexing is achieved through triplet voting using the methods outlined by A. Morawiec. Acta Crystallographica Section A Foundations and Advances, 76(6):719–734, 2020.

Additionally NLPAR pattern processing is included (original distribution NLPAR; P. T. Brewick, S. I. Wright, and D. J. Rowenhorst. Ultramicroscopy, 200:50–61, May 2019.).

Documentation with installation instructions, a user guide, API reference, changelog, and contributing guide is available at https://pyebsdindex.readthedocs.io.

Installation

See the documentation for installation instructions.

pyebsdindex's People

Contributors

drowenhorst-nrl avatar hakonanes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyebsdindex's Issues

Upload to Anaconda

I've made a PR the conda-forge channel on Anaconda to upload PyEBSDIndex (conda-forge/staged-recipes#18301).

Currently this is not possible because of some issues:

  • pyswarms is not available on Anaconda (see relevant issue ljvmiranda921/pyswarms#347). We can either make this an optional dependency, or help out with uploading it to conda-forge. I'll ask them to see if they are still interested. If they are, I'll have a go; hopefully it is easy, if not, I might have to give up.

OpenCL kernels not included in package wheel on PyPI

OpenCL kernels are included in the source distribution on PyPI (see the tar file) since we list them in MANIFEST.in, but they are not included in the built distribution (wheel). The fix is to add include_package_data=True in setup(). I'll make a PR with a couple of changes, including this fix, soon.

Optimize PC with `batch=True`

@drowenhorst-nrl, how is your pattern array shaped when you use batch=True?

I'm passing a pattern array of shape (20, 60, 60) with 20 patterns of (60, 60) pixels to pcopt.optimize(..., batch=True), and get the following error:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [13], in <cell line: 2>()
      1 pc0 = (0.4, 0.2, 0.5)
----> 2 pc = pcopt.optimize(s.data[tuple(idx_2d)].reshape(-1, *sig_shape), indexer, pc0, batch=True)
      3 print(pc)

File ~/kode/pyebsdindex/pyebsdindex/pcopt.py:114, in optimize(pats, indexer, PC0, batch)
    112     PCoutRet = np.zeros((npoints, 3))
    113     for i in range(npoints):
--> 114         PCopt = opt.minimize(optfunction, PC0, args=(indexer, banddat[i, :, :]), method='Nelder-Mead')
    115         PCoutRet[i, :] = PCopt['x']
    117 if emsoftflag == True: # return original state for indexer

IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

The output shape of banddat is (20, 9), which explains the initial error. Trying to pass banddat[i, :] to opt.minimize() throws another error though...

Suitable reflector lists

Hi @drowenhorst-nrl!

We just released kikuchipy v0.9.0 compatible with PyEBSDIndex v0.2.0. So far, the new particle swarm optimization works like a charm.

This is more of a question than an issue. It relates to how users of PyEBSDIndex should find suitable reflector lists for indexing. My suggestion is to use the diffsims and orix libraries, specifically the ReciprocalLatticeVector class, which needs a Phase instance. At least for the moment.

So, I've tested multi-phase indexing with three phases in the list:

  • Aluminium (Laue class m-3m, blue)
  • Alpha-Al(Fe,Mn)Si (m-3, green)
  • Pi-Al8FeMg3Si6 (-6m2, purple)

pats_all_cal_ref2

It also works like a charm!

But, only after I specified my own reflector lists or polefamilies. I found the following reflectors to correctly differentiate between the phases above and provide plausible indexing:

  • Aluminium: the default ones, {111}, {200}, {220}, {311}
  • Pi-Al8FeMg3Si6: {2-12}, {004}, {002}, {4-20}, {2-20}, {200}
  • Alpha-Al(Fe,Mn)Si: {600}, {523}, {530}, {835}, {10 0 0}

These reflectors were found automatically using ReciprocalLatticeVector. I've found the approach quite robust and to give results comparable to EMsoft's building of reflector lists (which makes sense since it is based on that implementation). The procedure is simple:

  1. Get all reflectors with a minimum interplanar spacing d
  2. Exclude kinematically forbidden reflectors (not implemented for hexagonal yet)
  3. Exclude reflectors with a kinematical structure factor lower than a certain fraction of the maximum structure factor

Minimal syntax (CIF file: pi_al8femg3si6.cif.txt):

from diffsims.crystallography import ReciprocalLatticeVector
from orix.crystal_map import Phase

phase = Phase.from_cif("pi_al8femg3si6.cif")

ref = ReciprocalLatticeVector.from_min_dspacing(phase, 1)
ref.calculate_structure_factor()  # Parametrizations from Lobato and van Dyck (2014) or International Tables for Crystallography
F = abs(ref.structure_factor)
ref2 = ref[F > 0.48 * F.max()]

Do you have any thoughts on how users should find suitable reflector lists? Do you think linking to a relevant tutorial in kikuchipy's docs (say, this one) would be a good temporary solution until something is included in PyEBSDIndex itself?

Call to pcopt.optimize() with PyOpenCL installed throws (unimportant?) error

Running pyebsdindex.pcopt.optimize() after installing PyEBSDIndex with PyOpenCL (pip install pyebsdindex[gpu]) throws an error which apparently has no effect on the results. Using the included dynamically simulated Al pattern of shape (100, 120) and providing the PC used to create the pattern:

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> from pyebsdindex import ebsd_index, pcopt
>>> pattern = plt.imread("/home/hakon/al_sim_20kv.png")
>>> plt.figure()
>>> plt.imshow(pattern, cmap="gray")
>>> indexer = ebsd_index.EBSDIndexer(vendor="EDAX", patDim=pattern.shape)
>>> pc = pcopt.optimize(pattern.reshape((1,) + pattern.shape), indexer, PC0=[0.4, 0.6, 0.5])
[Errno 2] Fila eller mappa finnes ikke: '/home/hakon/miniconda3/envs/kp-rel/lib/python3.9/site-packages/pyebsdindex/opencl/clkernels.cl'
'NoneType' object has no attribute 'radonSum'
>>> print(pc)
0.39558783 0.60637312 0.50082604]

al_sim_20kv

The error message is part Norwegian ("Fila eller mappa finnes ikke") and translates to "The file or directory does not exist".

The PC seems to be optimized fine, so I won't consider this a bug. But we should make sure the error isn't displayed anyway.

load .edaxh5

Hi,

In the "Loading data from an HDF5 File" section of your tutorial, you include an example with:

"h5file = '/Path/to/hdf5/file.h5'
f = h5py.File(h5file, 'r') # this is an HDF5 file type used by EDAX.
h5pats = f['/Scan 1/EBSD/Data/Pattern'] # location of the pattern array within the HDF5 file.
index the first 1000
h5data, h5bnddata, indxer=ebsd_index.index_pats(patsin = h5pats[0:1000,:,:],
patstart = 0, npats = 1000,return_indexer_obj = True,
backgroundSub = backgroundsub,
nTheta = nT, nRho=nR,
tSigma = tSig, rSigma = rSig,rhoMaskFrac=rhomask,nBands=nbands,
phaselist = phaselist, PC = PC, verbose = 2)
#now index them all
h5data, h5banddata = ebsd_index.index_pats_distributed(patsin = h5pats, ebsd_indexer_obj = indxer, ncpu = 28)"

But in the *.edaxh5 files, there are no patterns. The patterns are in the up1/2 files, right?

Maybe I'm missing something.

Thanks for your help.

Quentin

Using "Trusted publisher" publishing to PyPI fails

Publishing to PyPI fails: https://github.com/USNavalResearchLaboratory/PyEBSDIndex/actions/runs/5800832452/job/15723768033#step:7:21

The project's publisher is apparently not configured on PyPI. This release workflow has worked for other projects I maintain, such as kikuchipy, without this. So I'm not sure why it fails now.

A trusted publisher can be configured on PyPI using this guide: https://docs.pypi.org/trusted-publishers/adding-a-publisher/. The fields should be as follows:

  • Owner: USNavalResearchLaboratory
  • Repository name: PyEBSDIndex
  • Workflow name: publish.yml
  • Environment name: leave blank

After this is done, we can re-run the publish workflow from the "Actions" tab and it should work.

Initial non-prerelease version

Should we make a 0.1.0 release?

PyEBSDIndex had to be released with a release candidate (RC) label (conda install -c conda-forge/label/pyebsdindex_rc pyebsdindex) since the package isn't available from PyPI without the "rc" label yet. A non-prerelease version should be made available on PyPI so that installation from Anaconda can be done with conda install -c conda-forge pyebsdindex.

Instead of using the MAJOR.MINOR.PATCH versioning scheme (SemVer, semantic versioning, example: NumPy's changelog), which states that API incompatible changes can only be included in MAJOR versions, one could use calendar versioning (CalVer, example: Dask's changelog). In general, it's OK to release API incompatible changes in MINOR versions while still being a MAJOR-0 package, although one shouldn't have too many of those. With calendar versioning, that requirement isn't possible and in general anything goes, as far as I can tell.

Support for a non-square detector

Support for a non-square detector would be nice. I assume this requires quite some generalizations of array shapes in much of the code, so this issue might be open for a while.

Got this error message when trying to initialize an EBSDIndexer instance:

>>> import kikuchipy as kp
>>> from pyebsdindex import ebsd_index
>>> detector = kp.detectors.EBSDDetector(
...     shape=(512, 622),
...     pc=(0.48, 0.548, 0.508),
...     convention="oxford",
...     sample_tilt=70
... )
>>> indexer = ebsd_index.EBSDIndexer(
...     phaselist=["FCC"],
...     vendor="EDAX",
...     PC=detector.pc_tsl(),
...     sampleTilt=detector.sample_tilt,
...     patDim=detector.shape,
... )
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [66], in <module>
----> 1 indexer = ebsd_index.EBSDIndexer(
      2     phaselist=["FCC"],
      3     vendor="EDAX",
      4     PC=detector.pc_tsl().squeeze(),
      5     sampleTilt=detector.sample_tilt,
      6     camElev=0,
      7     patDim=detector.shape,
      8 )

File ~/kode/pyebsdindex/pyebsdindex/ebsd_index.py:476, in EBSDIndexer.__init__(self, filename, phaselist, vendor, PC, sampleTilt, camElev, bandDetectPlan, nRho, nTheta, tSigma, rSigma, rhoMaskFrac, nBands, patDim)
    474 else:
    475   if patDim is not None:
--> 476     self.bandDetectPlan.band_detect_setup(patDim=patDim)
    478 self.dataTemplate = np.dtype([('quat',np.float32,(4)),('iq',np.float32), \
    479                               ('pq',np.float32),('cm',np.float32),('phase',np.int32), \
    480                               ('fit',np.float32),('nmatch',np.int32),('matchattempts',np.int32,(2)), ('totvotes', np.int32)])

File ~/kode/pyebsdindex/pyebsdindex/band_detect.py:128, in BandDetect.band_detect_setup(self, patterns, patDim, nTheta, nRho, tSigma, rSigma, rhoMaskFrac, nBands)
    126 self.rhoMax = 0.5 * np.float32(self.patDim.min())
    127 self.dRho = self.rhoMax/np.float32(self.nRho)
--> 128 self.radonPlan = radon_fast.Radon(imageDim=self.patDim, nTheta=self.nTheta, nRho=self.nRho, rhoMax=self.rhoMax)
    129 temp = np.ones(self.patDim[-2:], dtype=np.float32)
    130 back = self.radonPlan.radon_faster(temp,fixArtifacts=True)

File ~/kode/pyebsdindex/pyebsdindex/radon_fast.py:58, in Radon.__init__(self, image, imageDim, nTheta, nRho, rhoMax)
     56 else:
     57   self.imDim = np.asarray(imageDim[-2:])
---> 58 self.radon_plan_setup(imageDim=self.imDim, nTheta=self.nTheta, nRho=self.nRho, rhoMax=self.rhoMax)

File ~/kode/pyebsdindex/pyebsdindex/radon_fast.py:106, in Radon.radon_plan_setup(self, image, imageDim, nTheta, nRho, rhoMax)
    104   #indx_y = np.clip(indx_y, 0, self.imDim[1])
    105   indx1D = np.clip(m+self.imDim[0]*indx_y, 0, outofbounds)
--> 106   self.indexPlan[:,i, :] = indx1D
    107 else:
    108   b1 /= cTheta[i]

ValueError: could not broadcast input array from shape (90,512) into shape (90,622)

EDIT: Pinging @drowenhorst-nrl.

Current stable release on PyPI is still 0.1.1

The following installs version 0.1.1: pip install -U pyebsdindex. This is because the latest release on PyPI has version 0.2.dev0, which pip ignores unless told otherwise (can't remember the necessary flag).

There are two options to remedy this:

  1. Change the __version__ in __init__.py from 0.2.dev0 to 0.1.2 (and update the changelog), delete the current v0.1.2 release tag, and re-create and publish the tagged release pointing to main, now with the version 0.1.2.
  2. Leave 0.1.2 behind and just do as in 1. but using version 0.1.3.

Make ray an optional dependency

I suggest to make ray an optional dependency, since it is only used in the package in one file for a quite specific purpose (distributed indexing):

Another argument against having ray[default] as a dependency is that it is not generally available. E.g. it is not available from Anaconda for macOS (as mentioned in #17) or for Python 3.10 from Anaconda.

I haven't used the above mentioned function and class and there aren't any tests using them, so I'm reluctant to make a PR where they are moved but work when ray is installed.

Indexing of patterns in H5OINA files

Moving here a short discussion started in EMsoft-org/EMsoft#164 regarding reading EBSD patterns stored in H5OINA files in EMsoft. @Philip-Go kindly shared a small H5OINA file (136 MB), which I could confirm that the soon to be released kikuchipy reader could read successfully (including the pattern center values):

bilde

Quoting @Philip-Go:

That might be off topic regarding EMsoft, but the resulting IPf map looks well indexed. Does PyEBSDIndex achieve such a high indexation rate by hough indexing alone or was the map subjected to some cleaning and filtering afterwards? I'm wondering, since with online indexing during the measurement AZtec yields only ~60% indexation rate. I should definately take a closer look at that, thanks showing that!

The IPF map is produced from the results returned from PyEBSDIndex using default values. Do you have anything to add @drowenhorst-nrl? Feel free to close this issue when it suits you.


Below I've included the script I used. It requires the development version of kikuchipy, so to install everything (remaining packages are dependencies of kikuchipy):

pip install git+https://github.com/pyxem/kikuchipy.git@develop
pip install pyebsdindex[gpu]

Remove the [gpu] if an error message shows (see the installation guide). Indexing will use CPU so will be quite a lot slower, but still fast (I'd say). An unimportant warning is raised, which is fixed and will be released as a PyEBSDIndex v0.1.1 patch soon.

Then this should produce the plot above:

import os

from diffpy.structure import Lattice, Structure
from diffsims.crystallography import ReciprocalLatticeVector
import numpy as np
from orix import io, plot
from orix.crystal_map import CrystalMap, Phase, PhaseList
from orix.quaternion import Rotation

import kikuchipy as kp
from pyebsdindex import ebsd_index


# Load data and set some shapes
dir_data = "/home/hakon/phd/data/oxford"
fname = "Al_SLBM 10kV_8x8_small"
s = kp.load(os.path.join(dir_data, fname + ".h5oina"))
nav_shape = s.axes_manager.navigation_shape[::-1]
sig_shape = s.axes_manager.signal_shape[::-1]

# Create indexer and perform Hough indexing
indexer = ebsd_index.EBSDIndexer(
    vendor="KIKUCHIPY",
    sampleTilt=s.detector.sample_tilt,
    camElev=s.detector.tilt,
    patDim=sig_shape
)
data, *_ = indexer.index_pats(
    s.data.reshape((-1,) + sig_shape), PC=s.detector.pc.reshape((-1, 3))
)

# Store results in a crystal map and save in an .ang file
rot = Rotation(data[-1]["quat"])
phase = Phase(
    "al",
    space_group=225,
    structure=Structure(lattice=Lattice(0.404, 0.404, 0.404, 90, 90, 90))
)
y, x = np.indices(nav_shape)
xmap = CrystalMap(
    rotations=rot,
    x=x.flatten() * s.axes_manager["x"].scale,
    y=y.flatten() * s.axes_manager["y"].scale,
    phase_list=PhaseList(phase),
    prop=dict(
        pq=data[-1]["pq"],  # Pattern quality
        cm=data[-1]["cm"],  # Confidence metric
        fit=data[-1]["fit"],  # Pattern fit
        nmatch=data[-1]["nmatch"],  # Number of detected bands matched
    ),
)
io.save(os.path.join(dir_data, fname + "_hi.ang"), xmap)

# Inspect results using geometrical simulations
ref = ReciprocalLatticeVector(
    phase=phase, hkl=[[1, 1, 1], [2, 0, 0], [2, 2, 0], [3, 1, 1]]
)
ref = ref.symmetrise().unique()
simulator = kp.simulations.KikuchiPatternSimulator(ref)
sim = simulator.on_detector(s.detector, xmap.rotations.reshape(*xmap.shape))

# Create IPF-Z map
ckey = plot.IPFColorKeyTSL(phase.point_group)
rgbz = ckey.orientation2color(xmap.orientations).reshape(nav_shape + (3,))
map_rgbz = kp.draw.get_rgb_navigator(rgbz)

# Navigate patterns in IPF-Z map with geometrical simulations
s.plot(navigator=map_rgbz)
s.add_marker(sim.as_markers())

Here are some further tutorials of Hough indexing with PyEBSDIndex:

EMsoft PC requirement of four parameters (including pixel size)

Hi @drowenhorst-nrl,

I see that passing the EMsoft PC requires four numbers, including the pixel size:

if len(shapet) < 2:
pctemp = np.tile(pctemp, nPats).reshape(nPats,4)
else:
if shapet[0] != nPats:
pctemp = np.tile(pctemp[0,:], nPats).reshape(nPats,4)
t = pctemp[:,0:3]
t[:,2] /= pctemp[:,3] # normalize by pixel size

Might it be simpler to ask the user to normalize the final PC parameter L with the pixel size themselves? Even though the PC is then not strictly the EMsoft PC anymore.

On a side note, it was a bit of a hassle to obtain the pixel size on our (NORDIF) detectors when first starting out using EMsoft at NTNU (detaching the detector and imaging a transparent millimeter grid). Also, when reimplementing dictionary indexing in kikuchipy, we found that we don't need the pixel size to project parts of a master pattern onto the detector.

np.float() errors with Numba 0.57.0

Got this TypingError when doing with NumPy 1.24.3 and Numba 0.57.0

>>> from pyebsdindex import ebsd_index, pcopt
---------------------------------------------------------------------------
TypingError                               Traceback (most recent call last)
Cell In[4], line 1
----> 1 from pyebsdindex import pcopt, ebsd_index

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/ebsd_index.py:26
     23 """Setup and handling of Hough indexing runs of EBSD patterns."""
     25 from pyebsdindex import _ray_installed
---> 26 from pyebsdindex._ebsd_index_single import EBSDIndexer, index_pats
     28 if _ray_installed:
     29     from pyebsdindex._ebsd_index_parallel import index_pats_distributed, IndexerRay

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/_ebsd_index_single.py:32
     29 import numpy as np
     30 import h5py
---> 32 from pyebsdindex import (
     33     band_vote,
     34     ebsd_pattern,
     35     rotlib,
     36     tripletlib,
     37     _pyopencl_installed,
     38 )
     40 if _pyopencl_installed:
     41     from pyebsdindex.opencl import band_detect_cl as band_detect

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/band_vote.py:32
     29 import numba
     30 import numpy as np
---> 32 from pyebsdindex import rotlib
     35 RADEG = 180.0/np.pi
     37 tempdir = PurePath("/tmp" if platform.system() == "Darwin" else tempfile.gettempdir())

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/rotlib.py:1346
   1341     xyzba[2] = sXYZ[0]
   1342   return xyzba
   1345 @numba.jit(['f8[:](f8[:])','f8[:](f4[:])'], nopython=True,fastmath=nbFastmath, cache=nbcache)
-> 1346 def lambert3DBallToCube(xyz):
   1347   LPR1 = np.float(1.33067003949147) # (3pi/4)**(1/3)
   1348   LPpref = np.float(1.38197659788534) # sqrt(6/pi)

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/decorators.py:241, in _jit.<locals>.wrapper(func)
    239     with typeinfer.register_dispatcher(disp):
    240         for sig in sigs:
--> 241             disp.compile(sig)
    242         disp.disable_compile()
    243 return disp

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/dispatcher.py:965, in Dispatcher.compile(self, sig)
    963 with ev.trigger_event("numba:compile", data=ev_details):
    964     try:
--> 965         cres = self._compiler.compile(args, return_type)
    966     except errors.ForceLiteralArg as e:
    967         def folded(args, kws):

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/dispatcher.py:129, in _FunctionCompiler.compile(self, args, return_type)
    127     return retval
    128 else:
--> 129     raise retval

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/dispatcher.py:139, in _FunctionCompiler._compile_cached(self, args, return_type)
    136     pass
    138 try:
--> 139     retval = self._compile_core(args, return_type)
    140 except errors.TypingError as e:
    141     self._failed_cache[key] = e

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/dispatcher.py:152, in _FunctionCompiler._compile_core(self, args, return_type)
    149 flags = self._customize_flags(flags)
    151 impl = self._get_implementation(args, {})
--> 152 cres = compiler.compile_extra(self.targetdescr.typing_context,
    153                               self.targetdescr.target_context,
    154                               impl,
    155                               args=args, return_type=return_type,
    156                               flags=flags, locals=self.locals,
    157                               pipeline_class=self.pipeline_class)
    158 # Check typing error if object mode is used
    159 if cres.typing_error is not None and not flags.enable_pyobject:

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler.py:742, in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class)
    718 """Compiler entry point
    719 
    720 Parameter
   (...)
    738     compiler pipeline
    739 """
    740 pipeline = pipeline_class(typingctx, targetctx, library,
    741                           args, return_type, flags, locals)
--> 742 return pipeline.compile_extra(func)

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler.py:460, in CompilerBase.compile_extra(self, func)
    458 self.state.lifted = ()
    459 self.state.lifted_from = None
--> 460 return self._compile_bytecode()

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler.py:528, in CompilerBase._compile_bytecode(self)
    524 """
    525 Populate and run pipeline for bytecode input
    526 """
    527 assert self.state.func_ir is None
--> 528 return self._compile_core()

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler.py:507, in CompilerBase._compile_core(self)
    505         self.state.status.fail_reason = e
    506         if is_final_pipeline:
--> 507             raise e
    508 else:
    509     raise CompilerError("All available pipelines exhausted")

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler.py:494, in CompilerBase._compile_core(self)
    492 res = None
    493 try:
--> 494     pm.run(self.state)
    495     if self.state.cr is not None:
    496         break

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py:368, in PassManager.run(self, state)
    365 msg = "Failed in %s mode pipeline (step: %s)" % \
    366     (self.pipeline_name, pass_desc)
    367 patched_exception = self._patch_error(msg, e)
--> 368 raise patched_exception

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py:356, in PassManager.run(self, state)
    354 pass_inst = _pass_registry.get(pss).pass_inst
    355 if isinstance(pass_inst, CompilerPass):
--> 356     self._runPass(idx, pass_inst, state)
    357 else:
    358     raise BaseException("Legacy pass in use")

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler_lock.py:35, in _CompilerLock.__call__.<locals>._acquire_compile_lock(*args, **kwargs)
     32 @functools.wraps(func)
     33 def _acquire_compile_lock(*args, **kwargs):
     34     with self:
---> 35         return func(*args, **kwargs)

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py:311, in PassManager._runPass(self, index, pss, internal_state)
    309     mutated |= check(pss.run_initialization, internal_state)
    310 with SimpleTimer() as pass_time:
--> 311     mutated |= check(pss.run_pass, internal_state)
    312 with SimpleTimer() as finalize_time:
    313     mutated |= check(pss.run_finalizer, internal_state)

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/compiler_machinery.py:273, in PassManager._runPass.<locals>.check(func, compiler_state)
    272 def check(func, compiler_state):
--> 273     mangled = func(compiler_state)
    274     if mangled not in (True, False):
    275         msg = ("CompilerPass implementations should return True/False. "
    276                "CompilerPass with name '%s' did not.")

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/typed_passes.py:110, in BaseTypeInference.run_pass(self, state)
    104 """
    105 Type inference and legalization
    106 """
    107 with fallback_context(state, 'Function "%s" failed type inference'
    108                       % (state.func_id.func_name,)):
    109     # Type inference
--> 110     typemap, return_type, calltypes, errs = type_inference_stage(
    111         state.typingctx,
    112         state.targetctx,
    113         state.func_ir,
    114         state.args,
    115         state.return_type,
    116         state.locals,
    117         raise_errors=self._raise_errors)
    118     state.typemap = typemap
    119     # save errors in case of partial typing

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/typed_passes.py:88, in type_inference_stage(typingctx, targetctx, interp, args, return_type, locals, raise_errors)
     86     infer.build_constraint()
     87     # return errors in case of partial typing
---> 88     errs = infer.propagate(raise_errors=raise_errors)
     89     typemap, restype, calltypes = infer.unify(raise_errors=raise_errors)
     91 # Output all Numba warnings

File ~/miniconda3/envs/kp-dev/lib/python3.10/site-packages/numba/core/typeinfer.py:1086, in TypeInferer.propagate(self, raise_errors)
   1083 force_lit_args = [e for e in errors
   1084                   if isinstance(e, ForceLiteralArg)]
   1085 if not force_lit_args:
-> 1086     raise errors[0]
   1087 else:
   1088     raise reduce(operator.or_, force_lit_args)

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Internal error at resolving type of attribute "float" of "$2load_global.0".
module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
During: typing of get attribute at /home/hakon/miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/rotlib.py (1347)
Enable logging at debug level for details.

File "../../../../miniconda3/envs/kp-dev/lib/python3.10/site-packages/pyebsdindex/rotlib.py", line 1347:
def lambert3DBallToCube(xyz):
  LPR1 = np.float(1.33067003949147) # (3pi/4)**(1/3)
  ^

Can fix this after next week, as I have a conference the coming week.

Demo dataset

Dear Dave Rowenhorst,

I want to practice analyzing with PyEBSDindex. However, I don't know where the datasets of example.up1 and SLMtest/scan2v3.up1 can be downloaded.
Please, provide their links for me.

Thank you.
Best regards,
Ngoc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.