Skip to content

Add a units option to get predictions in feet#180

Merged
bkeepers merged 4 commits into
mainfrom
feet
Jan 6, 2026
Merged

Add a units option to get predictions in feet#180
bkeepers merged 4 commits into
mainfrom
feet

Conversation

@bkeepers
Copy link
Copy Markdown
Contributor

@bkeepers bkeepers commented Jan 6, 2026

getExtremesPrediction({
  // …
  units: 'feet'
})

getTimelinePrediction({
  // …
  units: 'feet'
})

getWaterLevelAt({
  // …
  units: 'feet'
})

The level value is returned in feet instead of meters.

@bkeepers bkeepers marked this pull request as ready for review January 6, 2026 13:32
@bkeepers bkeepers requested a review from Copilot January 6, 2026 13:32
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (68da259) to head (76095a0).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #180   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          505       522   +17     
  Branches        54        58    +4     
=========================================
+ Hits           505       522   +17     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a units option to three main functions (getExtremesPrediction, getTimelinePrediction, and getWaterLevelAtTime) allowing users to request water level predictions in feet instead of the default meters.

  • Adds a Units type and units parameter with 'meters' (default) and 'feet' options
  • Implements unit conversion using a toPreferredUnits helper function with a conversion factor of 3.2808399 feet per meter
  • Updates return types to include the units field in prediction results

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/neaps/src/index.ts Core implementation of the units option, including type definitions, conversion logic, and integration into all three prediction functions
packages/neaps/test/index.test.ts Test coverage for the new units functionality across all prediction functions, including error handling for unsupported units
examples/units.ts Example demonstrating how to use the units option to compare meters and feet predictions
README.md Documentation updates showing the units parameter in all three function examples with output samples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/units.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bkeepers bkeepers merged commit df70f4d into main Jan 6, 2026
5 checks passed
@bkeepers bkeepers deleted the feet branch January 6, 2026 13:38
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.

2 participants