From 4105851cf19574d6f308e25e2c215301ce65688b Mon Sep 17 00:00:00 2001 From: Chavithra PARANA Date: Sat, 22 May 2021 19:40:05 +0000 Subject: [PATCH] degiro integration : pyupgrade unrelated files --- gamestonk_terminal/discovery/marketbeat_view.py | 4 ++-- .../fundamental_analysis/business_insider_view.py | 2 +- gamestonk_terminal/helper_funcs.py | 4 ++-- gamestonk_terminal/prediction_techniques/arima_view.py | 2 +- gamestonk_terminal/residuals_analysis/residuals_model.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gamestonk_terminal/discovery/marketbeat_view.py b/gamestonk_terminal/discovery/marketbeat_view.py index c2f3c58007d..dcca665a898 100644 --- a/gamestonk_terminal/discovery/marketbeat_view.py +++ b/gamestonk_terminal/discovery/marketbeat_view.py @@ -57,13 +57,13 @@ def ratings_view(other_args: List[str]): ) df_ratings["clean_current_price"] = df_ratings["current_price"].apply( - lambda x: "".join([c if c.isdigit() or c == "." else "" for c in str(x)]) + lambda x: "".join(c if c.isdigit() or c == "." else "" for c in str(x)) ) df_ratings["clean_current_price"] = df_ratings["clean_current_price"].astype( float ) df_ratings["clean_target_price"] = df_ratings["new_target"].apply( - lambda x: "".join([c if c.isdigit() or c == "." else "" for c in str(x)]) + lambda x: "".join(c if c.isdigit() or c == "." else "" for c in str(x)) ) df_ratings["clean_target_price"] = df_ratings["clean_target_price"].astype( float diff --git a/gamestonk_terminal/fundamental_analysis/business_insider_view.py b/gamestonk_terminal/fundamental_analysis/business_insider_view.py index bb0d4db3d6c..eaf0d0db2ab 100644 --- a/gamestonk_terminal/fundamental_analysis/business_insider_view.py +++ b/gamestonk_terminal/fundamental_analysis/business_insider_view.py @@ -104,7 +104,7 @@ def management(other_args: List[str], ticker: str): for ind in df_management.index: s_name = f"{ind}{(max([len(x) for x in df_management.index])-len(ind))*' '}" df_mgmt_title = df_management["Title"] - spaces = max([len(x) for x in df_mgmt_title]) - len(df_mgmt_title[ind]) + spaces = max(len(x) for x in df_mgmt_title) - len(df_mgmt_title[ind]) s_title = f"{df_mgmt_title[ind]}{spaces * ' '}" s_management = f"""{s_name} {s_title} {df_management['Info'][ind]}""" print(s_management) diff --git a/gamestonk_terminal/helper_funcs.py b/gamestonk_terminal/helper_funcs.py index eca018d4973..08e4598e1df 100644 --- a/gamestonk_terminal/helper_funcs.py +++ b/gamestonk_terminal/helper_funcs.py @@ -326,10 +326,10 @@ def text_adjustment_join_unicode(self, lines, sep=""): def text_adjustment_adjoin(self, space, *lists, **kwargs): # Add space for all but the last column: pads = ([space] * (len(lists) - 1)) + [0] - max_col_len = max([len(col) for col in lists]) + max_col_len = max(len(col) for col in lists) new_cols = [] for col, pad in zip(lists, pads): - width = max([self.len(s) for s in col]) + pad + width = max(self.len(s) for s in col) + pad c = self.justify(col, width, mode="left") # Add blank cells to end of col if needed for different col lens: if len(col) < max_col_len: diff --git a/gamestonk_terminal/prediction_techniques/arima_view.py b/gamestonk_terminal/prediction_techniques/arima_view.py index e0153ef5927..2ccd1048cf4 100644 --- a/gamestonk_terminal/prediction_techniques/arima_view.py +++ b/gamestonk_terminal/prediction_techniques/arima_view.py @@ -150,7 +150,7 @@ def arima(other_args: List[str], s_ticker: str, df_stock: pd.DataFrame): # Machine Learning model if ns_parser.s_order: - t_order = tuple([int(ord) for ord in ns_parser.s_order.split(",")]) + t_order = tuple(int(ord) for ord in ns_parser.s_order.split(",")) model = ARIMA(df_stock["5. adjusted close"].values, order=t_order).fit() l_predictions = model.predict( start=len(df_stock["5. adjusted close"]) + 1, diff --git a/gamestonk_terminal/residuals_analysis/residuals_model.py b/gamestonk_terminal/residuals_analysis/residuals_model.py index 3c19d8bfc11..44b65fb9acd 100644 --- a/gamestonk_terminal/residuals_analysis/residuals_model.py +++ b/gamestonk_terminal/residuals_analysis/residuals_model.py @@ -119,7 +119,7 @@ def arima( return if ns_parser.s_order: - t_order = tuple([int(ord) for ord in list(ns_parser.s_order)]) + t_order = tuple(int(ord) for ord in list(ns_parser.s_order)) model_fit = ARIMA(stock.values, order=t_order).fit() model = pd.Series(model_fit.fittedvalues[1:], index=stock.index[1:]) model_name = f"ARIMA {t_order}"