From 6ecab3ceef37b36c34a1dc0d8cd08bdc98e15e56 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 25 Apr 2021 20:27:11 -0400 Subject: [PATCH] new black update -- many files changed --- .../backtesting/bt_controller.py | 2 +- gamestonk_terminal/backtesting/bt_helper.py | 2 +- .../cryptocurrency/crypto_controller.py | 4 +-- .../discovery/disc_controller.py | 4 +-- .../due_diligence/dd_controller.py | 30 +++++++++---------- gamestonk_terminal/fred/fred_controller.py | 4 +-- .../alpha_vantage_controller.py | 16 +++++----- .../fundamental_analysis/fa_controller.py | 28 ++++++++--------- .../financial_modeling_prep_controller.py | 24 +++++++-------- gamestonk_terminal/helper_funcs.py | 2 +- gamestonk_terminal/options/op_controller.py | 2 +- .../papermill/papermill_controller.py | 2 +- .../portfolio/port_controller.py | 4 +-- .../optimizer_helper.py | 2 +- .../portfolio_optimization/po_controller.py | 2 +- .../prediction_techniques/neural_networks.py | 4 +-- .../prediction_techniques/pred_controller.py | 2 +- gamestonk_terminal/res_menu.py | 2 +- .../screener/screener_controller.py | 4 +-- gamestonk_terminal/test_helper.py | 2 +- gamestonk_terminal/thought_of_the_day.py | 6 ++-- 21 files changed, 74 insertions(+), 74 deletions(-) diff --git a/gamestonk_terminal/backtesting/bt_controller.py b/gamestonk_terminal/backtesting/bt_controller.py index bf3d13b8df9..152ab3c3c57 100644 --- a/gamestonk_terminal/backtesting/bt_controller.py +++ b/gamestonk_terminal/backtesting/bt_controller.py @@ -13,7 +13,7 @@ from gamestonk_terminal.backtesting import bt_view class BacktestingController: - """Backtesting Class """ + """Backtesting Class""" CHOICES = ["help", "q", "quit", "ema", "ema_cross", "rsi"] diff --git a/gamestonk_terminal/backtesting/bt_helper.py b/gamestonk_terminal/backtesting/bt_helper.py index da8d3bb3bc4..1b03c0d0790 100644 --- a/gamestonk_terminal/backtesting/bt_helper.py +++ b/gamestonk_terminal/backtesting/bt_helper.py @@ -15,7 +15,7 @@ register_matplotlib_converters() def buy_and_hold(ticker: str, start: Union[str, datetime], name: str): - """ Generates a backtest object for the given ticker""" + """Generates a backtest object for the given ticker""" prices = bt.get(ticker, start=start) bt_strategy = bt.Strategy( name, diff --git a/gamestonk_terminal/cryptocurrency/crypto_controller.py b/gamestonk_terminal/cryptocurrency/crypto_controller.py index e78323b473b..0361dcbbb23 100644 --- a/gamestonk_terminal/cryptocurrency/crypto_controller.py +++ b/gamestonk_terminal/cryptocurrency/crypto_controller.py @@ -16,7 +16,7 @@ class CryptoController: CHOICES = ["help", "q", "quit", "load", "view", "top"] def __init__(self): - """ CONSTRUCTOR """ + """CONSTRUCTOR""" self.crypto_parser = argparse.ArgumentParser(add_help=False, prog="crypto") self.crypto_parser.add_argument("cmd", choices=self.CHOICES) @@ -25,7 +25,7 @@ class CryptoController: @staticmethod def print_help(current_coin): - """ Print help """ + """Print help""" print("\nCryptocurrency:") print(" help show this menu again") print(" q quit this menu, and shows back to main menu") diff --git a/gamestonk_terminal/discovery/disc_controller.py b/gamestonk_terminal/discovery/disc_controller.py index 07e00b2e462..855f2eeb0d4 100644 --- a/gamestonk_terminal/discovery/disc_controller.py +++ b/gamestonk_terminal/discovery/disc_controller.py @@ -26,7 +26,7 @@ from gamestonk_terminal.discovery import ( class DiscoveryController: - """ Discovery Controller """ + """Discovery Controller""" # Command choices CHOICES = [ @@ -65,7 +65,7 @@ class DiscoveryController: @staticmethod def print_help(): - """ Print help """ + """Print help""" print("\nDiscovery Mode:") print(" help show this discovery menu again") diff --git a/gamestonk_terminal/due_diligence/dd_controller.py b/gamestonk_terminal/due_diligence/dd_controller.py index 2dbe1379927..27efe9eb880 100644 --- a/gamestonk_terminal/due_diligence/dd_controller.py +++ b/gamestonk_terminal/due_diligence/dd_controller.py @@ -21,7 +21,7 @@ from gamestonk_terminal.menu import session class DueDiligenceController: - """ Due Diligence Controller """ + """Due Diligence Controller""" # Command choices CHOICES = [ @@ -68,7 +68,7 @@ class DueDiligenceController: ) def print_help(self): - """ Print help """ + """Print help""" intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"] @@ -134,59 +134,59 @@ class DueDiligenceController: return True def call_red(self, other_args: List[str]): - """ Process red command """ + """Process red command""" r_view.due_diligence(other_args, self.ticker) def call_insider(self, other_args: List[str]): - """ Process insider command """ + """Process insider command""" fvz_view.insider(other_args, self.ticker) def call_news(self, other_args: List[str]): - """ Process news command """ + """Process news command""" news_view.news(other_args, self.ticker) def call_analyst(self, other_args: List[str]): - """ Process analyst command """ + """Process analyst command""" fvz_view.analyst(other_args, self.ticker) def call_pt(self, other_args: List[str]): - """ Process pt command """ + """Process pt command""" bi_view.price_target_from_analysts( other_args, self.stock, self.ticker, self.start, self.interval ) def call_est(self, other_args: List[str]): - """ Process est command """ + """Process est command""" bi_view.estimates(other_args, self.ticker) def call_ins(self, other_args: List[str]): - """ Process ins command """ + """Process ins command""" bi_view.insider_activity( other_args, self.stock, self.ticker, self.start, self.interval ) def call_rating(self, other_args: List[str]): - """ Process rating command """ + """Process rating command""" fmp_view.rating(other_args, self.ticker) def call_warnings(self, other_args: List[str]): - """ Process rating command """ + """Process rating command""" mw_view.sean_seah_warnings(other_args, self.ticker) def call_sec(self, other_args: List[str]): - """ Process sec command """ + """Process sec command""" mw_view.sec_fillings(other_args, self.ticker) def call_short(self, other_args: List[str]): - """ Process short command """ + """Process short command""" q_view.short_interest(other_args, self.ticker, self.start) def call_dp(self, other_args: List[str]): - """ Process dp command """ + """Process dp command""" finra_view.dark_pool(other_args, self.ticker) def call_ftd(self, other_args: List[str]): - """ Process ftd command """ + """Process ftd command""" sec_view.fails_to_deliver(other_args, self.ticker) diff --git a/gamestonk_terminal/fred/fred_controller.py b/gamestonk_terminal/fred/fred_controller.py index 0f3bf4990b0..6068bf62256 100644 --- a/gamestonk_terminal/fred/fred_controller.py +++ b/gamestonk_terminal/fred/fred_controller.py @@ -12,7 +12,7 @@ from gamestonk_terminal.fred import fred_view class FredController: - """ Fred Controller """ + """Fred Controller""" # Command choices CHOICES = [ @@ -42,7 +42,7 @@ class FredController: @staticmethod def print_help(): - """ Print help """ + """Print help""" print("\nFred Economic Data:") print(" help show this menu again") diff --git a/gamestonk_terminal/fundamental_analysis/alpha_vantage_controller.py b/gamestonk_terminal/fundamental_analysis/alpha_vantage_controller.py index 01d029a569c..7591d0666d2 100644 --- a/gamestonk_terminal/fundamental_analysis/alpha_vantage_controller.py +++ b/gamestonk_terminal/fundamental_analysis/alpha_vantage_controller.py @@ -12,7 +12,7 @@ from gamestonk_terminal.menu import session class AlphaVantageController: - """ Alpha Vantage Controller """ + """Alpha Vantage Controller""" # Command choices CHOICES = [ @@ -50,7 +50,7 @@ class AlphaVantageController: ) def print_help(self): - """ Print help """ + """Print help""" intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"] @@ -103,27 +103,27 @@ class AlphaVantageController: return True def call_overview(self, other_args: List[str]): - """ Process overview command """ + """Process overview command""" avv.overview(other_args, self.ticker) def call_key(self, other_args: List[str]): - """ Process overview command """ + """Process overview command""" avv.key(other_args, self.ticker) def call_income(self, other_args: List[str]): - """ Process income command """ + """Process income command""" avv.income_statement(other_args, self.ticker) def call_balance(self, other_args: List[str]): - """ Process balance command """ + """Process balance command""" avv.balance_sheet(other_args, self.ticker) def call_cash(self, other_args: List[str]): - """ Process cash command """ + """Process cash command""" avv.cash_flow(other_args, self.ticker) def call_earnings(self, other_args: List[str]): - """ Process earnings command """ + """Process earnings command""" avv.earnings(other_args, self.ticker) diff --git a/gamestonk_terminal/fundamental_analysis/fa_controller.py b/gamestonk_terminal/fundamental_analysis/fa_controller.py index 5de204ab675..a282942c1c3 100644 --- a/gamestonk_terminal/fundamental_analysis/fa_controller.py +++ b/gamestonk_terminal/fundamental_analysis/fa_controller.py @@ -20,7 +20,7 @@ from gamestonk_terminal.menu import session class FundamentalAnalysisController: - """ Fundamental Analysis Controller """ + """Fundamental Analysis Controller""" # Command choices CHOICES = [ @@ -65,7 +65,7 @@ class FundamentalAnalysisController: ) def print_help(self): - """ Print help """ + """Print help""" intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"] @@ -135,48 +135,48 @@ class FundamentalAnalysisController: return True def call_mgmt(self, other_args: List[str]): - """ Process mgmt command """ + """Process mgmt command""" biw.management(other_args, self.ticker) def call_screener(self, other_args: List[str]): - """ Process screener command """ + """Process screener command""" finviz_view.screener(other_args, self.ticker) def call_score(self, other_args: List[str]): - """ Process score command """ + """Process score command""" fmpv.valinvest_score(other_args, self.ticker) def call_income(self, other_args: List[str]): - """ Process income command """ + """Process income command""" market_watch_view.income(other_args, self.ticker) def call_balance(self, other_args: List[str]): - """ Process balance command """ + """Process balance command""" market_watch_view.balance(other_args, self.ticker) def call_cash(self, other_args: List[str]): - """ Process cash command """ + """Process cash command""" market_watch_view.cash(other_args, self.ticker) def call_info(self, other_args: List[str]): - """ Process info command """ + """Process info command""" yahoo_finance_view.info(other_args, self.ticker) def call_shrs(self, other_args: List[str]): - """ Process shrs command """ + """Process shrs command""" yahoo_finance_view.shareholders(other_args, self.ticker) def call_sust(self, other_args: List[str]): - """ Process sust command """ + """Process sust command""" yahoo_finance_view.sustainability(other_args, self.ticker) def call_cal(self, other_args: List[str]): - """ Process cal command """ + """Process cal command""" yahoo_finance_view.calendar_earnings(other_args, self.ticker) # pylint: disable=unused-argument def call_av(self, other_args: List[str]): - """ Process av command """ + """Process av command""" ret = avc.menu(self.ticker, self.start, self.interval) if ret is not True: @@ -184,7 +184,7 @@ class FundamentalAnalysisController: # pylint: disable=unused-argument def call_fmp(self, other_args: List[str]): - """ Process fmp command """ + """Process fmp command""" ret = fmpc.menu(self.ticker, self.start, self.interval) if ret is not True: diff --git a/gamestonk_terminal/fundamental_analysis/financial_modeling_prep_controller.py b/gamestonk_terminal/fundamental_analysis/financial_modeling_prep_controller.py index e68077aa0f9..d8b8dbf15ae 100644 --- a/gamestonk_terminal/fundamental_analysis/financial_modeling_prep_controller.py +++ b/gamestonk_terminal/fundamental_analysis/financial_modeling_prep_controller.py @@ -14,7 +14,7 @@ from gamestonk_terminal.menu import session class FinancialModelingPrepController: - """ Financial Modeling Prep Controller """ + """Financial Modeling Prep Controller""" # Command choices CHOICES = [ @@ -56,7 +56,7 @@ class FinancialModelingPrepController: ) def print_help(self): - """ Print help """ + """Print help""" intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"] @@ -113,43 +113,43 @@ class FinancialModelingPrepController: return True def call_profile(self, other_args: List[str]): - """ Process profile command """ + """Process profile command""" fmpv.profile(other_args, self.ticker) def call_quote(self, other_args: List[str]): - """ Process quote command """ + """Process quote command""" fmpv.quote(other_args, self.ticker) def call_enterprise(self, other_args: List[str]): - """ Process income command """ + """Process income command""" fmpv.enterprise(other_args, self.ticker) def call_dcf(self, other_args: List[str]): - """ Process dcf command """ + """Process dcf command""" fmpv.discounted_cash_flow(other_args, self.ticker) def call_income(self, other_args: List[str]): - """ Process income command """ + """Process income command""" fmpv.income_statement(other_args, self.ticker) def call_balance(self, other_args: List[str]): - """ Process balance command """ + """Process balance command""" fmpv.balance_sheet(other_args, self.ticker) def call_cash(self, other_args: List[str]): - """ Process cash command """ + """Process cash command""" fmpv.cash_flow(other_args, self.ticker) def call_metrics(self, other_args: List[str]): - """ Process metrics command """ + """Process metrics command""" fmpv.key_metrics(other_args, self.ticker) def call_ratios(self, other_args: List[str]): - """ Process cash command """ + """Process cash command""" fmpv.financial_ratios(other_args, self.ticker) def call_growth(self, other_args: List[str]): - """ Process cash command """ + """Process cash command""" fmpv.financial_statement_growth(other_args, self.ticker) diff --git a/gamestonk_terminal/helper_funcs.py b/gamestonk_terminal/helper_funcs.py index a2e00fd3d35..8bbb06db268 100644 --- a/gamestonk_terminal/helper_funcs.py +++ b/gamestonk_terminal/helper_funcs.py @@ -130,7 +130,7 @@ def us_market_holidays(years) -> list: def b_is_stock_market_open() -> bool: - """ checks if the stock market is open """ + """checks if the stock market is open""" # Get current US time now = datetime.now(timezone("US/Eastern")) # Check if it is a weekend diff --git a/gamestonk_terminal/options/op_controller.py b/gamestonk_terminal/options/op_controller.py index 5ba3ad04dc8..6148459f087 100644 --- a/gamestonk_terminal/options/op_controller.py +++ b/gamestonk_terminal/options/op_controller.py @@ -169,7 +169,7 @@ class OptionsController: def menu(ticker: str, last_adj_close_price: float): - """ Options Menu. """ + """Options Menu.""" try: op_controller = OptionsController(ticker, last_adj_close_price) diff --git a/gamestonk_terminal/papermill/papermill_controller.py b/gamestonk_terminal/papermill/papermill_controller.py index e7bd3366869..8e907dbc126 100644 --- a/gamestonk_terminal/papermill/papermill_controller.py +++ b/gamestonk_terminal/papermill/papermill_controller.py @@ -11,7 +11,7 @@ from gamestonk_terminal.helper_funcs import get_flair class PapermillController: - """ Papermill Controller class""" + """Papermill Controller class""" def __init__(self): """Constructor""" diff --git a/gamestonk_terminal/portfolio/port_controller.py b/gamestonk_terminal/portfolio/port_controller.py index e9d6b0c1fea..67b37da5727 100644 --- a/gamestonk_terminal/portfolio/port_controller.py +++ b/gamestonk_terminal/portfolio/port_controller.py @@ -16,7 +16,7 @@ from gamestonk_terminal.portfolio.portfolio_helpers import ( class PortfolioController: - """ Portfolio Controller """ + """Portfolio Controller""" CHOICES = [ "help", @@ -46,7 +46,7 @@ class PortfolioController: @staticmethod def print_help(broker_list): - """ Print help """ + """Print help""" print("\nBrokers Supported: rh - Robinhood") print(" alp - Alpaca") print(" ally - Ally Invest") diff --git a/gamestonk_terminal/portfolio_optimization/optimizer_helper.py b/gamestonk_terminal/portfolio_optimization/optimizer_helper.py index 8236d01b789..cbd20d60732 100644 --- a/gamestonk_terminal/portfolio_optimization/optimizer_helper.py +++ b/gamestonk_terminal/portfolio_optimization/optimizer_helper.py @@ -111,7 +111,7 @@ l_valid_property_infos = [ def check_valid_property_type(aproperty: str) -> str: - """ Check that the property selected is valid """ + """Check that the property selected is valid""" if aproperty in l_valid_property_infos: return aproperty diff --git a/gamestonk_terminal/portfolio_optimization/po_controller.py b/gamestonk_terminal/portfolio_optimization/po_controller.py index c4345e8b386..5940d0b969e 100644 --- a/gamestonk_terminal/portfolio_optimization/po_controller.py +++ b/gamestonk_terminal/portfolio_optimization/po_controller.py @@ -169,7 +169,7 @@ class PortfolioOptimization: print("") def add_stocks(self, other_args: List[str]): - """ Add ticker or Select tickes for portfolio to be optimized """ + """Add ticker or Select tickes for portfolio to be optimized""" parser = argparse.ArgumentParser( add_help=False, prog="add/select", diff --git a/gamestonk_terminal/prediction_techniques/neural_networks.py b/gamestonk_terminal/prediction_techniques/neural_networks.py index d0489619576..e3cabd309f9 100644 --- a/gamestonk_terminal/prediction_techniques/neural_networks.py +++ b/gamestonk_terminal/prediction_techniques/neural_networks.py @@ -342,7 +342,7 @@ def _preprocess_split(df_stock, ns_parser): def _rescale_data(df_stock, ns_parser, scaler, yhat, idx_loop): - """Re-scale the data back and return the prediction dataframe. """ + """Re-scale the data back and return the prediction dataframe.""" if (ns_parser.s_preprocessing == "standardization") or ( ns_parser.s_preprocessing == "normalization" ): @@ -362,7 +362,7 @@ def _rescale_data(df_stock, ns_parser, scaler, yhat, idx_loop): def _plot_and_print_results( df_stock, ns_parser, df_future, df_pred, model_name, s_ticker ): - """Plot and print the results. """ + """Plot and print the results.""" # Plotting plt.figure(figsize=plot_autoscale(), dpi=PLOT_DPI) plt.plot(df_stock.index, df_stock["5. adjusted close"], lw=3) diff --git a/gamestonk_terminal/prediction_techniques/pred_controller.py b/gamestonk_terminal/prediction_techniques/pred_controller.py index 2ca6c8e6443..200a93dd1b2 100644 --- a/gamestonk_terminal/prediction_techniques/pred_controller.py +++ b/gamestonk_terminal/prediction_techniques/pred_controller.py @@ -61,7 +61,7 @@ class PredictionTechniquesController: ) def print_help(self): - """ Print help """ + """Print help""" s_intraday = (f"Intraday {self.interval}", "Daily")[self.interval == "1440min"] diff --git a/gamestonk_terminal/res_menu.py b/gamestonk_terminal/res_menu.py index f887c83e1ae..3815cebbc8e 100644 --- a/gamestonk_terminal/res_menu.py +++ b/gamestonk_terminal/res_menu.py @@ -3,7 +3,7 @@ import webbrowser def print_research(s_ticker, s_start, s_interval): - """ Print help """ + """Print help""" s_intraday = (f"Intraday {s_interval}", "Daily")[s_interval == "1440min"] diff --git a/gamestonk_terminal/screener/screener_controller.py b/gamestonk_terminal/screener/screener_controller.py index 7edc438c501..ae7a07ab050 100644 --- a/gamestonk_terminal/screener/screener_controller.py +++ b/gamestonk_terminal/screener/screener_controller.py @@ -80,7 +80,7 @@ class ScreenerController: @staticmethod def view_available_presets(other_args: List[str]): - """ View available presets. """ + """View available presets.""" parser = argparse.ArgumentParser( add_help=False, prog="view", @@ -119,7 +119,7 @@ class ScreenerController: @staticmethod def set_preset(self, other_args: List[str]): - """ Set preset """ + """Set preset""" parser = argparse.ArgumentParser( add_help=False, prog="set", diff --git a/gamestonk_terminal/test_helper.py b/gamestonk_terminal/test_helper.py index 3ea178851fe..443692be1e5 100644 --- a/gamestonk_terminal/test_helper.py +++ b/gamestonk_terminal/test_helper.py @@ -53,7 +53,7 @@ def parameterize_from_file(test_namespace: str, parameter_file: str) -> Callable def pytest_generate_tests(metafunc): - """ https://docs.pytest.org/en/stable/parametrize.html#pytest-generate-tests """ + """https://docs.pytest.org/en/stable/parametrize.html#pytest-generate-tests""" if getattr(metafunc.function, "test_params_names", None): metafunc.parametrize( metafunc.function.test_params_names, diff --git a/gamestonk_terminal/thought_of_the_day.py b/gamestonk_terminal/thought_of_the_day.py index 8a891254223..fc418257099 100644 --- a/gamestonk_terminal/thought_of_the_day.py +++ b/gamestonk_terminal/thought_of_the_day.py @@ -11,10 +11,10 @@ from gamestonk_terminal.helper_funcs import get_user_agent class ThoughtOfTheDay: - """ ThoughtOfTheDay class """ + """ThoughtOfTheDay class""" def __init__(self, urls: Dict[str, str] = None): - """ Constructor """ + """Constructor""" self.metadata = {} # type: Dict @@ -34,7 +34,7 @@ class ThoughtOfTheDay: self.urls = urls def get_urls(self) -> dict: - """ Getter method for URLs """ + """Getter method for URLs""" return self.urls def get_metadata(self, author: str) -> dict: