Skip to content

feat: add as_pint to read_relative() and extract _apply_pint_dtype helper#9

Open
CooperBigFoot wants to merge 1 commit intorebase-energy:mainfrom
CooperBigFoot:feat/issue-8-pint-read-relative
Open

feat: add as_pint to read_relative() and extract _apply_pint_dtype helper#9
CooperBigFoot wants to merge 1 commit intorebase-energy:mainfrom
CooperBigFoot:feat/issue-8-pint-read-relative

Conversation

@CooperBigFoot
Copy link

Summary

  • Extract inline pint conversion from read() into a reusable _apply_pint_dtype(df, unit) helper (handles empty DataFrames, copies before mutating)
  • Add as_pint: bool = False keyword-only parameter to read_relative(), matching the existing read() API
  • Document pint-typed array support and IncompatibleUnitError on insert() docstring

Test plan

  • Unit tests for _apply_pint_dtype (empty df, applies dtype, no mutation, magnitude preserved)
  • Integration tests for read_relative(as_pint=True/False)
  • Full test suite passes with no regressions (12 passed, 59 skipped)
  • No lint issues in changed files

Closes #8

@FreaxMATE
Copy link
Collaborator

Thank you for the PR! Can you please only change code that is related to this PR and drop the bump my version part? Then I can review it again!

@CooperBigFoot CooperBigFoot force-pushed the feat/issue-8-pint-read-relative branch from 1361758 to 467674f Compare February 26, 2026 11:41
@CooperBigFoot
Copy link
Author

Cleaned up. Force-pushed with only the issue #8 changes: _apply_pint_dtype helper, as_pint on read_relative(), insert() docstring update, and corresponding tests. Removed version bump, bumpversion config, formatting changes, and lockfile diff.

@CooperBigFoot CooperBigFoot reopened this Feb 26, 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.

pint consistency: document in insert(), add as_pint to read_relative()

2 participants