Skip to content

Commit 4cdfdf6

Browse files
committed
Update and apply lint stuff
1 parent 198382c commit 4cdfdf6

File tree

8 files changed

+13
-25
lines changed

8 files changed

+13
-25
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ pineko = "pineko:command"
7171
test = "pytest tests"
7272
bench.cmd = "pytest benchmarks"
7373
bench.env.NUMBA_DISABLE_JIT.default = "1"
74-
lint = "pylint src/**/*.py -E"
75-
lint-warnings = "pylint src/**/*.py --exit-zero"
74+
lint = "pylint src/ -E"
75+
lint-warnings = "pylint src/ --exit-zero"
7676
pineko = "pineko"
7777
docs = { "shell" = "cd docs; make html" }
7878
docs-view = { "shell" = "cd docs; make view" }

src/pineko/cli/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""CLI entry point to check compatibility."""
22
from collections import namedtuple
3-
from enum import Enum, auto
3+
from enum import Enum
44

55
import click
66
import eko

src/pineko/cli/convolute.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""CLI entry point to convolution."""
2-
import pathlib
3-
42
import click
53
import eko
64
import pineappl
75
import rich
8-
import yaml
9-
from eko import couplings as sc
106

117
from .. import evolve
128
from ._base import command

src/pineko/cli/scaffold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def check():
4242
rich.print("[red]Error:[/] Project is not correctly configured.")
4343
for conf in check_res.confs:
4444
rich.print(f"[red]Missing entry in conf file: '{conf}'")
45-
for key, folder in check_res.folders.items():
45+
for folder in check_res.folders.values():
4646
if not isinstance(folder, dict):
4747
rich.print(f"[red]Missing folder:\n{folder}")
4848
else:

src/pineko/configs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ def detect(path=None):
105105
configs_file = path / name if path.is_dir() else path
106106
if configs_file.is_file():
107107
return configs_file
108-
else:
109-
raise ValueError(
110-
"Provided path is not pointing to (or does not contain) the pineko.toml file"
111-
)
108+
raise ValueError(
109+
"Provided path is not pointing to (or does not contain) the pineko.toml file"
110+
)
112111

113112
# If no path is provided we need to look after the file.
114113
# We want to check cwd and all its parent folders (without their subfolders

src/pineko/evolve.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
import rich.box
1212
import rich.panel
1313
import yaml
14-
from eko.io.types import EvolutionMethod, ScaleVariationsMethod
15-
14+
from eko.io.types import ScaleVariationsMethod
1615

1716
from . import check, comparator, ekompatibility, version
1817

@@ -32,14 +31,11 @@ def sv_scheme(tcard):
3231
if np.isclose(xif, 1.0):
3332
if modsv in modsv_list:
3433
raise ValueError("ModSv is not None but xif is 1.0")
35-
else:
36-
return None
37-
else:
38-
# scheme C case
39-
if modsv not in modsv_list:
40-
return None
41-
else:
42-
return modsv
34+
return None
35+
# scheme C case
36+
if modsv not in modsv_list:
37+
return None
38+
return modsv
4339

4440

4541
def write_operator_card_from_file(

src/pineko/scaffold.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tools related to generation and managing of a pineko project."""
22

33
import dataclasses
4-
import os
54
import pathlib
65

76
from .configs import NEEDED_FILES, NEEDED_KEYS

src/pineko/theory.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import pineappl
1515
import rich
1616
import yaml
17-
from eko import couplings as sc
1817

1918
from . import check, configs, evolve, parser, theory_card
2019

@@ -393,7 +392,6 @@ def fk(self, name, grid_path, tcard, pdf):
393392
)
394393
# loading ekos
395394
with eko.EKO.edit(eko_filename) as operators:
396-
397395
# Obtain the assumptions hash
398396
assumptions = theory_card.construct_assumptions(tcard)
399397
# do it!

0 commit comments

Comments
 (0)