Skip to content

Rename internal snake_case identifiers to camelCase#387

Merged
manzt merged 2 commits intomainfrom
push-plxmymllvmkz
Apr 9, 2026
Merged

Rename internal snake_case identifiers to camelCase#387
manzt merged 2 commits intomainfrom
push-plxmymllvmkz

Conversation

@manzt
Copy link
Copy Markdown
Owner

@manzt manzt commented Apr 9, 2026

The codebase inherited Python-style snake_case naming from zarr-python, which created confusion about what is a zarr metadata field versus an internal API. This change draws a clear boundary: zarr metadata types (ArrayMetadata, GroupMetadata, CodecMetadata, etc.) retain snake_case because they represent the on-disk JSON format, while all internal function names, variable names, and interface properties use idiomatic TypeScript camelCase.

The most visible breaking change is CreateArrayOptions, whose properties move to camelCase:

await zarr.create(store, {
  dtype: "float32",       // was data_type
  shape: [100, 100],
  chunkShape: [10, 10],   // was chunk_shape
  fillValue: 0,           // was fill_value
})

Internal exports consumed by @zarrita/ndarray are also renamed (_zarrita_internal_getStrides, _zarrita_internal_sliceIndices), and the Setter type properties become setScalar/setFromChunk.

Also closes #217

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 6020ad4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
zarrita Minor
@zarrita/ndarray Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@manzt manzt force-pushed the push-plxmymllvmkz branch from 7f9bb38 to ce90702 Compare April 9, 2026 11:14
The codebase inherited Python-style snake_case naming from zarr-python,
which created confusion about what is a zarr metadata field versus an
internal API. This change draws a clear boundary: zarr metadata types
(`ArrayMetadata`, `GroupMetadata`, `CodecMetadata`, etc.) retain
snake_case because they represent the on-disk JSON format, while all
internal function names, variable names, and interface properties use
idiomatic TypeScript camelCase.

The most visible breaking change is `CreateArrayOptions`, whose
properties move to camelCase:

    await zarr.create(store, {
      shape: [100, 100],
      chunkShape: [10, 10],   // was chunk_shape
      dataType: "float32",    // was data_type
      fillValue: 0,           // was fill_value
    })

Internal exports consumed by `@zarrita/ndarray` are also renamed
(`_zarrita_internal_getStrides`, `_zarrita_internal_sliceIndices`), and
the `Setter` type properties become `setScalar`/`setFromChunk`.
@manzt manzt force-pushed the push-plxmymllvmkz branch from ce90702 to b4e7cdf Compare April 9, 2026 11:15
CreateArrayOptions properties are now camelCase (chunkShape, fillValue,
chunkSeparator, dimensionNames). Array getters keep dtype and chunks to
match zarr-python.
@manzt manzt force-pushed the push-plxmymllvmkz branch from 3467ce8 to 6020ad4 Compare April 9, 2026 11:34
@manzt manzt merged commit 7d9224e into main Apr 9, 2026
2 checks passed
@manzt manzt deleted the push-plxmymllvmkz branch April 9, 2026 11:35
@github-actions github-actions bot mentioned this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cookbook docs not consistent

1 participant