Skip to content

Commit

Permalink
Add extra configuring and custom ignores for pylint too-many-position…
Browse files Browse the repository at this point in the history
…al-arguments. (#1625)
  • Loading branch information
calina-c authored Sep 23, 2024
1 parent bf85e7c commit 664a856
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ max-statements=50
# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of positional arguments, defined to mirror max number of class attributes because it applies to constructors
max-positional-arguments=7


[EXCEPTIONS]

Expand Down
2 changes: 1 addition & 1 deletion pdr_backend/aimodel/aimodel_plotdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AimodelPlotdata:
"""Simple class to manage many inputs going into plot_model."""

# pylint: disable=too-many-instance-attributes

# pylint: disable=too-many-positional-arguments
def __init__(
self,
model: Aimodel,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/aimodel/aimodel_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def _plot_contour(aimodel_plotdata: AimodelPlotdata):


@enforce_types
# pylint: disable=too-many-positional-arguments
def _add_contour_subplot(d, chosen_I, dim0, dim1, Z, colorscale, fig, row):
"""In-place update 'fig' at specified subplot row"""
Z = Z.reshape(dim1.shape)
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/contract/base_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def config(self):
def name(self):
return self.contract_name

# pylint: disable=too-many-positional-arguments
def send_encrypted_tx(
self,
function_name,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/deployer/util/models/PredictoorAgentConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

@dataclass
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
class PredictoorAgentConfig(SingleAgentConfig):
pair: str
timeframe: str
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/deployer/util/templates/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


@enforce_types
# pylint: disable=too-many-positional-arguments
def get_k8s_predictoor_template(
name,
app,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/dfbuyer/test/test_dfbuyer_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def test_dfbuyer_agent_get_missing_consume_times(mock_dfbuyer_agent):
@patch.object(DFBuyerAgent, "_get_missing_consume_times")
@patch.object(DFBuyerAgent, "_batch_txs")
@patch.object(Web3Config, "get_block")
# pylint: disable=too-many-positional-arguments
def test_dfbuyer_agent_take_step(
mock_get_block,
mock_batch_txs,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/lake/gql_data_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def _prepare_subgraph_fetch(self, dataclass: Type[LakeMapper], st_ut, fin_ut):
new_events_table._append_to_db(data, self.ppss)

@enforce_types
# pylint: disable=too-many-positional-arguments
def _do_subgraph_fetch(
self,
dataclass: Type[LakeMapper],
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/lake/payout.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@enforce_types
class Payout(LakeMapper): # pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
def __init__(
self,
ID: str,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/lake/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@enforce_types
class Prediction(LakeMapper):
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
def __init__(
self,
ID: str,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/lake/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@enforce_types
class Subscription(LakeMapper):
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
def __init__(
self,
ID: str,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/lake/trueval.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@enforce_types
class Trueval(LakeMapper):
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
def __init__(
self,
ID: str,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/pdr_dashboard/callbacks/callbacks_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def update_page_data(_start_date):
State("volume_max", "value"),
prevent_initial_call=True,
)
# pylint: disable=too-many-positional-arguments
def filter_table(
base_token,
quote_token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def update_page_data(_start_date):
State("net_income_max", "value"),
prevent_initial_call=True,
)
# pylint: disable=too-many-positional-arguments
def filter_table(
_n_clicks_apr,
_n_clicks_p_avg_accuracy,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/ppss/lake_ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def __str__(self) -> str:


@enforce_types
# pylint: disable=too-many-positional-arguments
def lake_ss_test_dict(
lake_dir: str,
feeds: Optional[list] = None,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/publisher/publish_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@


@enforce_types
# pylint: disable=too-many-positional-arguments
def publish_asset(
s_per_epoch: int,
s_per_subscription: int,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/sim/sim_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self):

self.yerrs: List[float] = [] # [i] : regressor pred'n errs, w/ sign

# pylint: disable=too-many-positional-arguments
def update(self, acc_est, acc_l, acc_u, f1, precision, recall, loss, yerr):
self.acc_ests.append(acc_est)
self.acc_ls.append(acc_l)
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/sim/sim_trader.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def close_short_position(self, buy_price: float) -> float:
return profit

# pylint: disable = too-many-return-statements
# pylint: disable = too-many-positional-arguments
def trade_iter(
self,
cur_close: float,
Expand Down
1 change: 1 addition & 0 deletions pdr_backend/subgraph/subgraph_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


class SubgraphFeed(StrMixin): # pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-positional-arguments
@enforce_types
def __init__(
self,
Expand Down

0 comments on commit 664a856

Please sign in to comment.