Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: adding tests for monte carlo sims #52

Merged

Conversation

chemardes
Copy link
Collaborator

Changes:

  • adding tests for monte carlo simulation

@chemardes chemardes requested a review from Copilot March 27, 2025 16:27
@chemardes chemardes self-assigned this Mar 27, 2025
Copy link

@Copilot 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 new test suite for the Monte Carlo simulation pricing functionality to improve test coverage of option pricing features.

  • Introduces tests for European call and put option pricing.
  • Adds tests to validate error handling and simulation result consistency.

Comment on lines +38 to +39
assert actual_price == expected_price

Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

Floating point comparisons using '==' can be unreliable; consider using pytest.approx to avoid potential precision issues.

Suggested change
assert actual_price == expected_price
assert actual_price == pytest.approx(expected_price)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Comment on lines +56 to +57
assert actual_price == expected_price

Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

Using an exact equality check for floating point values may cause flaky tests due to precision errors; consider using pytest.approx for a more reliable comparison.

Suggested change
assert actual_price == expected_price
assert actual_price == pytest.approx(expected_price)

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@chemardes chemardes merged commit 568a057 into GPUEngineering:main Mar 27, 2025
1 check passed
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