diff --git a/ixmp/backend/io.py b/ixmp/backend/io.py index e4461e777..92b6e2c1a 100644 --- a/ixmp/backend/io.py +++ b/ixmp/backend/io.py @@ -174,7 +174,7 @@ def maybe_init_item(scenario, ix_type, name, new_idx, path): raise ValueError from None -# FIXME reduce complexity from 26 to <=15 +# FIXME reduce complexity 22 → ≤13 def s_read_excel( # noqa: C901 be, s, path, add_units=False, init_items=False, commit_steps=False ): diff --git a/ixmp/backend/jdbc.py b/ixmp/backend/jdbc.py index f93b4069b..671276168 100644 --- a/ixmp/backend/jdbc.py +++ b/ixmp/backend/jdbc.py @@ -965,7 +965,7 @@ def item_index(self, s, name, sets_or_names): jitem = self._get_item(s, "item", name, load=False) return list(getattr(jitem, f"getIdx{sets_or_names.title()}")()) - # FIXME reduce complexity from 19 to <=15 + # FIXME reduce complexity 18 → ≤13 def item_get_elements(self, s, type, name, filters=None): # noqa: C901 if filters: # Convert filter elements to strings diff --git a/ixmp/core/scenario.py b/ixmp/core/scenario.py index 97836e777..26de09b20 100644 --- a/ixmp/core/scenario.py +++ b/ixmp/core/scenario.py @@ -186,7 +186,7 @@ def set( """ return self._backend("item_get_elements", "set", name, filters) - # FIXME reduce complexity from 17 to <=15 + # FIXME reduce complexity 18 → ≤13 def add_set( # noqa: C901 self, name: str, @@ -535,7 +535,8 @@ def list_items( #: List all defined variables. See :meth:`list_items`. var_list = partialmethod(list_items, ItemType.VAR) - def add_par( + # FIXME reduce complexity 15 → ≤13 + def add_par( # noqa: C901 self, name: str, key_or_data: Optional[Union[str, Sequence[str], Dict, pd.DataFrame]] = None, diff --git a/pyproject.toml b/pyproject.toml index 921e71973..421a53896 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,10 +109,11 @@ markers = [ [tool.ruff.lint] select = ["C9", "E", "F", "I", "W"] # FIXME the following exceed this limit -# .backend.io.s_read_excel: 26 -# .backend.jdbc.JDBCBackend.item_get_elements: 19 -# .core.scenario.Scenario.add_set: 17 -mccabe.max-complexity = 15 +# .backend.io.s_read_excel: 22 +# .backend.jdbc.JDBCBackend.item_get_elements: 18 +# .core.scenario.Scenario.add_par: 15 +# .core.scenario.Scenario.add_set: 18 +mccabe.max-complexity = 13 [tool.setuptools.packages] find = {}