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

Market data #258

Merged
merged 3 commits into from
Aug 10, 2024
Merged

Market data #258

merged 3 commits into from
Aug 10, 2024

Conversation

avhz
Copy link
Owner

@avhz avhz commented Aug 10, 2024

No description provided.

@avhz avhz merged commit 9c6fa43 into main Aug 10, 2024
3 of 8 checks passed
@avhz avhz deleted the market-data branch August 10, 2024 20:12
.collect::<Vec<String>>();

for (i, path) in paths.paths.iter().enumerate() {
let ys = path.iter().cloned().collect::<Vec<f64>>();

Check warning

Code scanning / clippy

called iter().cloned().collect() on a slice to create a Vec. Calling to_vec() is both faster and more readable Warning

called iter().cloned().collect() on a slice to create a Vec. Calling to\_vec() is both faster and more readable
// Discount function that reduces value by 10%.
let df = |date: Date| if date == now { 0.9 } else { 1.0 };
assert_approx_equal!(cf.npv(df), 90.0, EPS);
assert_approx_equal!(cf.npv(0.9), 90.0, EPS);

Check warning

Code scanning / clippy

usage of a legacy numeric constant Warning

usage of a legacy numeric constant
use std::f64::EPSILON as EPS;
use time::Duration;
use time::OffsetDateTime;

Check warning

Code scanning / clippy

unused import: time::OffsetDateTime Warning

unused import: time::OffsetDateTime
let df = (-rate * (config.t_n - config.t_0)).exp();

out.paths.iter().fold(0.0, |acc, path| {
let payoff = self.payoff(path.last().unwrap().clone());

Check warning

Code scanning / clippy

using clone on type f64 which implements the Copy trait Warning

using clone on type f64 which implements the Copy trait
let df = (-rate * (config.t_n - config.t_0)).exp();

out.paths.iter().fold(0.0, |acc, path| {
let payoff = self.payoff(path.last().unwrap().clone());

Check warning

Code scanning / clippy

using clone on type f64 which implements the Copy trait Warning

using clone on type f64 which implements the Copy trait
P: Payoff,
{
/// Function to prepare the data for the specific instrument.
fn prepare_data(&self) -> ();

Check warning

Code scanning / clippy

unneeded unit return type Warning

unneeded unit return type
P: Payoff,
{
/// Function to prepare the data for the specific instrument.
fn prepare_data(&self) -> ();

Check warning

Code scanning / clippy

unneeded unit return type Warning

unneeded unit return type
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