Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement v1 file format [WIP] #299

Draft
wants to merge 283 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
5436765
Remove obsolete subgrid types
t7phy Aug 8, 2024
cbe586c
Do not run python CI in this branch
t7phy Aug 8, 2024
2ba8cc2
Remove leftover `ImportOnlySubgridV1`
t7phy Aug 8, 2024
63ab6ea
Remove `ImportOnlySubgridV2`
t7phy Aug 8, 2024
53f33ce
Fix `build.rs` already triggering rebuild
cschwan Jul 31, 2024
ca8d029
Fix numerical noise
cschwan Aug 8, 2024
d1be640
Add convolutions to `Grid` constructor
t7phy Aug 8, 2024
1e2f4d8
Fix a few clippy warnings
cschwan Aug 9, 2024
41a6782
Remove obsolete `SparseArray3`
cschwan Aug 9, 2024
4d1fc39
Use integers to avoid floating point comparisons
cschwan Aug 9, 2024
0e30f00
Fix documentation links
cschwan Aug 9, 2024
34c14ec
Prepare code for fragmentation scale variation
t7phy Aug 9, 2024
df2cb57
Replace `Ntuple` with slice
t7phy Aug 16, 2024
5d71c36
Remove `Subgrid::convolve`
t7phy Aug 16, 2024
a2cd483
Remove three clippy warnings
cschwan Aug 18, 2024
c3dc6f3
Improve `packed_subgrid.rs`
cschwan Aug 18, 2024
33a4957
Increase code coverage
cschwan Aug 19, 2024
cb937f6
Fix bug in `LagrangeSubgridV2::stats`
cschwan Aug 19, 2024
c9b737c
Remove `factor == 0` optimization
cschwan Aug 19, 2024
7409f3c
Increase doctest coverage of `LagrangeSubgridV2`
cschwan Aug 19, 2024
e5b7b34
Remove unneeded derivations for `ExtraSubgridParams`
cschwan Aug 19, 2024
75355e3
Use assignment instead of `swap`
cschwan Aug 19, 2024
67265c9
Temporarily remove trait implementation
cschwan Aug 19, 2024
efdabd4
Revert unintended changes from commit cb937f
cschwan Aug 19, 2024
7bbde3a
Remove obsolete `FkTable` methods
cschwan Aug 19, 2024
1fab0ea
Increase code coverage
cschwan Aug 19, 2024
2f06916
Increase code coverage
cschwan Aug 20, 2024
7b255aa
Generalize convolution helpers and increase test coverage
cschwan Aug 20, 2024
6935d9a
Move v0 file conversion into separate module
cschwan Aug 22, 2024
501a29a
Rename `pdg_channels` to `channels_pdg`
cschwan Aug 22, 2024
12a4b18
Merge branch 'master' into v1-file-format
cschwan Aug 23, 2024
2c9ade2
Update `managed-lhapdf` from 0.3.3 to 0.3.4
cschwan Aug 24, 2024
ebf6770
Remove deprecated `Grid::evolve` method
cschwan Sep 1, 2024
a1365f2
Remove struct `OperatorInfo`
cschwan Sep 1, 2024
2b21919
Fix one clippy warning
cschwan Sep 1, 2024
89e3daa
Add preliminary interpolation module
cschwan Sep 1, 2024
9179d06
Fix documentation links
cschwan Sep 3, 2024
f6a8088
Remove additional argument
cschwan Sep 3, 2024
4a7cd59
Add new method `Grid::charge_conjugate`
cschwan Sep 3, 2024
3144988
Polish interpolation a bit
cschwan Sep 3, 2024
f39219f
Prevent 'functions have mismatched data' warnings
cschwan Sep 3, 2024
d454d5f
Debug new module `interpolation`
t7phy Sep 3, 2024
5ae6466
Fix problems in previous commit
cschwan Sep 3, 2024
18f84ec
Make `Channel::translate` a method
cschwan Sep 4, 2024
add7baa
Add test for new interpolation module
cschwan Sep 4, 2024
7d92ea0
Increase MSRV from 1.70.0 to 1.80.1
cschwan Sep 4, 2024
e3acdd5
Use nightly as default
cschwan Sep 4, 2024
0c56545
Raise version of `cargo-c`
cschwan Sep 4, 2024
dec24a7
Fix library installation directory
cschwan Sep 4, 2024
48c3e9c
Improve test coverage of interpolation module
cschwan Sep 4, 2024
41b294a
Test interpolation with one node
cschwan Sep 5, 2024
3c5223c
Add more documentation and comments
cschwan Sep 5, 2024
9ccb176
Fix CAPI library installation directory
cschwan Sep 5, 2024
719a45d
Fix `generate-coverage.sh` script
cschwan Sep 5, 2024
9f303ce
Prepare replacement of `LagrangeSubgridV2`
t7phy Sep 6, 2024
cd3dd32
Fix bug in `LagrangeSubgridV2::merge`
cschwan Sep 8, 2024
cb1ce33
Return support for static scale detection
cschwan Sep 8, 2024
7d6c9f8
Check number of channel PIDs
cschwan Sep 10, 2024
36a46b4
Add enum `Kinematics`
cschwan Sep 10, 2024
885ef07
Introduce `kinematics` into `Grid`
cschwan Sep 10, 2024
2203f22
Rename `Interp::nodes` to `Interp::node_values`
t7phy Sep 10, 2024
d2f8397
Replace `SubgridParams` and `ExtraSubgridParams` with `Interp`
t7phy Sep 10, 2024
b2cd8a7
Fix bug returning variables from y-space instead of x
cschwan Sep 10, 2024
a6827ca
Merge branch 'master' into v1-file-format
cschwan Sep 11, 2024
88f9151
Fix a few clippy lints
cschwan Sep 11, 2024
f13095d
Remove `MoreMembers::upgrade` method
cschwan Sep 11, 2024
0dcd118
Move members from `MoreMembers` into `Grid`
cschwan Sep 11, 2024
c677a63
Remove `Grid::with_subgrid_type` constructor
cschwan Sep 11, 2024
46fe945
Change ordering of `ntuples` in `Grid::fill`
cschwan Sep 11, 2024
fd68be7
Add missing changelog item
cschwan Sep 11, 2024
bcae6a5
Add the interpolation as a parameter to `Subgrid::fill`
cschwan Sep 11, 2024
9aa79ea
Make `pid_basis` an argument of `Grid::new`
cschwan Sep 11, 2024
29f48d0
Remove `PackedQ1X2SubgridV1::array_mut`
cschwan Sep 11, 2024
f67a341
Remove `Subgrid::clone_empty`
cschwan Sep 12, 2024
90ab92c
Rename `grid` to `array`
cschwan Sep 12, 2024
751f92c
Unify the methods of `LagrangeSubgridV2` and `PackedQ1X2SubgridV1`
cschwan Sep 12, 2024
f3ae04f
Add 'test-opt' profile for fast tests
cschwan Sep 12, 2024
b16ac2e
Remove `PackedArray::default` method
cschwan Sep 13, 2024
4f05cb8
Remove `mut` from `Subgrid::merge`
cschwan Sep 13, 2024
dc62e5a
Remove specification of dimension in `PackedArray`
t7phy Sep 13, 2024
c437e0c
Add more index methods to `PackedArray`
t7phy Sep 13, 2024
315e285
Remove more static specifications of the dimension
cschwan Sep 17, 2024
72beb7a
Make ravel functions private again
cschwan Sep 17, 2024
44dc9f0
Remove `D` from `interpolate`
t7phy Sep 17, 2024
f5d3e07
Make `Subgrid::indexed_iter` independent of dimensions
t7phy Sep 17, 2024
2a3dc73
Generalize `Subgrid::symmetrize`
t7phy Sep 17, 2024
9135e11
Add new type `NodeValues` and use it
t7phy Sep 17, 2024
3fac121
Fix compilation problems and some bugs
cschwan Sep 18, 2024
3efc12b
Change argument type of `PackedArray`'s constructor
cschwan Sep 18, 2024
74d9ae7
Fix bugs in `PackedQ1X2SubgridV1::merge`
cschwan Sep 18, 2024
5429a9f
Add initial support for flexible-scale grids
cschwan Sep 19, 2024
876e23b
Ignore flexible-scale grid tests for the time being
cschwan Sep 19, 2024
726ca36
Remove `{mu2,x1,x2}_grid` members in `packed_subgrid.rs`
t7phy Sep 19, 2024
aa4a097
Silence warnings
cschwan Sep 20, 2024
763906a
Add new methods `ScaleFuncForm::calc` and `Scales::compatible_with`
cschwan Sep 20, 2024
b225b0c
Remove last calls to `{mu2,x1,x2}_grid` in subgrid types
t7phy Sep 20, 2024
e51c1d1
Migrate `AlphasTable::from_grid` to `NodeValues`
t7phy Sep 20, 2024
7ad6515
Remove two references to `x{1,2}_grid` in the evolution
cschwan Sep 20, 2024
a8e02ed
Migrate `grid.rs` to `NodeValues`
t7phy Sep 20, 2024
91238e4
Migrate more call sites to `NodeValues`
t7phy Sep 20, 2024
e010ffa
Migrate DY test to `Subgrid::node_values`
cschwan Sep 24, 2024
8012a94
Remove commented-out code
cschwan Sep 24, 2024
ac95f26
Removee more `x{1,2}_grid` calls
t7phy Sep 24, 2024
3994031
Fix integration test
cschwan Oct 1, 2024
751623a
Add some cosmetic fixes
cschwan Oct 1, 2024
6f13cbd
Remove `x{1,2}_grid` methods
t7phy Oct 1, 2024
ab84b0f
Remove `Subgrid::mu2_grid`
t7phy Oct 1, 2024
4cc8094
Rename `LumiCache` to `ConvolutionCache`
t7phy Oct 3, 2024
f259f63
Run `cargo fmt`
t7phy Oct 3, 2024
cbdb528
Start generalizing `ConvolutionCache` to arbitrary dimensions
t7phy Oct 3, 2024
76cabc3
Generalize `ConvolutionCache` even further
t7phy Oct 3, 2024
cc798a8
Merge `Pdfs` into `ConvolutionCache`
cschwan Oct 4, 2024
59d52a9
Match convolution functions with convolutions
cschwan Oct 4, 2024
bf02084
Generalize `ConvolutionCache::fx_prod`
cschwan Oct 4, 2024
c196936
Add generalized constructor for `ConvolutionCache`
cschwan Oct 4, 2024
9d63ba7
Polish `PackedArray` a bit
cschwan Oct 4, 2024
6e3a578
Increase test coverage of `packed_array.rs`
cschwan Oct 4, 2024
2a4f79c
Save convolution type in `ConvolutionCache`
t7phy Oct 4, 2024
7569391
Add support for a fragmentation scale
t7phy Oct 4, 2024
a9c5784
Start generalizing evolution methods
t7phy Oct 7, 2024
f6587e9
Reformat `read_convolutions_from_metadata`
cschwan Oct 9, 2024
0632b03
Generalize `ndarray_from_subgrid_orders_slice_many` a bit
cschwan Oct 9, 2024
ae4b9a1
Start getting rid of `Convolution::None`
cschwan Oct 10, 2024
defd91e
Delete unused functions
t7phy Oct 10, 2024
461d536
Remove `Convolution::None` and start fixing the importing of DIS grids
t7phy Oct 10, 2024
0a66c20
Fix failing doctest and make DIS FK-table subgrids 2-dimensional
cschwan Oct 10, 2024
1e17155
Fix dimensionality of imported DIS fastNLO tables
cschwan Oct 10, 2024
1affcbb
Add support for `polarized` and `time_like` fields
cschwan Oct 11, 2024
a06503b
Rename `Convolution` to `Conv` and introduce `ConvType`
cschwan Oct 11, 2024
870eb26
Remove some traces of `Convolution::None`
t7phy Oct 11, 2024
5067abf
Add new method `Grid::evolve`
t7phy Oct 11, 2024
a401ca0
Reformat `Grid::evolve`
cschwan Oct 12, 2024
aeaefd9
Allow missing docs for tests
cschwan Oct 12, 2024
f09956d
Fix a few clippy warnings
cschwan Oct 12, 2024
823b20f
Add new method `PidBasis::translate`
cschwan Oct 12, 2024
d4d9ec1
Increase code coverage a bit
cschwan Oct 12, 2024
db0fafd
Disable carryforward to remove Python test coverage
cschwan Oct 14, 2024
2422392
Start fixing Python interface
Radonirinaunimi Oct 16, 2024
c396845
Fix `pineappl` Python module
Radonirinaunimi Oct 16, 2024
b140e65
Start fixing Python tests
Radonirinaunimi Oct 16, 2024
e32f543
Add preliminary Python interface to `packed_subgrid`
Radonirinaunimi Oct 16, 2024
d13e325
Simplify implementation of `ConvolutionCache::setup`
cschwan Oct 15, 2024
d728202
Merge alphas evaluation into other function
cschwan Oct 15, 2024
17e608e
Prepare `ConvolutionCache::setup` for multiple scales
cschwan Oct 15, 2024
35849fd
Add some trivial fixes to Python API tests
cschwan Oct 17, 2024
c795a24
Re-enable Python tests in CI
cschwan Oct 17, 2024
e4604f3
Add some small fixes
t7phy Oct 17, 2024
4e0214c
Add fragmentation scaling factor to `Grid::scale_by_order`
t7phy Oct 17, 2024
c134c7e
Rename `LagrangeSubgridV2` to `InterpSubgridV1`
t7phy Oct 17, 2024
9182bdb
Rename `PackedQ1X2SubgridV1` to `ImportSubgridV1`
t7phy Oct 17, 2024
aeab8d2
Make 7 and 9-pt variation dependent on scales in grid
t7phy Oct 17, 2024
d050130
Test more scale variations
cschwan Oct 17, 2024
11dcd8c
Change type of `Order` members from `u32` to `u8`
cschwan Oct 17, 2024
fdde7d3
Remove `NodeValues` type
cschwan Oct 17, 2024
63924e1
Add numerical tolerance in `ImportSubgridV1::merge`
cschwan Oct 17, 2024
49df463
Continue fixing `test_grid.py`
Radonirinaunimi Oct 17, 2024
90b836e
Propagate `PackedSubgrid` into the Python tests
Radonirinaunimi Oct 17, 2024
067d7f6
Make the Python tests pass
Radonirinaunimi Oct 17, 2024
bdfca60
Replace `PyPackedArray` -> `PyImportSubgridV1`
Radonirinaunimi Oct 18, 2024
5f68dcf
Add docstrings to Python Interface and clean tests
Radonirinaunimi Oct 18, 2024
f354849
Sort import modules for tests
Radonirinaunimi Oct 18, 2024
f5f46d6
Init general convolution for PyAPI
Radonirinaunimi Oct 18, 2024
cfc1edf
Fix type annotations for python tests
Radonirinaunimi Oct 18, 2024
bd3438a
Revert "Fix type annotations for python tests"
Radonirinaunimi Oct 18, 2024
c91c475
Fix object is not iterable in all `bins` argument
Radonirinaunimi Oct 18, 2024
cbc74ae
Rely on `typing` for type annotations (needed for old Python versions)
Radonirinaunimi Oct 18, 2024
ca1df43
Merge branch `master` into `v1-file-format`
Radonirinaunimi Oct 18, 2024
48be5a4
Use `into` instead of `try_into` when possible
cschwan Oct 18, 2024
f62412e
Fix numerical noise
cschwan Oct 18, 2024
a884201
Get rid of a few `unwrap` calls
cschwan Oct 18, 2024
f1574a3
Make Generalized convolution works
Radonirinaunimi Oct 18, 2024
92212a6
Implement generalized `convolve` and `evolve` (removes old `_with_`)
Radonirinaunimi Oct 19, 2024
b41d304
Revamp Python tests
Radonirinaunimi Oct 19, 2024
a46a9fb
Improve Python tests and their coverage
Radonirinaunimi Oct 20, 2024
a1fa114
Import DIS APPLgrids with correct dimensions
cschwan Oct 22, 2024
3a2372c
Refactor `ConvolutionCache`
cschwan Oct 22, 2024
6221536
Update PyO3 and Numpy from 0.21.x to 0.22.x
cschwan Oct 22, 2024
ee72972
Allow numpy-2
cschwan Oct 22, 2024
3fe8b62
Increase minimal Python version to 3.7
cschwan Oct 22, 2024
9dfdfcf
Test and release wheels for Python 3.13
cschwan Oct 22, 2024
95cba12
Fixed shapes of `array` and `node_values` of `ImportSubgridV1` for DIS
Radonirinaunimi Oct 22, 2024
05a4c3e
Fix some clippy warnings
cschwan Oct 22, 2024
411a6ae
Fix most 'strict comparison of ...' warnings
cschwan Oct 22, 2024
06e16b9
Fix compilation error with no features
cschwan Oct 22, 2024
6f83118
Add some cosmetic fixes
cschwan Oct 22, 2024
c0fe82a
Modify `ImportSubgridV1` to accept a generic `N`-dimensional objects
Radonirinaunimi Oct 22, 2024
9e30754
Start generalizing C-interface with `_lumi_add2`, `_grid_new2`, and `…
Radonirinaunimi Oct 23, 2024
1803eee
Allow more general kinematics in convolutions
cschwan Oct 23, 2024
5ff86af
Generalize `kinematics` in `pineappl_grid_new2`
Radonirinaunimi Oct 23, 2024
342b7ff
Generalize treatment of scales
t7phy Oct 23, 2024
0c264c8
Add partial support for flexible-scale grids
cschwan Oct 23, 2024
93d4d62
Properly generalize kinematics in `pineappl_grid_add_new`
Radonirinaunimi Oct 23, 2024
4d0f526
Expose `Scales` in `pineappl_grid_new2` and add C++ example
Radonirinaunimi Oct 23, 2024
9518fb6
Add forgotten C++ example
Radonirinaunimi Oct 23, 2024
08a1490
Fix C++ examples output
cschwan Oct 24, 2024
d9b50e3
Restore remaining ignored tests
cschwan Oct 24, 2024
016eb4b
Promote arguments of `pineappl_grid_new2` to Rust `enum`
Radonirinaunimi Oct 24, 2024
80bd3f1
Re-fix output of cpp examples
Radonirinaunimi Oct 24, 2024
2a36294
Greatly improve Python Interface by reflecting from C-API implementation
Radonirinaunimi Oct 24, 2024
b6abfbe
Exposes `Scales` in the Grid creation of the Python API
Radonirinaunimi Oct 24, 2024
60d808e
Potentially completes the `C` interface
Radonirinaunimi Oct 25, 2024
a4b44ed
Start extending the Fortran API
Radonirinaunimi Oct 26, 2024
489edbd
Almost fully completes Python interface
Radonirinaunimi Oct 26, 2024
48d6f26
Promote `PyKinematics` and `PyScaleFuncForm` to `enum`
Radonirinaunimi Oct 27, 2024
1145cb7
Generalize `channel` macro
cschwan Oct 28, 2024
366ace1
Generalize static node value detection
t7phy Oct 28, 2024
0169688
Use `Grid` constructor in favor of `pub(crate)`
cschwan Oct 28, 2024
115de08
Fix scales of FK-tables
cschwan Oct 28, 2024
813125c
Complete C interface
Radonirinaunimi Oct 28, 2024
934d153
Add C++ example to check `pineappl_grid_convolve`
Radonirinaunimi Oct 28, 2024
2f79ef5
Remove no longer existing method that lead pytest to fail
Radonirinaunimi Oct 28, 2024
ada5ef5
Remove `Mu2` struct
cschwan Oct 30, 2024
67edab5
Fix a few clippy warnings
cschwan Oct 30, 2024
23628b3
Remove `PyMu2` from Python interface
cschwan Oct 30, 2024
54a59f3
Rename `Subgrid::optimize_static_nodes` to `optimize_nodes`
cschwan Oct 30, 2024
4aeb2a2
Addres temp `PyGrid.evolve` and polish Python tests
Radonirinaunimi Oct 30, 2024
1149688
Add missed `PyGrid.set_key_value` back
Radonirinaunimi Oct 30, 2024
fb2cfee
Introduce `node_value_eq` and `node_value_eq_ref_mut` functions
cschwan Oct 31, 2024
94fe284
Use `node_value_eq{,_ref_mut}` everywhere
cschwan Oct 31, 2024
2020712
Make `fx2` function more accurate
cschwan Nov 1, 2024
7d1e3f5
Add some cosmetic fixes
cschwan Nov 1, 2024
84a4e97
Complete final missing `PyInterface` and make tests more Robust
Radonirinaunimi Nov 3, 2024
5731806
Fix grammatical mistakes from code review
cschwan Nov 4, 2024
b713e61
Add FK-table optimizations for PDG PIDs
cschwan Nov 5, 2024
5ab2b87
Address most of `TODO`s in `PyInterface` and comment from review
Radonirinaunimi Nov 4, 2024
5c3bf0e
Improve Python test coverage
Radonirinaunimi Nov 5, 2024
3ae285d
Update Python tutorials
Radonirinaunimi Nov 5, 2024
af0d387
Fix import/export scale variation comparison
cschwan Nov 5, 2024
e7c2e88
Address comments from Code Review RE Python tutorials
Radonirinaunimi Nov 6, 2024
a64f897
Various minor improvements for Python API
Radonirinaunimi Nov 12, 2024
98f89f4
Methods relevant for `pineko`
Radonirinaunimi Nov 12, 2024
af78cb4
Exposes more Python methods for `pineko`
Radonirinaunimi Nov 12, 2024
daefaee
Small bug fixes
janw20 Nov 15, 2024
63dc010
Complete Fortran interface
janw20 Nov 15, 2024
911557a
Update the Fortran examples
janw20 Nov 15, 2024
d71ac51
Exposes `pineappl.convolutions.Conv.pid` for `validphys`
Radonirinaunimi Nov 18, 2024
95ff7eb
Expose more Python methods that are directly requried by `pineko`
Radonirinaunimi Nov 23, 2024
230f648
Exposes `key_values` and `set_key_values` for `PyFkTable`
Radonirinaunimi Nov 26, 2024
b10dc84
Increase Python coverage and add cosmetic changes
Radonirinaunimi Nov 27, 2024
c057145
Use `*channels_*` convention and add cosmetic changes to C-API
Radonirinaunimi Nov 27, 2024
5ba8af1
Propagate conventions to Fortran API (issues with examples not solved…
Radonirinaunimi Nov 28, 2024
8855dab
Merge branch 'master' into v1-file-format
Radonirinaunimi Dec 1, 2024
fa46e44
Fix minor issues during merge
Radonirinaunimi Dec 1, 2024
3386f4b
Format all files using `pre-commit hooks`
Radonirinaunimi Dec 1, 2024
b230bb5
Exposes methods that would be required by `pineko#183` and more
Radonirinaunimi Dec 2, 2024
f57f664
Fix another bites in type annotation from `python3.7`
Radonirinaunimi Dec 2, 2024
f478e29
Change to double precision constants + small fixes
janw20 Dec 2, 2024
dddf825
Add Fortran v1 example binaries to gitignore
janw20 Dec 2, 2024
ecb8ef5
Fix back scale variations for `pineappl convolve` CLI
Radonirinaunimi Dec 2, 2024
adeb134
Check that convolutions remain the same after rotating PID basis
Radonirinaunimi Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions pineappl_cli/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,29 @@ impl Subcommand for Opts {
})
.collect();

let max_rel_diff = rel_diffs
.iter()
.max_by(|a, b| a.abs().partial_cmp(&b.abs()).unwrap())
.unwrap()
.abs();

if max_rel_diff > self.accuracy {
different = true;
}

let mut row = row![
bin.to_string(),
r->format!("{:.*e}", self.digits_abs, one[0]),
r->format!("{:.*e}", self.digits_abs, two[0]),
r->format!("{:.*e}", self.digits_rel, rel_diffs[0])
];

if rel_diffs[0].abs() > self.accuracy {
different = true;
}

if scale_variations > 1 {
// skip central scale choice
let &max_rel_diff = rel_diffs[1..]
.iter()
.max_by(|a, b| a.abs().total_cmp(&b.abs()))
// UNWRAP: in this branch we know there are scale variations
.unwrap();

if max_rel_diff.abs() > self.accuracy {
different = true;
}

row.add_cell(cell!(r->format!("{:.*e}", self.digits_rel, max_rel_diff)));
}

Expand Down
25 changes: 15 additions & 10 deletions pineappl_cli/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,24 +313,29 @@ impl Subcommand for Opts {
})
.collect();

let max_rel_diff = rel_diffs
.iter()
.max_by(|a, b| a.abs().total_cmp(&b.abs()))
.unwrap()
.abs();

if max_rel_diff > self.accuracy {
different = true;
}

let mut row = row![
bin.to_string(),
r->format!("{:.*e}", self.digits_abs, one[0]),
r->format!("{:.*e}", self.digits_abs, two[0]),
r->format!("{:.*e}", self.digits_rel, rel_diffs[0])
];

if rel_diffs[0].abs() > self.accuracy {
different = true;
}

if scale_variations > 1 {
// skip central scale choice
let &max_rel_diff = rel_diffs[1..]
.iter()
.max_by(|a, b| a.abs().total_cmp(&b.abs()))
// UNWRAP: in this branch we know there are scale variations
.unwrap();

if max_rel_diff.abs() > self.accuracy {
different = true;
}

row.add_cell(cell!(r->format!("{:.*e}", self.digits_rel, max_rel_diff)));
}

Expand Down
239 changes: 120 additions & 119 deletions pineappl_cli/tests/import.rs

Large diffs are not rendered by default.

113 changes: 101 additions & 12 deletions pineappl_py/docs/source/advanced.ipynb

Large diffs are not rendered by default.

Loading