Skip to content

Commit e28e183

Browse files
authored
codespell (#165)
1 parent 37986af commit e28e183

24 files changed

+89
-89
lines changed

VERSIONS.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Release date: 2019.10.06
126126
New Features
127127
------------
128128

129-
* Support for ECOSTRESS spectral library (supercedes ASTER library).
129+
* Support for ECOSTRESS spectral library (supersedes ASTER library).
130130

131131
* Accept "mask" and "bg" keywords in `imshow` and `get_rgb` (affects color
132132
scaling).
@@ -189,7 +189,7 @@ Bug Fixes
189189
* Fixed a bug that potentially produced incorrect results in `map_class_ids`
190190
(issue #53).
191191

192-
* Removed unecessary import that cause python3 compatibility error in
192+
* Removed unnecessary import that cause python3 compatibility error in
193193
`aviris.open` (issue #54).
194194

195195
* Removed `has_key` call breaking python3 compatibility (issue #56).
@@ -439,7 +439,7 @@ Performance Improvements
439439
------------------------
440440

441441
* PerceptronClassifier is roughly an order of magnitude faster due to better
442-
use of numpy. Inputs are now scaled and weights are initialized withing the
442+
use of numpy. Inputs are now scaled and weights are initialized within the
443443
data limits, which usually results in fewer iterations for convergence.
444444

445445
================================================================================
@@ -490,7 +490,7 @@ New Features
490490
Performance Improvements
491491
------------------------
492492

493-
* Significant speedup for sevaral algorithms using ndarray inputs:
493+
* Significant speedup for several algorithms using ndarray inputs:
494494

495495
* 14x speedup for GMCL
496496

@@ -528,7 +528,7 @@ Changes
528528
Bug Fixes
529529
---------
530530

531-
* Exception occured when *bands* argument was not provided to `imshow`.
531+
* Exception occurred when *bands* argument was not provided to `imshow`.
532532

533533
* *stretch_all* parameter for `get_rgb` was sometimes being used when set to
534534
False or 0 (because it was not None).
@@ -572,7 +572,7 @@ Changes
572572
* If present, image band info is saved when `envi.save_image` is called.
573573

574574
* Allow calling :func:`~spectral.oi.envi.create_image` using keyword args
575-
instead of ENVI-specific header paramter names.
575+
instead of ENVI-specific header parameter names.
576576

577577
* `save_rgb` automatically determines the output file type, based on the
578578
filename extension.
@@ -748,7 +748,7 @@ Release date: 2012.07.15
748748

749749
- Bug Fixes
750750

751-
- Fixed a bug in several deprecation warnings that caused infinte recursion.
751+
- Fixed a bug in several deprecation warnings that caused infinite recursion.
752752

753753
- Fixed mismatch in parameter names in kmeans_ndarray.
754754

@@ -796,7 +796,7 @@ Release date: 2011.01.17
796796
- :meth:`spectral.kmeans` will accept a :exc:`KeyboardInterrupt` exception
797797
(i.e., CTRL-C) and return the results as of the previous iteration.
798798

799-
- Documention is now online via Sphinx.
799+
- Documentation is now online via Sphinx.
800800

801801
- Changes
802802

spectral/algorithms/algorithms.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def iterator_ij(mask, index=None):
147147
148148
If `index` is not defined, iteration is performed over all non-zero
149149
elements. If `index` is defined, iteration is performed over all
150-
coordinates for whch `mask[i,j] == index`.
150+
coordinates for which `mask[i,j] == index`.
151151
'''
152152

153153
if mask.ndim != 2:
@@ -271,7 +271,7 @@ def cov_avg(image, mask, weighted=True):
271271
`mask` (integer-valued ndarray):
272272
273273
Elements specify the classes associated with pixels in `image`.
274-
All pixels associeted with non-zero elements of `mask` will be
274+
All pixels associated with non-zero elements of `mask` will be
275275
used in the covariance calculation.
276276
277277
`weighted` (bool, default True):
@@ -1174,7 +1174,7 @@ def ndvi(data, red, nir):
11741174

11751175
def bdist(class1, class2):
11761176
'''
1177-
Calulates the Bhattacharyya distance between two classes.
1177+
Calculates the Bhattacharyya distance between two classes.
11781178
11791179
USAGE: bd = bdist(class1, class2)
11801180
@@ -1201,7 +1201,7 @@ def bdist(class1, class2):
12011201

12021202
def bdist_terms(a, b):
12031203
'''
1204-
Calulate the linear and quadratic terms of the Bhattacharyya distance
1204+
Calculate the linear and quadratic terms of the Bhattacharyya distance
12051205
between two classes.
12061206
12071207
USAGE: (linTerm, quadTerm) = bDistanceTerms(a, b)
@@ -1438,7 +1438,7 @@ def noise_from_diffs(X, direction='lowerright'):
14381438
14391439
`X` (np.ndarray):
14401440
1441-
The data from which to estimage noise statistics. `X` should have
1441+
The data from which to estimate noise statistics. `X` should have
14421442
shape `(nrows, ncols, nbands`).
14431443
14441444
`direction` (str, default "lowerright"):
@@ -1495,7 +1495,7 @@ def __init__(self, signal, noise, napc):
14951495
14961496
`napc` (:class:`~spectral.PrincipalComponents`):
14971497
1498-
Noise-Adjusted Pricipal Components
1498+
Noise-Adjusted Principal Components
14991499
'''
15001500
self.signal = signal
15011501
self.noise = noise
@@ -1592,7 +1592,7 @@ def reduce(self, X, **kwargs):
15921592
15931593
Threshold signal-to-noise ratio (SNR) to retain.
15941594
1595-
Returns a verions of `X` with reduced dimensionality.
1595+
Returns a versions of `X` with reduced dimensionality.
15961596
15971597
Note that calling this method is equivalent to calling the
15981598
`get_reduction_transform` method with same keyword and applying the
@@ -1725,13 +1725,13 @@ def ppi(X, niters, threshold=0, centered=False, start=None, display=0,
17251725
17261726
An optional array of initial purity indices. This can be used to
17271727
continue computing PPI values after a previous call to `ppi` (i.e.,
1728-
set `start` equal to the return value from a previou call to `ppi`.
1728+
set `start` equal to the return value from a previous call to `ppi`.
17291729
This should be an integer-valued array whose dimensions are equal
17301730
to the first two dimensions of `X`.
17311731
17321732
`display` (integer):
17331733
1734-
If set to a postive integer, a :class:`~spectral.graphics.spypylab.ImageView`
1734+
If set to a positive integer, a :class:`~spectral.graphics.spypylab.ImageView`
17351735
window will be opened and dynamically display PPI values as the
17361736
function iterates. The value specifies the number of PPI iterations
17371737
between display updates. It is recommended to use a value around
@@ -1751,7 +1751,7 @@ def ppi(X, niters, threshold=0, centered=False, start=None, display=0,
17511751
These keywords will be passed to the image display and only have an
17521752
effect if the `display` argument is nonzero.
17531753
1754-
This function can be interruped with a KeyboardInterrupt (ctrl-C), in which
1754+
This function can be interrupted with a KeyboardInterrupt (ctrl-C), in which
17551755
case, the most recent value of the PPI array will be returned. This can be
17561756
used in conjunction with the `display` argument to view the progression of
17571757
the PPI values until they appear stable, then terminate iteration using
@@ -1920,7 +1920,7 @@ def smacc(spectra, min_endmembers=None, max_residual_norm=float('Inf')):
19201920
for k in range(len(Fs)):
19211921
t = On * Fs[k][q[n]]
19221922
# This is not so important for the algorithm itself.
1923-
# These values correpond to values where On == 0.0, and these
1923+
# These values correspond to values where On == 0.0, and these
19241924
# will be zeroed out below. But to avoid divide-by-zero warning
19251925
# we set small values instead of zero.
19261926
t[t == 0.0] = 1e-10

spectral/algorithms/classifiers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class PerceptronClassifier(Perceptron, SupervisedClassifier):
284284
'''A multi-layer perceptron classifier with backpropagation learning.
285285
286286
Multi-layer perceptrons often require many (i.e., thousands) of iterations
287-
through the traning data to converge on a solution. Therefore, it is not
287+
through the training data to converge on a solution. Therefore, it is not
288288
recommended to attempt training a network on full-dimensional hyperspectral
289289
data or even on a full set of image pixels. It is likely preferable to
290290
first train the network on a subset of the data, then retrain the network

spectral/algorithms/clustering.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def kmeans(image, nclusters=10, max_iterations=20, **kwargs):
7272
7373
`class_map` (:class:`numpy.ndarray`):
7474
75-
An `MxN` array whos values are the indices of the cluster for the
75+
An `MxN` array who's values are the indices of the cluster for the
7676
corresponding element of `image`.
7777
7878
`centers` (:class:`numpy.ndarray`):
@@ -250,7 +250,7 @@ def kmeans_ndarray(image, nclusters=10, max_iterations=20, **kwargs):
250250
251251
`class_map` (:class:`numpy.ndarray`):
252252
253-
An `MxN` array whos values are the indices of the cluster for the
253+
An `MxN` array who's values are the indices of the cluster for the
254254
corresponding element of `image`.
255255
256256
`centers` (:class:`numpy.ndarray`):

spectral/algorithms/continuum.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Continuum is defined as convex hull of spectrum.
55
Continuum is removed from spectra by dividing spectra by its continuum.
66
That results in values between 0 and 1, where absorption bands are expressed as
7-
drops below 1. It is usefull for comparing and classification based on
7+
drops below 1. It is useful for comparing and classification based on
88
absorption bands and indifferent to scale.
99
1010
References:
@@ -239,13 +239,13 @@ def continuum_points(spectrum, bands, mode='convex'):
239239
1d :class:`numpy.ndarray`, holding band values of spectra.
240240
Length of `bands` should be the same as `spectrum`.
241241
Note that bands should be sorted in ascending order (which is often
242-
not the case with AVIRIS), otherwise unexpected results could occure.
242+
not the case with AVIRIS), otherwise unexpected results could occur.
243243
244244
`mode` (string, default 'convex'):
245245
246246
Default mode is 'convex' which returns convex upper hull of the
247247
spectrum. Another supported mode is 'segmented' which builds
248-
segmented upper hull. This is usefull to identify more detailed
248+
segmented upper hull. This is useful to identify more detailed
249249
contour of the spectrum, but without strong absorption bands.
250250
251251
Returns:
@@ -286,13 +286,13 @@ def spectral_continuum(spectra, bands, mode='convex', out=None):
286286
1d :class:`numpy.ndarray`, holding band values of spectra.
287287
Length of `bands` should be the same as last dimension of `spectra`.
288288
Note that bands should be sorted in ascending order (which is often
289-
not the case with AVIRIS), otherwise unexpected results could occure.
289+
not the case with AVIRIS), otherwise unexpected results could occur.
290290
291291
`mode` (string, default 'convex'):
292292
293293
Default mode is 'convex' which returns convex upper hull of the
294294
spectrum. Another supported mode is 'segmented' which builds
295-
segmented upper hull. This is usefull to identify more detailed
295+
segmented upper hull. This is useful to identify more detailed
296296
contour of the spectrum, but without strong absorption bands.
297297
298298
`out` (:class:`numpy.ndarray`, default None):
@@ -313,7 +313,7 @@ def spectral_continuum(spectra, bands, mode='convex', out=None):
313313
def remove_continuum(spectra, bands, mode='convex', out=None):
314314
'''Returns spectra with continuum removed.
315315
Continuum is defined as convex hull of spectra. Continuum is removed from
316-
spectra by deviding spectra by its continuum.
316+
spectra by dividing spectra by its continuum.
317317
318318
Arguments:
319319
@@ -327,13 +327,13 @@ def remove_continuum(spectra, bands, mode='convex', out=None):
327327
1d :class:`numpy.ndarray`, holding band values of spectra.
328328
Length of `bands` should be the same as last dimension of `spectra`.
329329
Note that bands should be sorted in ascending order (which is often
330-
not the case with AVIRIS), otherwise unexpected results could occure.
330+
not the case with AVIRIS), otherwise unexpected results could occur.
331331
332332
`mode` (string, default 'convex'):
333333
334334
Default mode is 'convex' which removes convex upper hull of the
335335
spectrum. Another supported mode is 'segmented' which removes
336-
segmented upper hull. This is usefull to identify two or more small
336+
segmented upper hull. This is useful to identify two or more small
337337
features instead of one large feature.
338338
339339
`out` (:class:`numpy.ndarray`, default None):

spectral/algorithms/detectors.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def matched_filter(X, target, background=None, window=None, cov=None):
124124
125125
Must have the form (`inner`, `outer`), where the two values
126126
specify the widths (in pixels) of inner and outer windows centered
127-
about the pixel being evaulated. Both values must be odd integers.
127+
about the pixel being evaluated. Both values must be odd integers.
128128
The background mean and covariance will be estimated from pixels
129129
in the outer window, excluding pixels within the inner window. For
130130
example, if (`inner`, `outer`) = (5, 21), then the number of
@@ -319,7 +319,7 @@ def rx(X, background=None, window=None, cov=None):
319319
320320
Must have the form (`inner`, `outer`), where the two values
321321
specify the widths (in pixels) of inner and outer windows centered
322-
about the pixel being evaulated. Both values must be odd integers.
322+
about the pixel being evaluated. Both values must be odd integers.
323323
The background mean and covariance will be estimated from pixels
324324
in the outer window, excluding pixels within the inner window. For
325325
example, if (`inner`, `outer`) = (5, 21), then the number of
@@ -407,7 +407,7 @@ def __init__(self, target, background=None, **kwargs):
407407
`vectorize` (bool, default True):
408408
409409
Specifies whether the __call__ method should attempt to vectorize
410-
operations. This typicall results in faster computation but will
410+
operations. This typically results in faster computation but will
411411
consume more memory.
412412
'''
413413
for k in kwargs:
@@ -564,7 +564,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
564564
The return value will be an ndarray with shape (R, C).
565565
566566
A length-D sequence (e.g., list or tuple) of length-B ndarrays.
567-
In this case, the detector will be applied seperately to each of
567+
In this case, the detector will be applied separately to each of
568568
the `D` targets. This is equivalent to calling the function
569569
sequentially for each target and stacking the results but is
570570
much faster. The return value will be an ndarray with shape
@@ -580,7 +580,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
580580
581581
Must have the form (`inner`, `outer`), where the two values
582582
specify the widths (in pixels) of inner and outer windows centered
583-
about the pixel being evaulated. Both values must be odd integers.
583+
about the pixel being evaluated. Both values must be odd integers.
584584
The background mean and covariance will be estimated from pixels
585585
in the outer window, excluding pixels within the inner window. For
586586
example, if (`inner`, `outer`) = (5, 21), then the number of
@@ -615,7 +615,7 @@ def ace(X, target, background=None, window=None, cov=None, **kwargs):
615615
`vectorize` (bool, default True):
616616
617617
Specifies whether the function should attempt to vectorize
618-
operations. This typicall results in faster computation but will
618+
operations. This typically results in faster computation but will
619619
consume more memory.
620620
621621
Returns numpy.ndarray:

spectral/algorithms/perceptron.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, shape, k=1.0, weights=None):
4747
def randomize_weights(self):
4848
'''Randomizes the layer weight matrix.
4949
The bias weight will be in the range [0, 1). The remaining weights will
50-
correspond to a vector with unit length and uniform random orienation.
50+
correspond to a vector with unit length and uniform random orientation.
5151
'''
5252
self.weights = 1. - 2. * np.random.rand(*self.shape)
5353
for row in self.weights:

spectral/algorithms/spatial.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def map_window(func, image, window, rslice=(None,), cslice=(None,),
192192
`border` (string, default "shift"):
193193
194194
Indicates how to handles windows near the edge of the window. If
195-
the value is "shift", the window dimensions will alway be
195+
the value is "shift", the window dimensions will always be
196196
`(width, height)` but near the image border the pixel being
197197
iterated will be offset from the center of the window. If set to
198198
"clip", window regions falling outside the image border will be
@@ -331,7 +331,7 @@ def map_outer_window_stats(func, image, inner, outer, dim_out=1, cov=None,
331331

332332

333333
class WindowedGaussianBackgroundMapper(object):
334-
'''A class for procucing window statistics with an inner exclusion window.
334+
'''A class for producing window statistics with an inner exclusion window.
335335
'''
336336
def __init__(self, inner, outer, function=None, cov=None, dim_out=None,
337337
dtype=None):
@@ -341,11 +341,11 @@ def __init__(self, inner, outer, function=None, cov=None, dim_out=None,
341341
342342
`inner` (integer or 2-tuple of integers):
343343
344-
Width and heigth of inner window, in pixels.
344+
Width and height of inner window, in pixels.
345345
346346
`outer` (integer or 2-tuple of integers):
347347
348-
Width and heigth of outer window, in pixels. Dimensions must
348+
Width and height of outer window, in pixels. Dimensions must
349349
be greater than inner window
350350
351351
`function` (callable object):

spectral/algorithms/spymath.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_histogram_cdf_points(data, cdf_vals, ignore=None, mask=None):
6767
`ignore` (numeric, default `None`):
6868
6969
A scalar value that should be ignored when computing histogram
70-
points (e.g., a value that indicates bad data). If this valus is
70+
points (e.g., a value that indicates bad data). If this value is
7171
not specified, all data are used.
7272
7373
Return value:

spectral/algorithms/transforms.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, A, **kwargs):
3939
4040
An (J,K) array to be applied to length-K targets.
4141
42-
Keyword Argments:
42+
Keyword Arguments:
4343
4444
`pre` (scalar or length-K sequence):
4545
@@ -58,7 +58,7 @@ def __init__(self, A, **kwargs):
5858
self._post = kwargs.get('post', None)
5959
A = np.array(A, copy=True)
6060
if A.ndim == 0:
61-
# Do not know input/ouput dimensions
61+
# Do not know input/output dimensions
6262
self._A = A
6363
(self.dim_out, self.dim_in) = (None, None)
6464
else:

0 commit comments

Comments
 (0)