Skip to content

Commit

Permalink
Rely on typing for type annotations (needed for old Python versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Oct 18, 2024
1 parent c91c475 commit cbc74ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
9 changes: 5 additions & 4 deletions pineappl_py/tests/test_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
from pineappl.grid import Grid, Order
from pineappl.interpolation import Interp
from pineappl.pids import PidBasis
from typing import List


class TestEvolution:
def fake_grid(
self,
channels: list[Channel],
orders: list[Order],
convolutions: list[Conv],
bins: list[float] = [1e-7, 1e-3, 1],
channels: List[Channel],
orders: List[Order],
convolutions: List[Conv],
bins: List[float] = [1e-7, 1e-3, 1],
) -> Grid:
kinematics = [
Kinematics(0), # Scale
Expand Down
9 changes: 5 additions & 4 deletions pineappl_py/tests/test_fk_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
from pineappl.import_subgrid import ImportSubgridV1
from pineappl.interpolation import Interp
from pineappl.pids import PidBasis
from typing import List


class TestFkTable:
def fake_grid(
self,
channels: list[Channel],
orders: list[Order],
convolutions: list[Conv],
bins: list[float] = [1e-7, 1e-3, 1],
channels: List[Channel],
orders: List[Order],
convolutions: List[Conv],
bins: List[float] = [1e-7, 1e-3, 1],
) -> Grid:
kinematics = [
Kinematics(0), # Scale
Expand Down
8 changes: 5 additions & 3 deletions pineappl_py/tests/test_grid.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import numpy as np
import pytest

from pineappl.bin import BinRemapper
from pineappl.boc import Channel, Kinematics
from pineappl.convolutions import Conv, ConvType
from pineappl.grid import Grid, Order
from pineappl.import_subgrid import ImportSubgridV1
from pineappl.interpolation import Interp
from pineappl.pids import PidBasis
from typing import List

# Construct the type of convolutions and the convolution object
# We assume unpolarized proton PDF
Expand All @@ -22,9 +24,9 @@
class TestGrid:
def fake_grid(
self,
channels: list[Channel] = CHANNELS,
orders: list[Order] = ORDERS,
bins: list[float] = [1e-7, 1e-3, 1],
channels: List[Channel] = CHANNELS,
orders: List[Order] = ORDERS,
bins: List[float] = [1e-7, 1e-3, 1],
) -> Grid:
# We assume symmetrical proton-proton in the initial state
convolutions = [CONVOBJECT, CONVOBJECT]
Expand Down

0 comments on commit cbc74ae

Please sign in to comment.