diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 961db5fa..118dec6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -168,7 +168,7 @@ jobs: else gh release edit v${version} -n "" --prerelease fi - find artifacts -name 'pineappl*' -type f -exec gh release upload v${version} {} + + find artifacts -name 'pineappl_*' -type f -exec gh release upload v${version} {} + gh release edit v${version} --draft=false publish-crates: diff --git a/CHANGELOG.md b/CHANGELOG.md index 00234ec9..de445cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.7.5] - 30/08/2024 + +### Fixed + +- fixed a problem in the evolution when an EKO with 'similar' Q2 slices was + used to evolve; this caused the Q2 slices of the grids to be evolved several + times, leading to wrong results + ## [0.7.4] - 23/05/2024 ### Added @@ -565,7 +573,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - first release -[Unreleased]: https://github.com/NNPDF/pineappl/compare/v0.7.4...HEAD +[Unreleased]: https://github.com/NNPDF/pineappl/compare/v0.7.5...HEAD +[0.7.5]: https://github.com/NNPDF/pineappl/compare/v0.7.4...v0.7.5 [0.7.4]: https://github.com/NNPDF/pineappl/compare/v0.7.3...v0.7.4 [0.7.3]: https://github.com/NNPDF/pineappl/compare/v0.7.2...v0.7.3 [0.7.2]: https://github.com/NNPDF/pineappl/compare/v0.7.1...v0.7.2 diff --git a/Cargo.lock b/Cargo.lock index 3846baad..642d55f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1261,7 +1261,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pineappl" -version = "0.7.4" +version = "0.7.5" dependencies = [ "anyhow", "arrayvec", @@ -1287,7 +1287,7 @@ dependencies = [ [[package]] name = "pineappl_applgrid" -version = "0.7.4" +version = "0.7.5" dependencies = [ "cc", "cxx", @@ -1297,7 +1297,7 @@ dependencies = [ [[package]] name = "pineappl_capi" -version = "0.7.4" +version = "0.7.5" dependencies = [ "itertools", "pineappl", @@ -1305,7 +1305,7 @@ dependencies = [ [[package]] name = "pineappl_cli" -version = "0.7.4" +version = "0.7.5" dependencies = [ "anyhow", "assert_cmd", @@ -1336,7 +1336,7 @@ dependencies = [ [[package]] name = "pineappl_fastnlo" -version = "0.7.4" +version = "0.7.5" dependencies = [ "cxx", "cxx-build", @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "pineappl_py" -version = "0.7.4" +version = "0.7.5" dependencies = [ "itertools", "ndarray", @@ -2508,7 +2508,7 @@ dependencies = [ [[package]] name = "xtask" -version = "0.7.4" +version = "0.7.5" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 6aa82170..605cd39e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ keywords = ["high-energy-physics", "physics"] license = "GPL-3.0-or-later" repository = "https://github.com/NNPDF/pineappl" rust-version = "1.70.0" -version = "0.7.4" +version = "0.7.5" [workspace.lints.clippy] all = { level = "warn", priority = -1 } diff --git a/maintainer/make-release.sh b/maintainer/make-release.sh index 12b7feb6..91420332 100755 --- a/maintainer/make-release.sh +++ b/maintainer/make-release.sh @@ -33,11 +33,6 @@ if [[ $(echo ${version} | grep -oP '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?: exit 1 fi -if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then - echo "You're not on master." - exit 1 -fi - for crate in ${crates[@]}; do if [[ -n $(git status ${crate} --porcelain) ]]; then echo "This repository isn't clean. Make sure to add or delete the corresponding files." diff --git a/pineappl/src/evolution.rs b/pineappl/src/evolution.rs index a142fc5c..27dd57f8 100644 --- a/pineappl/src/evolution.rs +++ b/pineappl/src/evolution.rs @@ -13,7 +13,7 @@ use ndarray::{s, Array1, Array2, Array3, ArrayView1, ArrayView4, Axis}; use std::iter; /// Number of ULPS used to de-duplicate grid values in [`Grid::evolve_info`]. -pub(crate) const EVOLVE_INFO_TOL_ULPS: i64 = 64; +pub(crate) const EVOLVE_INFO_TOL_ULPS: i64 = 256; /// Number of ULPS used to search for grid values in this module. This value must be a large-enough /// multiple of [`EVOLVE_INFO_TOL_ULPS`], because otherwise similar values are not found in diff --git a/pineappl/src/grid.rs b/pineappl/src/grid.rs index 12d618e9..a90eed95 100644 --- a/pineappl/src/grid.rs +++ b/pineappl/src/grid.rs @@ -2097,11 +2097,40 @@ impl Grid { use super::evolution::EVOLVE_INFO_TOL_ULPS; let mut lhs: Option = None; - let mut fac1 = Vec::new(); + // Q2 slices we use + let mut used_op_fac1 = Vec::new(); + // Q2 slices we encounter, but possibly don't use + let mut op_fac1 = Vec::new(); + // Q2 slices needed by the grid + let grid_fac1: Vec<_> = self + .evolve_info(order_mask) + .fac1 + .into_iter() + .map(|fac| xi.1 * xi.1 * fac) + .collect(); for result in slices { let (info, operator) = result.map_err(|err| GridError::Other(err.into()))?; + op_fac1.push(info.fac1); + + // it's possible that due to small numerical differences we get two slices which are + // almost the same. We have to skip those in order not to evolve the 'same' slice twice + if used_op_fac1 + .iter() + .any(|&fac| approx_eq!(f64, fac, info.fac1, ulps = EVOLVE_INFO_TOL_ULPS)) + { + continue; + } + + // skip slices that the grid doesn't use + if !grid_fac1 + .iter() + .any(|&fac| approx_eq!(f64, fac, info.fac1, ulps = EVOLVE_INFO_TOL_ULPS)) + { + continue; + } + let op_info_dim = ( info.pids1.len(), info.x1.len(), @@ -2143,26 +2172,20 @@ impl Grid { lhs = Some(rhs); } - fac1.push(info.fac1); + used_op_fac1.push(info.fac1); } // UNWRAP: if we can't compare two numbers there's a bug - fac1.sort_by(|a, b| a.partial_cmp(b).unwrap_or_else(|| unreachable!())); + op_fac1.sort_by(|a, b| a.partial_cmp(b).unwrap_or_else(|| unreachable!())); // make sure we've evolved all slices - if let Some(muf2) = self - .evolve_info(order_mask) - .fac1 - .into_iter() - .map(|mu2| xi.1 * xi.1 * mu2) - .find(|&grid_mu2| { - !fac1 - .iter() - .any(|&eko_mu2| approx_eq!(f64, grid_mu2, eko_mu2, ulps = EVOLVE_INFO_TOL_ULPS)) - }) - { + if let Some(muf2) = grid_fac1.into_iter().find(|&grid_mu2| { + !used_op_fac1 + .iter() + .any(|&eko_mu2| approx_eq!(f64, grid_mu2, eko_mu2, ulps = EVOLVE_INFO_TOL_ULPS)) + }) { return Err(GridError::EvolutionFailure(format!( - "no operator for muf2 = {muf2} found in {fac1:?}" + "no operator for muf2 = {muf2} found in {op_fac1:?}" ))); } diff --git a/pineappl_capi/Cargo.toml b/pineappl_capi/Cargo.toml index 864faf21..c24c7f2f 100644 --- a/pineappl_capi/Cargo.toml +++ b/pineappl_capi/Cargo.toml @@ -16,7 +16,7 @@ version.workspace = true workspace = true [dependencies] -pineappl = { path = "../pineappl", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.7.5" } itertools = "0.10.1" [features] diff --git a/pineappl_cli/Cargo.toml b/pineappl_cli/Cargo.toml index 7440fb64..b76097ee 100644 --- a/pineappl_cli/Cargo.toml +++ b/pineappl_cli/Cargo.toml @@ -30,9 +30,9 @@ lhapdf = { package = "managed-lhapdf", version = "0.3.0" } lz4_flex = { optional = true, version = "0.9.2" } ndarray = "0.15.4" ndarray-npy = { optional = true, version = "0.8.1" } -pineappl = { path = "../pineappl", version = "=0.7.4" } -pineappl_applgrid = { optional = true, path = "../pineappl_applgrid", version = "=0.7.4" } -pineappl_fastnlo = { optional = true, path = "../pineappl_fastnlo", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.7.5" } +pineappl_applgrid = { optional = true, path = "../pineappl_applgrid", version = "=0.7.5" } +pineappl_fastnlo = { optional = true, path = "../pineappl_fastnlo", version = "=0.7.5" } prettytable-rs = { default-features = false, features = ["win_crlf"], version = "0.10.0" } rayon = "1.5.1" serde = { features = ["derive"], optional = true, version = "1.0.130" } diff --git a/pineappl_py/Cargo.toml b/pineappl_py/Cargo.toml index 5b7f35b6..c425b56e 100644 --- a/pineappl_py/Cargo.toml +++ b/pineappl_py/Cargo.toml @@ -30,5 +30,5 @@ crate-type = ["cdylib"] itertools = "0.10.1" ndarray = "0.15.4" numpy = "0.20.0" -pineappl = { path = "../pineappl", version = "=0.7.4" } +pineappl = { path = "../pineappl", version = "=0.7.5" } pyo3 = { features = ["extension-module"], version = "0.20.0" } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 8b025b56..a1b35958 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -21,4 +21,4 @@ clap_mangen = "0.2.18" enum_dispatch = "0.3.7" #git2 = "0.17.2" #semver = "1.0.17" -pineappl_cli = { path = "../pineappl_cli", version = "=0.7.4" } +pineappl_cli = { path = "../pineappl_cli", version = "=0.7.5" }