fmilthaler / FinQuant

A program for financial portfolio management, analysis and optimisation.
MIT License
1.34k stars 190 forks source link

Use type hints consistently #94

Closed fmilthaler closed 11 months ago

fmilthaler commented 1 year ago

As part of that: where a variable could be either pd.Series or pd.DataFrame, do sth like the following:

DataFrameOrSeries = Union[pd.DataFrame, pd.Series]

def compute_ma(
    data: DataFrameOrSeries, fun: Callable, spans: List[int], plot: bool = True
) -> pd.DataFrame:
    # rest of function

While at it, fix pylint issues as well.

fmilthaler commented 11 months ago

@PietropaoloFrisoni , I'm already working on this (been doing that for the past few days offline, just pushed the branch for visibility: #122). In that PR I'm also addressing the other issue #95 (pylint and mypy errors).

PietropaoloFrisoni commented 11 months ago

Good, thanks. Good luck!

fmilthaler commented 11 months ago

Good, thanks. Good luck!

If you look at the current state of the PR I bet you're happy that I ended up taking this on ;)