Skip to content

Commit a1a75fb

Browse files
Remove unnecessary methods from the Python API
1 parent 161eec7 commit a1a75fb

File tree

6 files changed

+0
-58
lines changed

6 files changed

+0
-58
lines changed

pineappl_py/src/boc.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,6 @@ impl PyChannel {
274274
}
275275
}
276276

277-
/// Get the factors for all the channels.
278-
///
279-
/// Returns
280-
/// -------
281-
/// list(float) :
282-
/// list containing the factor values
283-
#[must_use]
284-
pub fn factors(&self) -> Vec<f64> {
285-
self.entry.entry().iter().map(|(_, f)| *f).collect()
286-
}
287-
288277
/// Get list representation.
289278
///
290279
/// Returns

pineappl_py/src/fk_table.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,6 @@ impl PyFkTable {
175175
self.fk_table.channels()
176176
}
177177

178-
/// Extract the factors from all the channels.
179-
///
180-
/// Returns
181-
/// -------
182-
/// list(float) :
183-
/// list containing the factor values
184-
#[must_use]
185-
pub fn channels_factors(&self) -> Vec<f64> {
186-
self.fk_table
187-
.grid()
188-
.channels()
189-
.iter()
190-
.flat_map(|entry| entry.entry().iter().map(|(_, f)| *f))
191-
.collect()
192-
}
193-
194178
/// Get squared factorization scale.
195179
///
196180
/// Returns

pineappl_py/src/grid.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -692,21 +692,6 @@ impl PyGrid {
692692
.collect()
693693
}
694694

695-
/// Extract the factors from all the channels.
696-
///
697-
/// Returns
698-
/// -------
699-
/// list(float) :
700-
/// list containing the factor values
701-
#[must_use]
702-
pub fn channels_factors(&self) -> Vec<f64> {
703-
self.grid
704-
.channels()
705-
.iter()
706-
.flat_map(|entry| entry.entry().iter().map(|(_, f)| *f))
707-
.collect()
708-
}
709-
710695
/// Deduplicate channels
711696
///
712697
/// Parameters

pineappl_py/tests/test_boc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ def test_init(self):
6262
channel = Channel([([2, -2], 0.5)])
6363
assert isinstance(channel, Channel)
6464
assert channel.into_array() == [([2, -2], 0.5)]
65-
assert channel.factors() == [0.5]
6665

6766
channels = Channel([([2, -2], 0.5), ([3, -3], 1.5)])
6867
assert isinstance(channels, Channel)
6968
assert channels.into_array() == [([2, -2], 0.5), ([3, -3], 1.5)]
70-
assert channels.factors() == [0.5, 1.5]
7169

7270

7371
class TestKinematics:

pineappl_py/tests/test_fk_table.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,9 @@ def test_fktable_rotations(
127127
fk_table = download_objects(f"{fkname}")
128128
fk = FkTable.read(fk_table)
129129

130-
# record the channel factors and check they are unity
131-
fk_evol_facs = fk.channels_factors()
132-
np.testing.assert_array_equal(fk_evol_facs, 1)
133-
134130
# rotate in the PDG basis and check that all the factors are unity
135131
fk.rotate_pid_basis(PidBasis.Pdg)
136132
assert fk.pid_basis == PidBasis.Pdg
137-
fk_pdg_facs = fk.channels_factors()
138-
np.testing.assert_array_equal(fk_pdg_facs, 1)
139133

140134
# check that the convolutions are still the same
141135
np.testing.assert_allclose(

pineappl_py/tests/test_grid.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,21 +417,13 @@ def test_grid_rotations(
417417
grid = download_objects(f"{gridname}")
418418
g = Grid.read(grid)
419419

420-
# record the channel factors and check that some factors are not `1`
421-
g_pdf_facs = g.channels_factors()
422-
with pytest.raises(expected_exception=AssertionError):
423-
np.testing.assert_array_equal(g_pdf_facs, 1)
424-
425420
# rotate in the Evolution basis
426421
g.rotate_pid_basis(PidBasis.Evol)
427422
assert g.pid_basis == PidBasis.Evol
428423

429424
# merge the factors and check that the channels are to unity
430425
g.split_channels()
431426
g.merge_channel_factors()
432-
# optimize the grid to remove duplicate channels
433-
g_facs = g.channels_factors()
434-
np.testing.assert_array_equal(g_facs, 1)
435427

436428
# check that the convolutions are still the same
437429
np.testing.assert_allclose(

0 commit comments

Comments
 (0)