Skip to content

Commit e2ca6db

Browse files
authored
Merge pull request #29 from yarikoptic/enh-codespell
Add codespell support (config, workflow to detect/not fix) and make it fix some typos
2 parents 5242a78 + ae27e11 commit e2ca6db

File tree

10 files changed

+45
-7
lines changed

10 files changed

+45
-7
lines changed

.github/workflows/codespell.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Codespell configuration is within pyproject.toml
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ repos:
4444
- id: mypy
4545
additional_dependencies: [types-requests==2.31.0.1]
4646
args: [--follow-imports=skip]
47+
48+
- repo: https://github.com/codespell-project/codespell
49+
# Configuration for codespell is in .pre-commit-config.yaml
50+
rev: v2.4.1
51+
hooks:
52+
- id: codespell

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ MicroJSON is compatible with any application or tool that process JSON data. Its
4242

4343
## Examples
4444

45-
Refer to the examples foler to see samples of MicroJSON files as well as a simple parsing example, or the [example in the documentation](docs/example.md)
45+
Refer to the examples folder to see samples of MicroJSON files as well as a simple parsing example, or the [example in the documentation](docs/example.md)
4646

4747
## Specification
4848

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A feature object represents a spatially bounded entity associated with propertie
4040
- `"geometry"`: A geometry object as defined in the section above or a JSON null value.
4141
- `"properties"`: (Optional) A JSON object containing properties and metadata specific to the feature, or a JSON null value. It consists of key-value pairs, where the key is a string and the value is a any JSON value. The value may be a string, number, array, object.
4242
- `"id"`: (Optional) A unique identifier for this feature.
43-
- `"ref"`: (Optional) A reference to an external resource, e.g. URI to a zarr strcture, e.g. "s3://zarr-demo/store/my_array.zarr".
43+
- `"ref"`: (Optional) A reference to an external resource, e.g. URI to a zarr structure, e.g. "s3://zarr-demo/store/my_array.zarr".
4444
- `"parentId"`: (Optional) A reference to the parent feature, e.g. the id of the feature that this feature is a part of.
4545
- `"feeatureClass"`: (Optional) A string indicating the class of the feature, e.g. "cell", "nucleus", "mitochondria", etc.
4646

docs/ome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ While TileJSON has traditionally been used in 2D applications, there is nothing
3333
2. Associate NGFF array chunks with tile indices (z/x/y) derived from spatial transformations, given the NGFF multiscale metadata and the corresponding TileJSON metadata.
3434
3. A practical observation is that if the multiscale pyramids differs, transformations between the two systems are needed, in addition to what is described above, which could be avoided by using the same multiscale pyramid structure in both systems. This is also valid for the tile size (expressed in the global coordinates), which should be the same in both systems for a specific zoom level.
3535
4. Layering of data is supported in TileJSON, as the array `vector_layers` in its schema. Layers are thus stored together for each tile, as a contrast to the NGFF, where the layers are stored in separate arrays as labeled images.
36-
5. The NGFF raster data hierarchy could be expressed with a TileJSON which does not have a vector layer but intead just maps the raster data endpoints as formatted in the field `tiles` in the TileJSON schema.
36+
5. The NGFF raster data hierarchy could be expressed with a TileJSON which does not have a vector layer but instead just maps the raster data endpoints as formatted in the field `tiles` in the TileJSON schema.
3737

3838
## Incorporating MicroJSON and Vector Tiles
3939

docs/provenance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The provenance model structure comprises `WorkflowCollection`, `Workflow`, `Arti
2121
- **Workflow Object:** Captures essential workflow details, including identifiers and descriptive metadata. This metadata links MicroJSON objects to their respective workflows.
2222
- **Artifact and Artifact Collection Objects:** Represent single files or directories and collections of these, respectively, providing a link between the physical data and the workflows.
2323
- **Workflow Provenance Object:** Details specific instances of workflow runs, including run identifiers, duration, operator, and the input/output parameters.
24-
Of these, Workflow, WorkflowCollection, Artifact, and ArtifactCollection can funtion as the top object in the provenance part of a MicroJSON file.
24+
Of these, Workflow, WorkflowCollection, Artifact, and ArtifactCollection can function as the top object in the provenance part of a MicroJSON file.
2525
- **MicroJSON Link Object:** Provides a link to a specific MicroJSON object, specifying which parts of the object's properties are pertinent to the workflow run. While this object is required, and the id property is required, the specification of a field in the MicroJSON object is optional. If no field is specified, the entire MicroJSON object is considered to be pertinent to the workflow run or artifact.
2626

2727
## Data Provenance and MicroJSON Traceability Link

microjson.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export interface MicroFeatureCollection {
247247
coordinateSystem?: CoordinateSystem | null;
248248
valueRange?: ValueRange;
249249
descriptive_fields?: DescriptiveFields;
250-
propertie?: Properties | null;
250+
property?: Properties | null;
251251
[k: string]: unknown;
252252
}
253253
/**

microjson_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469
"default": null,
470470
"title": "Descriptive Fields"
471471
},
472-
"propertie": {
472+
"property": {
473473
"anyOf": [
474474
{
475475
"$ref": "#/$defs/Properties"

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,10 @@ push = false
106106
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
107107
"src/microjson/__init__.py" = ["{version}"]
108108
".bumpversion.cfg" = ["current_version = {version}"]
109+
110+
[tool.codespell]
111+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
112+
skip = '.git*,invalid'
113+
check-hidden = true
114+
ignore-regex = '^\s*"image/\S+": ".*'
115+
# ignore-words-list = ''

src/microjson/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def segmentations_encodings(
206206
x: int,
207207
y: int,
208208
) -> tuple[Any, list[list[list[Any]]]]:
209-
"""Calculate object boundries as series of vertices/points
209+
"""Calculate object boundaries as series of vertices/points
210210
forming a polygon."""
211211
label, coordinates = [], []
212212
objects = ndimage.measurements.find_objects(label_image)

0 commit comments

Comments
 (0)