Skip to content

Commit

Permalink
resolve confict with data type
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni committed Aug 22, 2023
1 parent 1fd514b commit 017f4ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions finquant/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def process_data(data: ARRAY_OR_DATAFRAME) -> FLOAT:

# Numeric types
FLOAT = Union[np.floating, float]
FLOAT_OPTIONAL = Union[np.floating, float, None]
INT = Union[np.integer, int]
NUMERIC = Union[INT, FLOAT]

Expand Down
11 changes: 9 additions & 2 deletions finquant/quants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
import pandas as pd
from scipy.stats import norm

from finquant.data_types import ARRAY_OR_DATAFRAME, ARRAY_OR_SERIES, FLOAT, INT, NUMERIC
from finquant.data_types import (
ARRAY_OR_DATAFRAME,
ARRAY_OR_SERIES,
FLOAT,
FLOAT_OPTIONAL,
INT,
NUMERIC,
)
from finquant.returns import weighted_mean_daily_returns
from finquant.type_utilities import type_validation

Expand Down Expand Up @@ -116,7 +123,7 @@ def sortino_ratio(


def treynor_ratio(
exp_return: FLOAT, beta: FLOAT, risk_free_rate: FLOAT = 0.005
exp_return: FLOAT, beta: FLOAT_OPTIONAL, risk_free_rate: FLOAT = 0.005
) -> FLOAT:
"""Computes the Treynor Ratio.
Expand Down

0 comments on commit 017f4ef

Please sign in to comment.