Skip to content

Redesign database API to match TwoBody.jl - #13

Merged
ohno merged 1 commit into
mainfrom
agent/redesign-database-api
Aug 12, 2026
Merged

Redesign database API to match TwoBody.jl#13
ohno merged 1 commit into
mainfrom
agent/redesign-database-api

Conversation

@ohno

@ohno ohno commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • align the core database API with TwoBody.jl using DatabaseEntry, put!, db, and dbkeys
  • preserve concrete numeric value types instead of storing results as strings
  • keep database and bibliography registries private, with validation for duplicate and unknown keys
  • retain bib, @get, and @bib for FewBodyDB-specific bibliography access and compatibility
  • update tests, README, and Documenter documentation
  • remove the no-longer-needed OrderedCollections dependency

Why

The previous implementation exposed mutable registries and relied on macros and slash-separated string values as its main interface. This redesign follows the lookup boundary and typed-entry design used by TwoBody.jl, while retaining FewBodyDB's provenance metadata and existing compatibility wrappers.

Impact

New code can use structured lookups such as:

entry = db(:Bubin2005Jan, Symbol("HD⁺"), :energy, (J = 0, v = 0))
entry.value
bib(entry)

The legacy @get and @bib macros remain available. @get now returns the stored numeric value rather than its string representation.

Validation

  • Pkg.test() with Julia 1.11.7: 27/27 tests passed
  • Documenter build completed successfully
  • git diff --check passed

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/FewBodyDB.jl 86.36% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ohno
ohno marked this pull request as ready for review August 12, 2026 03:37
@ohno
ohno merged commit cb294b9 into main Aug 12, 2026
3 checks passed
@ohno ohno mentioned this pull request Aug 12, 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.

1 participant