Skip to content

Commit

Permalink
Feature/add isort linter (#4114)
Browse files Browse the repository at this point in the history
* Fixed isort

* Fixed issues

* FIxed linters

---------

Co-authored-by: James Maslek <[email protected]>
  • Loading branch information
colin99d and jmaslek authored Feb 5, 2023
1 parent 949ad43 commit ee34a1f
Show file tree
Hide file tree
Showing 509 changed files with 1,424 additions and 1,419 deletions.
6 changes: 3 additions & 3 deletions custom_pre_commit/check_reserved_args.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Check reserved command arguments in Controllers"""
import os
import sys
import glob
import os
import re
from typing import Optional, Any
import sys
from typing import Any, Optional

RESERVED_ARGS = {
"f": "file",
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab/documentation/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
)

try:
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
from jupyter_packaging import get_data_files, npm_builder, wrap_installers

post_develop = npm_builder(
build_cmd="install:extension", source_dir="src", build_dir=lab_path
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab/openbb-settings/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
)

try:
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
from jupyter_packaging import get_data_files, npm_builder, wrap_installers

post_develop = npm_builder(
build_cmd="install:extension", source_dir="src", build_dir=lab_path
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab/openbb/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
)

try:
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
from jupyter_packaging import get_data_files, npm_builder, wrap_installers

post_develop = npm_builder(
build_cmd="install:extension", source_dir="src", build_dir=lab_path
Expand Down
7 changes: 3 additions & 4 deletions openbb_terminal/alternative/alt_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
import logging
from typing import List

from openbb_terminal.custom_prompt_toolkit import NestedCompleter

from openbb_terminal import feature_flags as obbff
from openbb_terminal.alternative import hackernews_view
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
EXPORT_ONLY_RAW_DATA_ALLOWED,
)
from openbb_terminal.menu import session
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.rich_config import console, MenuText
from openbb_terminal.alternative import hackernews_view
from openbb_terminal.rich_config import MenuText, console

logger = logging.getLogger(__name__)
# pylint:disable=import-outside-toplevel
Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/alternative/covid/covid_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from typing import List

import pandas as pd
from openbb_terminal.custom_prompt_toolkit import NestedCompleter

from openbb_terminal import feature_flags as obbff
from openbb_terminal.alternative.covid import covid_view
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
EXPORT_BOTH_RAW_DATA_AND_FIGURES,
Expand All @@ -19,7 +19,7 @@
)
from openbb_terminal.menu import session
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.rich_config import console, MenuText
from openbb_terminal.rich_config import MenuText, console

logger = logging.getLogger(__name__)

Expand Down
7 changes: 3 additions & 4 deletions openbb_terminal/alternative/covid/covid_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@

import logging
import os
from typing import Optional, List
from typing import List, Optional

import matplotlib.pyplot as plt
import pandas as pd

from openbb_terminal.config_terminal import theme
from openbb_terminal.alternative.covid import covid_model
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
is_valid_axes_count,
plot_autoscale,
print_rich_table,
is_valid_axes_count,
)
from openbb_terminal.rich_config import console


logger = logging.getLogger(__name__)


Expand Down
4 changes: 3 additions & 1 deletion openbb_terminal/alternative/hackernews_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@


import logging

import pandas as pd
from openbb_terminal.helper_funcs import request

from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import request

logger = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions openbb_terminal/alternative/oss/github_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# pylint: disable=C0201,W1401

import logging
from typing import Any, Dict, Optional
import math
from datetime import datetime
from typing import Any, Dict, Optional

import pandas as pd

from openbb_terminal import config_terminal as cfg
from openbb_terminal.decorators import check_api_key, log_start_end
from openbb_terminal.rich_config import console
from openbb_terminal.helper_funcs import get_user_agent, request
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)

Expand Down
15 changes: 8 additions & 7 deletions openbb_terminal/alternative/oss/github_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@

import logging
import os
from typing import Optional, List
from typing import List, Optional

from matplotlib import pyplot as plt
from matplotlib import ticker
from openbb_terminal.config_terminal import theme

from openbb_terminal.alternative.oss import github_model
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.cryptocurrency.dataframe_helpers import (
lambda_long_number_format_with_type_check,
)
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
is_valid_axes_count,
plot_autoscale,
print_rich_table,
is_valid_axes_count,
)
from openbb_terminal.alternative.oss import github_model
from openbb_terminal.cryptocurrency.dataframe_helpers import (
lambda_long_number_format_with_type_check,
)

logger = logging.getLogger(__name__)
Expand Down
10 changes: 4 additions & 6 deletions openbb_terminal/alternative/oss/oss_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
import logging
from typing import List

from openbb_terminal.custom_prompt_toolkit import NestedCompleter

from openbb_terminal import feature_flags as obbff
from openbb_terminal.alternative.oss import github_view
from openbb_terminal.alternative.oss import runa_view, runa_model
from openbb_terminal.alternative.oss import github_view, runa_model, runa_view
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
EXPORT_BOTH_RAW_DATA_AND_FIGURES,
EXPORT_ONLY_RAW_DATA_ALLOWED,
valid_repo,
parse_and_split_input,
valid_repo,
)
from openbb_terminal.menu import session
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.rich_config import console, MenuText
from openbb_terminal.rich_config import MenuText, console

logger = logging.getLogger(__name__)

Expand Down
11 changes: 6 additions & 5 deletions openbb_terminal/alternative/oss/runa_view.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
"""Rekt view"""
import logging
import os
from typing import Optional, List
from typing import List, Optional

from matplotlib import pyplot as plt
from matplotlib import ticker

from openbb_terminal.alternative.oss import runa_model
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
plot_autoscale,
is_valid_axes_count,
lambda_long_number_format,
plot_autoscale,
print_rich_table,
is_valid_axes_count,
)
from openbb_terminal.config_terminal import theme
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion openbb_terminal/alternative/realestate/landRegistry_model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
""" UK Land Registry Model """
__docformat__ = "numpy"

import logging
import io
import logging

import pandas as pd
from SPARQLWrapper.Wrapper import CSV, SPARQLWrapper

Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/alternative/realestate/landRegistry_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import logging
import os

from openbb_terminal.decorators import log_start_end
from openbb_terminal.alternative.realestate import landRegistry_model
from openbb_terminal.helper_funcs import print_rich_table, export_data
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import export_data, print_rich_table
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
from datetime import datetime, timedelta
from typing import List

from openbb_terminal.custom_prompt_toolkit import NestedCompleter

from openbb_terminal import feature_flags as obbff
from openbb_terminal.alternative.realestate import landRegistry_view
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
from openbb_terminal.menu import session
from openbb_terminal.helper_funcs import (
EXPORT_ONLY_RAW_DATA_ALLOWED,
check_positive,
)
from openbb_terminal.rich_config import console, MenuText
from openbb_terminal.menu import session
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.alternative.realestate import landRegistry_view
from openbb_terminal.rich_config import MenuText, console

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/base_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is for helpers that do NOT import any OpenBB Modules
from typing import Callable, Any, Literal
import os
from typing import Any, Callable, Literal

from rich.console import Console

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import logging

import pandas as pd
from openbb_terminal.helper_funcs import request

from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import request

logger = logging.getLogger(__name__)

Expand Down
9 changes: 4 additions & 5 deletions openbb_terminal/common/behavioural_analysis/finbrain_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@

import logging
import os
from typing import Optional, List
from typing import List, Optional

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt

from openbb_terminal.config_terminal import theme
from openbb_terminal import rich_config
from openbb_terminal.common.behavioural_analysis import finbrain_model
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
is_valid_axes_count,
plot_autoscale,
print_rich_table,
is_valid_axes_count,
)
from openbb_terminal.rich_config import console
from openbb_terminal import rich_config


logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import pandas as pd

from openbb_terminal.helper_funcs import request
from openbb_terminal import config_terminal as cfg
from openbb_terminal.decorators import check_api_key, log_start_end
from openbb_terminal.helper_funcs import request
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)
Expand Down
3 changes: 1 addition & 2 deletions openbb_terminal/common/behavioural_analysis/finnhub_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import pandas as pd

from openbb_terminal.common.behavioural_analysis import finnhub_model
from openbb_terminal.decorators import log_start_end
from openbb_terminal.decorators import check_api_key, log_start_end
from openbb_terminal.helper_funcs import export_data
from openbb_terminal.rich_config import console
from openbb_terminal.decorators import check_api_key

logger = logging.getLogger(__name__)

Expand Down
10 changes: 5 additions & 5 deletions openbb_terminal/common/behavioural_analysis/google_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

import logging
import os
from typing import Optional, List
import pandas as pd
from typing import List, Optional

import matplotlib.pyplot as plt
import pandas as pd

from openbb_terminal.config_terminal import theme
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.common.behavioural_analysis import google_model
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
export_data,
is_valid_axes_count,
plot_autoscale,
print_rich_table,
is_valid_axes_count,
)

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Reddit Helpers"""
__docformat__ = "numpy"

from typing import List
import re
from typing import List

import praw

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# pylint:disable=too-many-lines

import logging
import warnings
from datetime import datetime, timedelta
from typing import List, Tuple
import warnings

import finviz
import pandas as pd
Expand Down
Loading

0 comments on commit ee34a1f

Please sign in to comment.