Skip to content

Conversation

@thejerwang
Copy link
Collaborator

No description provided.

@thejerwang thejerwang requested a review from Copilot September 19, 2025 20:56
Copy link
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 bumps the version to 0.0.55 and refactors the FX forward points interpolation algorithm along with observer pattern improvements.

  • Refactored the get_forward method to use binary search for more efficient date lookup and cleaner interpolation logic
  • Added observer pruning functionality to automatically remove dead weak references before notifications
  • Added comprehensive test coverage for edge cases including exact matches, out-of-range dates, and observer behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Cargo.toml Version bump from 0.0.54 to 0.0.55
src/markets/forex/quotes/forwardpoints.rs Major refactor of interpolation logic with binary search, observer pruning, and extensive new test coverage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

#[cfg(test)]
mod tests {
use crate::error::Result;
use crate::markets::forex::quotes::forwardpoints::{FXForwardHelper, FXForwardQuote};
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

This import is redundant since FXForwardHelper and FXForwardQuote are already available in the current module scope. The import should be removed.

Suggested change
use crate::markets::forex::quotes::forwardpoints::{FXForwardHelper, FXForwardQuote};

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 19, 2025 21:00
Copy link
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.40%. Comparing base (211a5d9) to head (28d637c).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/markets/forex/quotes/forwardpoints.rs 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
+ Coverage   74.78%   75.40%   +0.61%     
==========================================
  Files          65       65              
  Lines        3681     3664      -17     
==========================================
+ Hits         2753     2763      +10     
+ Misses        928      901      -27     

☔ 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.

Copilot AI review requested due to automatic review settings September 19, 2025 21:16
Copy link
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 79 to 82
if total_day_count == 0.0 {
// Degenerate case: identical settlement dates; use start value
return Ok(Some(start_val));
}
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Consider using a small epsilon value instead of exact equality comparison for floating-point arithmetic. Use total_day_count.abs() < f64::EPSILON to handle potential floating-point precision issues.

Copilot uses AI. Check for mistakes.
thejerwang and others added 2 commits September 19, 2025 22:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 19, 2025 21:21
Copy link
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

thiserror = "2.0.12"
typetag = "0.2.20"

[dev-dependencies]
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Adding cargo-husky as a dev-dependency can automatically install git hooks for all developers. This should be documented in the project README or installation guide to inform developers about the automatic hook installation behavior.

Suggested change
[dev-dependencies]
[dev-dependencies]
# NOTE: Adding cargo-husky as a dev-dependency will automatically install Git hooks (e.g., pre-commit, pre-push) for all developers.
# Please see the project README or installation guide for details about this behavior.

Copilot uses AI. Check for mistakes.
@thejerwang thejerwang merged commit b57956e into main Sep 19, 2025
5 checks passed
@thejerwang thejerwang deleted the 0.0.55 branch September 19, 2025 21:27
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