Skip to content

Commit eb96610

Browse files
Remove ambiguous methods from FkTable and keep only rotate_pid_basis
1 parent f1b2e78 commit eb96610

3 files changed

Lines changed: 5 additions & 32 deletions

File tree

pineappl/src/fk_table.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use super::boc::{Channel, Kinematics, Order};
44
use super::convolutions::ConvolutionCache;
55
use super::error::{Error, Result};
6-
use super::grid::Grid;
6+
use super::grid::{Grid, GridOptFlags};
77
use super::pids::{OptRules, PidBasis};
88
use super::subgrid::{self, EmptySubgridV1, Subgrid};
99
use ndarray::{s, ArrayD};
@@ -252,16 +252,9 @@ impl FkTable {
252252
/// Rotate the FK Table into the specified basis.
253253
pub fn rotate_pid_basis(&mut self, pid_basis: PidBasis) {
254254
self.grid.rotate_pid_basis(pid_basis);
255-
}
256-
257-
/// Merges the factors of the channels into the subgrids to normalize channel coefficients.
258-
pub fn merge_channel_factors(&mut self) {
259-
self.grid.merge_channel_factors();
260-
}
261-
262-
/// Splits the grid such that each channel contains only a single tuple of PIDs.
263-
pub fn split_channels(&mut self) {
264255
self.grid.split_channels();
256+
self.grid.merge_channel_factors();
257+
self.grid.optimize_using(GridOptFlags::all());
265258
}
266259

267260
/// Optimize the size of this FK-table by throwing away heavy quark flavors assumed to be zero

pineappl_py/src/fk_table.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,6 @@ impl PyFkTable {
244244
self.fk_table.rotate_pid_basis(pid_basis.into());
245245
}
246246

247-
/// Merge the factors of all the channels.
248-
pub fn merge_channel_factors(&mut self) {
249-
self.fk_table.merge_channel_factors();
250-
}
251-
252-
/// Splits the grid such that each channel contains only a single tuple of PIDs.
253-
pub fn split_channels(&mut self) {
254-
self.fk_table.split_channels();
255-
}
256-
257247
/// Write to file.
258248
///
259249
/// # Panics

pineappl_py/tests/test_fk_table.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66

77
import numpy as np
8-
import pytest
98
import tempfile
109

1110
from pineappl.boc import Channel, Order
@@ -129,20 +128,11 @@ def test_fktable_rotations(
129128
fk_evol_facs = fk.channels_factors()
130129
np.testing.assert_array_equal(fk_evol_facs, 1)
131130

132-
# rotate in the PDG basis and check that some factors are not `1`
131+
# rotate in the PDG basis and check that all the factors are unity
133132
fk.rotate_pid_basis(PidBasis.Pdg)
134133
assert fk.pid_basis == PidBasis.Pdg
135134
fk_pdg_facs = fk.channels_factors()
136-
with pytest.raises(expected_exception=AssertionError):
137-
np.testing.assert_array_equal(fk_pdg_facs, 1)
138-
139-
# merge the factors and check that they are back to unity
140-
fk.split_channels()
141-
fk.merge_channel_factors()
142-
# optimize the FK table to remove duplicate channels
143-
fk.optimize(FkAssumptions("Nf6Ind"))
144-
fk_facs = fk.channels_factors()
145-
np.testing.assert_array_equal(fk_facs, 1)
135+
np.testing.assert_array_equal(fk_pdg_facs, 1)
146136

147137
# check that the FK table can be loaded properly
148138
with tempfile.TemporaryDirectory() as tmpdir:

0 commit comments

Comments
 (0)