Skip to content

Conversation

@joaquinbejar
Copy link
Owner

Change quantity type to PositiveF64

Replaced u32 with PositiveF64 for option quantity to ensure positive float values throughout the pricing and strategies modules. Updated related unit tests and visualization components to use the new type properly, enhancing the accuracy and flexibility in representing quantities.

Replaced u32 with PositiveF64 for option quantity to ensure positive float values throughout the pricing and strategies modules. Updated related unit tests and visualization components to use the new type properly, enhancing the accuracy and flexibility in representing quantities.
Converted quantities in various strategy examples to use the PositiveF64 type with the pos! macro for consistency and type safety. This change enhances the clarity and correctness of the quantity parameters across different option strategy implementations.
This commit introduces comprehensive unit tests for the PositiveF64 struct to ensure its functionality. These tests cover creation, addition, division, multiplication, equality, display, and formatting behaviors. Essential constants and a macro for generating PositiveF64 instances are also tested.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 89.47368% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/strategies/base.rs 0.00% 2 Missing ⚠️
src/strategies/poor_mans_covered_call.rs 0.00% 2 Missing ⚠️
src/model/position.rs 88.88% 1 Missing ⚠️
src/strategies/call_butterfly.rs 80.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/greeks/equations.rs 97.05% <ø> (ø)
src/greeks/utils.rs 98.03% <ø> (ø)
src/model/format.rs 89.72% <ø> (ø)
src/model/option.rs 96.55% <100.00%> (ø)
src/model/types.rs 80.00% <100.00%> (+7.27%) ⬆️
src/model/utils.rs 100.00% <ø> (ø)
src/pricing/black_scholes_model.rs 61.11% <ø> (ø)
src/pricing/monte_carlo.rs 100.00% <ø> (ø)
src/pricing/telegraph.rs 100.00% <ø> (ø)
src/pricing/utils.rs 97.91% <ø> (ø)
... and 10 more

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.

3 participants