Skip to content

Commit 279df3a

Browse files
Merge pull request #229 from yarikoptic:enh-codespell
PiperOrigin-RevId: 750271007 Change-Id: I920086dc83dd6d20f06b9addb8abb1ec0fefe23a
2 parents ebb8815 + db0c39e commit 279df3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+137
-111
lines changed

bazelisk.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,19 @@ def read_remote_text_file(url):
170170

171171

172172
def get_version_history(bazelisk_directory):
173-
return sorted(
174-
(
175-
release["tag_name"]
176-
for release in get_releases_json(bazelisk_directory)
177-
if not release["prerelease"]
178-
),
179-
# This only handles versions with numeric components, but that is fine
180-
# since prerelease verisons have been excluded.
181-
key=lambda version: tuple(int(component)
182-
for component in version.split('.')),
183-
reverse=True,
184-
)
173+
return sorted(
174+
(
175+
release["tag_name"]
176+
for release in get_releases_json(bazelisk_directory)
177+
if not release["prerelease"]
178+
),
179+
# This only handles versions with numeric components, but that is fine
180+
# since prerelease versions have been excluded.
181+
key=lambda version: tuple(
182+
int(component) for component in version.split(".")
183+
),
184+
reverse=True,
185+
)
185186

186187

187188
def resolve_latest_version(version_history, offset):

docs/conf.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ def _python_type_to_xref(
363363
'desc': 'C++ class',
364364
},
365365
'absl::StatusOr': {
366-
'url': 'https://abseil.io/docs/cpp/guides/statuss#returning-a-status-or-a-value',
366+
'url': (
367+
'https://abseil.io/docs/cpp/guides/status#returning-a-status-or-a-value'
368+
),
367369
'object_type': 'class',
368370
'desc': 'C++ class',
369371
},
@@ -378,22 +380,30 @@ def _python_type_to_xref(
378380
'desc': 'C++ enumeration',
379381
},
380382
'absl::Time': {
381-
'url': 'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime',
383+
'url': (
384+
'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime'
385+
),
382386
'object_type': 'class',
383387
'desc': 'C++ class',
384388
},
385389
'absl::InfiniteFuture': {
386-
'url': 'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime',
390+
'url': (
391+
'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime'
392+
),
387393
'object_type': 'function',
388394
'desc': 'C++ function',
389395
},
390396
'absl::InfinitePast': {
391-
'url': 'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime',
397+
'url': (
398+
'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime'
399+
),
392400
'object_type': 'function',
393401
'desc': 'C++ function',
394402
},
395403
'absl::Now': {
396-
'url': 'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime',
404+
'url': (
405+
'https://abseil.io/docs/cpp/guides/time#absolute-times-with-absltime'
406+
),
397407
'object_type': 'function',
398408
'desc': 'C++ function',
399409
},
@@ -403,12 +413,16 @@ def _python_type_to_xref(
403413
'desc': 'C++ class',
404414
},
405415
'absl::Cord': {
406-
'url': 'https://github.com/abseil/abseil-cpp/blob/master/absl/strings/cord.h',
416+
'url': (
417+
'https://github.com/abseil/abseil-cpp/blob/master/absl/strings/cord.h'
418+
),
407419
'object_type': 'class',
408420
'desc': 'C++ class',
409421
},
410422
'absl::AnyInvocable': {
411-
'url': 'https://github.com/abseil/abseil-cpp/blob/master/absl/functional/any_invocable.h',
423+
'url': (
424+
'https://github.com/abseil/abseil-cpp/blob/master/absl/functional/any_invocable.h'
425+
),
412426
'object_type': 'class',
413427
'desc': 'C++ class',
414428
},

docs/doctest_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
This allows doctest examples to be conveniently updated in case of changes to
1717
the output format.
1818
19-
After commiting or staging changes, you can run this with the `--in-place`
19+
After committing or staging changes, you can run this with the `--in-place`
2020
option and then inspect the diff.
2121
2222
This supports top-level `await` in tests, since that provides a convenient way
@@ -327,7 +327,7 @@ def _ast_asyncify(code: str, wrapper_name: str) -> ast.Module:
327327
This is derived from a similar workaround in IPython.
328328
329329
Args:
330-
code: Python source code to pase.
330+
code: Python source code to pass.
331331
wrapper_name: Name to use for function.
332332
333333
Returns:

docs/environment.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Debugging
9696
Enables debug logging for tensorstore internal subsystems. Set to comma
9797
separated list of values, where each value is one of ``name=int`` or just
9898
``name``. When ``all`` is, present, then verbose logging will be enabled for
99-
each subsytem, otherwise logging is set only for those subsystems present in
99+
each subsystem, otherwise logging is set only for those subsystems present in
100100
the list.
101101

102102
Verbose flag values include: ``curl``, ``distributed``, ``file``,

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ The following CMake generators are supported:
264264
- Ninja and Ninja Multi-Config
265265
- Makefile generators
266266
- Visual Studio generators
267-
- Xcode (targetting arm64 only)
267+
- Xcode (targeting arm64 only)
268268

269269
The Ninja generator is recommended because it provides the fastest builds.
270270

docs/python/indexing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ Ellipsis
423423

424424
Specifying the special `Ellipsis` value (:python:`...`) is equivalent
425425
to specifying as many full slices :python:`:` as needed to consume the
426-
remaining dimensions of the original domin not consumed by other
426+
remaining dimensions of the original domain not consumed by other
427427
indexing terms:
428428

429429
.. doctest::

docs/schema_schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ definitions:
8080
- A numerical :literal:`multiplier`, represented as a `double-precision
8181
floating-point number
8282
<https://en.wikipedia.org/wiki/Double-precision_floating-point_format>`_.
83-
A multiplier of ``1`` may be used to indicate a quanity equal to a
83+
A multiplier of ``1`` may be used to indicate a quantity equal to a
8484
single base unit.
8585
8686
- A :literal:`base_unit`, represented as a string. An empty string may be used

examples/BUILD

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ tensorstore_cc_binary(
6363
srcs = ["image_convolution.cc"],
6464
deps = [
6565
"//tensorstore:array",
66+
"//tensorstore:box",
67+
"//tensorstore:contiguous_layout",
68+
"//tensorstore:data_type",
6669
"//tensorstore:index",
67-
"//tensorstore/index_space:dim_expression",
68-
"//tensorstore/index_space:transformed_array",
6970
"//tensorstore/util:iterate_over_index_range",
70-
"//tensorstore/util:status",
71+
"//tensorstore/util:span",
7172
"@com_google_absl//absl/functional:function_ref",
7273
],
7374
)

examples/image_convolution.cc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <stddef.h>
16+
1517
#include <algorithm>
18+
#include <array>
19+
#include <cassert>
20+
#include <cstring>
1621
#include <iostream>
22+
#include <utility>
1723

1824
#include "absl/functional/function_ref.h"
1925
#include "tensorstore/array.h"
26+
#include "tensorstore/box.h"
27+
#include "tensorstore/contiguous_layout.h"
28+
#include "tensorstore/data_type.h"
2029
#include "tensorstore/index.h"
21-
#include "tensorstore/index_space/dim_expression.h"
22-
#include "tensorstore/index_space/transformed_array.h"
2330
#include "tensorstore/util/iterate_over_index_range.h"
24-
#include "tensorstore/util/status.h"
31+
#include "tensorstore/util/span.h"
2532

2633
using ::tensorstore::Index;
2734

@@ -34,7 +41,7 @@ tensorstore::SharedArray<int, 2> ApplyKernel(
3441
const tensorstore::ArrayView<const int, 2> in,
3542
const tensorstore::ArrayView<const double, 2> kernel) {
3643
// Compute bounds for the offset.
37-
// FIXME: It's akward that we cannot do this:
44+
// FIXME: It's awkward that we cannot do this:
3845
// std::array<Index, 2> k(kernel.shape());
3946
//
4047
std::array<Index, 2> k;
@@ -80,7 +87,7 @@ tensorstore::SharedArray<int, 2> ApplyKernel(
8087
}
8188
});
8289

83-
// Again, the most intutive way to write an array value
90+
// Again, the most intuitive way to write an array value
8491
// is not permitted:
8592
//
8693
// dest[indices] = (sum / count); // error: no viable overloaded '='
@@ -154,7 +161,7 @@ void AffineWarpGrid(size_t xmax, size_t ymax,
154161
}
155162

156163
// AffineWarpInverseGrid computes the inverse mapping from AffineWarpGrid,
157-
// so it can be used to map from a destination image to a souce image.
164+
// so it can be used to map from a destination image to a source image.
158165
void AffineWarpInverseGrid(size_t xmax, size_t ymax,
159166
tensorstore::span<const double, 6> M,
160167
AffineWarpGridFunction fn) {
@@ -237,7 +244,7 @@ void PrintCSVArray(tensorstore::ArrayView<T, N> data) {
237244
// reference for every element.
238245
//
239246
// There is a streaming operator already, but the output is
240-
// this is equvalent to:
247+
// this is equivalent to:
241248
// for (int x = 0; x < data.shape()[0]; x++)
242249
// for (int y = 0; y < data.shape()[1]; y++) {
243250
// ... body ...

python/tensorstore/keyword_arguments.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/// This mechanism allows individual keyword arguments to be defined as
2424
/// `ParamDef` types, that specifies the name, documentation, argument type, and
2525
/// operation to perform to "apply" the argument. These `ParamDef` types can
26-
/// then be re-used by multiple pybind11 functions while avoiding duplication.
26+
/// then be reused by multiple pybind11 functions while avoiding duplication.
2727
///
2828
/// Each `ParamDef` type should be a struct with the following members, and no
2929
/// non-static data members (i.e. it should be empty):
@@ -52,12 +52,13 @@
5252
#include <pybind11/pybind11.h>
5353
// Other headers must be included after pybind11 to ensure header-order
5454
// inclusion constraints are satisfied.
55+
#include <string>
5556
#include <string_view>
5657

5758
#include "absl/strings/ascii.h"
5859
#include "absl/strings/str_split.h"
5960
#include "python/tensorstore/status.h"
60-
#include "python/tensorstore/type_name_override.h"
61+
#include "python/tensorstore/type_name_override.h" // IWYU pragma: keep
6162
#include "tensorstore/util/status.h"
6263
#include "tensorstore/util/str_cat.h"
6364

0 commit comments

Comments
 (0)