Skip to content

Fix equality of derived units and quantities to not depend on unit instance identity - #63

Merged
gcotelli merged 3 commits into
release-candidatefrom
devcontainer-setup
Sep 2, 2026
Merged

Fix equality of derived units and quantities to not depend on unit instance identity#63
gcotelli merged 3 commits into
release-candidatefrom
devcontainer-setup

Conversation

@gcotelli

@gcotelli gcotelli commented Sep 1, 2026

Copy link
Copy Markdown
Member

Fixes #62

Also adds a devcontainer setup

gcotelli and others added 3 commits September 1, 2026 18:05
Provide a reproducible development environment based on the
javascript-node devcontainer image, including shellcheck, yamllint and
markdownlint for linting, plus the Claude Code CLI.

Persist the shell history and the Claude configuration in named volumes,
and allow mounting a reference projects folder read-only via
REFERENCE_PROJECTS_DIR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DerivedDimension kept its exponents in an IdentityDictionary, so
occurrencesOf: looked up dimensions by == instead of =. Two derived
dimensions built from distinct but equal AccountDimension instances
reported the same dimensions yet different exponents, making them
unequal. That propagated to isCommensurableWith: and, in turn, to
Quantity comparison, addition and conversion.

Key the exponents by value using a plain Dictionary. Base physical
dimensions keep identity semantics, since they do not override = or
hash.

Closes #62

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gcotelli gcotelli self-assigned this Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ef268a0) to head (8b5447d).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           release-candidate       #63   +/-   ##
===================================================
  Coverage             100.00%   100.00%           
===================================================
  Files                     38        38           
  Lines                   4057      4114   +57     
===================================================
+ Hits                    4057      4114   +57     
Flag Coverage Δ
unit 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gcotelli
gcotelli merged commit 083a269 into release-candidate Sep 2, 2026
56 checks passed
@gcotelli
gcotelli deleted the devcontainer-setup branch September 2, 2026 18:54
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.

Equality of derived units and quantities depends on unit instance identity

2 participants