Good code :white_check_mark: | Bad code :x: | -
- - ```python - def display_last_uni_swaps( - top: int = 10, - sortby: str = "timestamp", - descend: bool = False, - export: str = "",) -> None: - ``` - - | -- - ```python - def display_last_uni_swaps( - top: int, - sortby: str, - descend: bool, - export: str,) -> None: - ``` - - | -
Good code :white_check_mark: | Bad code :x: | -
- - ```python - def get_coins( - top: int = 250, - category: str = "") -> pd.DataFrame: - ``` - - | -- - ```python - def load( - file: str, - file_types: list, - data_files: Dict[Any, Any], - data_examples: Dict[Any, Any],) -> pd.DataFrame: - ``` - - | -
Good code :white_check_mark: | Bad code :x: | -
- - ```python - data: pd.Series, dataset_name: str, y_label: str, - ``` - - | -- - ```python - data: pd.Series, dataset: str, column: str, - ``` - - | -
Good code :white_check_mark: | Bad code :x: | -
- - ```python - def get_gaintopain_ratio(portfolio: PortfolioEngine) -> pd.DataFrame: - - """...""" - - gtp_period_df = portfolio_helper.get_gaintopain_ratio( - portfolio.historical_trade_data, - portfolio.benchmark_trades, - portfolio.benchmark_returns) - - return gtp_period_df - ``` - - | -- - ```python - def get_gaintopain_ratio(self) -> pd.DataFrame: - - """...""" - - vals = list() - - for period in portfolio_helper.PERIODS: - port_rets = portfolio_helper.filter_df_by_period(self.portfolio_returns, period) - bench_rets = portfolio_helper.filter_df_by_period(self.benchmark_returns, period) - - ... - ``` - - | -
Good code :white_check_mark: | Bad code :x: | -
- - ```python - # [fred_view.py] - - def display_yieldcurve(country: str): - - df = fred_model.get_yieldcurve(country) - - β¦ - - # [fred_model.py] - - def get_yieldcurve(country: str) -> pd.Dataframe: - - β¦ - ``` - - | -- - ```python - # [fred_view.py] - - def display_bondscrv(country: str): - - df = fred_model.get_yieldcurve(country) - - β¦ - - # [fred_model.py] - - def get_yldcurve(country: str) -> pd.Dataframe: - - β¦ - ``` - - | -