Skip to content

feat!: remove the enums named like their modules - #47

Merged
Paullo9 merged 4 commits into
mainfrom
issue-10-module-names
Oct 30, 2026
Merged

Paullo9 merged 4 commits into
mainfrom
issue-10-module-names

Conversation

@Paullo9

@Paullo9 Paullo9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Fixes #10, together with #46. This branch is stacked on #46, so merge #46 first; its diff then shrinks to this one commit.

This is item 3 of the 29 Oct plan. enum CuboPtycho, enum CuboStrain and enum CuboEmbedding shared their module's names, so a module-qualified name such as CuboStrain.LatticeStrain did not resolve. Each enum held only the scope string that #41 deprecated, and nothing reads it. The plan suggested renaming them, but a renamed enum would be an empty namespace, so this PR removes them.

  • Removed: Sources/CuboStrain/CuboStrain.swift and Sources/CuboPtycho/CuboPtycho.swift. The enum in Sources/CuboEmbedding/CuboEmbedding.swift is gone; EmbeddingError stays.
  • Removed the CuboPtycho topic entry from the DocC catalog. The module pages are unchanged.
  • docs/open-items.md: the module-name clash is no longer listed.

Migration

CuboPtycho, CuboStrain and CuboEmbedding (the enums) and their deprecated scope are removed. Nothing replaces them. Module-qualified names such as CuboStrain.LatticeStrain now resolve. mac4DSTEM uses none of the three enums or scope (searched), so it needs no call-site change.

Tests

  • Consumer check: a new check compares CuboStrain.LatticeStrain, CuboPtycho.PtychographyError and CuboEmbedding.PCA with the unqualified types. It does not compile while the enums exist. It now passes, 152 checks with 0 failures.
  • swift test -c release --parallel --skip CuboKitParityTests: green.
  • Review (public API): done. It found no references left in the sources, DocC, docs or mac4DSTEM, and one spacing nit, which is fixed.

BEGIN_COMMIT_OVERRIDE
feat!: remove the enums named like their modules

BREAKING CHANGE: CuboPtycho, CuboStrain and CuboEmbedding (the enums) and their deprecated scope are removed; nothing replaces them. Module-qualified names such as CuboStrain.LatticeStrain now resolve. mac4DSTEM uses none of the three enums or scope, so it needs no call-site change.
END_COMMIT_OVERRIDE

🤖 Generated with Claude Code

Paullo9 and others added 2 commits October 30, 2026 10:23
…agnostics for a supplied basis

- SyntheticProbe.make takes centre: (row:, column:)? = nil. nil is py4DSTEM's (rows/2, columns/2) in Double, bit for bit as before; a pixel centre gives the pixel-centred disk exactly (tested against that construction on 25x23, 125x125 and 32x30).

- FloatFFT2D is public with rows, columns, init? and supports(rows:columns:); the transforms stay package access.

- LatticeStrain.consensusDiagnostics(_:basis:origin:minimumRadius:) scores a supplied basis (an initial basis) with the consensus's observations and Float32 scoring; for the chosen basis it equals chooseBasisConsensusResult exactly.

The consumer check gains three checks (it failed to build before this change); 151 pass.

Done: #10 items 1, 2 and 4. Next: item 3, the enums named like their modules, as its own breaking PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ain, CuboEmbedding)

Each held only the deprecated scope string, and its name shadowed the module, so a module-qualified name such as CuboStrain.LatticeStrain did not resolve. A renamed enum would be an empty namespace, so they are removed. The consumer check gains a module-qualified check that does not compile with the enums present.

Migration: CuboPtycho, CuboStrain and CuboEmbedding (the enums) and their deprecated scope are removed; nothing replaces them. Module-qualified names such as CuboStrain.LatticeStrain now resolve.

Done: #10 item 3, so all four plan items are in PRs. Next: mac4DSTEM deletes its centre interim and re-pins after the tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Oct 30, 2026
…odule-name check and the open item it closes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkKZEWLQDNR7GTJSa5geSZ
The merge took this branch's whole files for docs/open-items.md and the
consumer check. That dropped main's newer lstsq note and its renamed
consumer-check comments. Now both files are main's, plus this branch's
two changes: the module-name check, and the open item it closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkKZEWLQDNR7GTJSa5geSZ
@Paullo9
Paullo9 merged commit 2e4c0f6 into main Oct 30, 2026
8 checks passed
@Paullo9
Paullo9 deleted the issue-10-module-names branch October 30, 2026 12:56
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.

Small API asks from mac4DSTEM

2 participants