Skip to content

Commit d871f5f

Browse files
Merge pull request #1267 from WilliamJamieson/feature/codespell
1 parent e876fc3 commit d871f5f

File tree

13 files changed

+30
-16
lines changed

13 files changed

+30
-16
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ repos:
2727
- id: rst-inline-touching-normal
2828
- id: text-unicode-replacement-char
2929

30+
- repo: https://github.com/codespell-project/codespell
31+
rev: v2.2.2
32+
hooks:
33+
- id: codespell
34+
args: ["--write-changes"]
35+
additional_dependencies:
36+
- tomli
37+
3038
- repo: https://github.com/charliermarsh/ruff-pre-commit
3139
rev: 'v0.0.170'
3240
hooks:

asdf/_display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def _render(self, info, active_depths, is_tail):
191191
192192
is_tail indicates if the child is the last of the children,
193193
needed to indicate the proper connecting character in the tree
194-
display. Likewise, active_depths is used to track which preceeding
194+
display. Likewise, active_depths is used to track which preceding
195195
depths are incomplete thus need continuing lines preceding in
196196
the tree display.
197197
"""

asdf/asdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def _parse_header_line(cls, line):
754754
try:
755755
version = versioning.AsdfVersion(parts[1].decode("ascii"))
756756
except ValueError:
757-
raise ValueError(f"Unparseable version in ASDF file: {parts[1]}")
757+
raise ValueError(f"Unparsable version in ASDF file: {parts[1]}")
758758

759759
return version
760760

@@ -947,7 +947,7 @@ def _open_generic_file(
947947
try:
948948
# TODO: this feels a bit circular, try to clean up. Also
949949
# this introduces another dependency on astropy which may
950-
# not be desireable.
950+
# not be desirable.
951951
from . import fits_embed
952952

953953
return fits_embed.AsdfInFits._open_impl(

asdf/block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def add_inline(self, array):
757757

758758
def get_output_compressions(self):
759759
"""
760-
Get the list of unqiue compressions used on blocks.
760+
Get the list of unique compressions used on blocks.
761761
"""
762762
return list({b.output_compression for b in self.blocks})
763763

@@ -820,7 +820,7 @@ def __init__(self, data=None, uri=None, array_storage="internal", memmap=True, l
820820
self._allocated = self._size
821821

822822
def __repr__(self):
823-
return "<Block {} off: {} alc: {} siz: {}>".format(
823+
return "<Block {} off: {} alc: {} size: {}>".format(
824824
self._array_storage[:3], self._offset, self._allocated, self._size
825825
)
826826

@@ -904,7 +904,7 @@ def output_compression(self, compression):
904904
@property
905905
def output_compression_kwargs(self):
906906
"""
907-
The configuration options to the Compressor constructur
907+
The configuration options to the Compressor constructor
908908
used to write the block.
909909
:return:
910910
"""

asdf/tags/core/ndarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def to_tree(cls, data, ctx):
436436
block = ctx.blocks.find_or_create_block_for_array(data, ctx)
437437

438438
if block.array_storage == "fits":
439-
# Views over arrays stored in FITS files have some idiosyncracies.
439+
# Views over arrays stored in FITS files have some idiosyncrasies.
440440
# astropy.io.fits always writes arrays C-contiguous with big-endian
441441
# byte order, whereas asdf preserves the "contiguousity" and byte order
442442
# of the base array.

asdf/tags/core/tests/test_external_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def test_roundtrip_external_array(tmpdir):
6-
ref = ExternalArrayReference("./nonexistant.fits", 1, "np.float64", (100, 100))
6+
ref = ExternalArrayReference("./nonexistent.fits", 1, "np.float64", (100, 100))
77

88
tree = {"nothere": ref}
99

asdf/tests/test_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_extension_proxy():
229229
with pytest.raises(TypeError):
230230
ExtensionProxy(FullExtension(compressors=[object()]))
231231

232-
# Unparseable ASDF Standard requirement:
232+
# Unparsable ASDF Standard requirement:
233233
with pytest.raises(ValueError):
234234
ExtensionProxy(FullExtension(asdf_standard_requirement="asdf-standard >= 1.4.0"))
235235

asdf/treeutil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def _handle_immutable_sequence(node, json_id):
356356
result._tag = node._tag
357357
except TypeError:
358358
# The derived class signature is different, so simply store the
359-
# list representing the contents. Currently this is primarly
359+
# list representing the contents. Currently this is primarily
360360
# intended to handle namedtuple and NamedTuple instances.
361361
if not ignore_implicit_conversion:
362362
warnings.warn(f"Failed to serialize instance of {type(node)}, converting to list instead", AsdfWarning)
@@ -384,7 +384,7 @@ def _recurse(node, json_id=None):
384384
# to the same object id.
385385
return _context[node]
386386

387-
# Inform the context that we're going to start modifing
387+
# Inform the context that we're going to start modifying
388388
# this node.
389389
with _context.pending(node):
390390
# Take note of the "id" field, in case we're modifying

asdf/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def incompatible_version(cls, version):
363363
compatible.
364364
365365
Child classes can override this method to affect how version
366-
compatiblity for this type is determined.
366+
compatibility for this type is determined.
367367
368368
Parameters
369369
----------

docs/asdf/arrays.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ see :ref:`config_options_array_inline_threshold`.
100100
Saving external arrays
101101
----------------------
102102

103-
ASDF files may also be saved in "exploded form", which creats multiple files
103+
ASDF files may also be saved in "exploded form", which creates multiple files
104104
corresponding to the following data items:
105105

106106
- One ASDF file containing only the header and tree.

0 commit comments

Comments
 (0)