From a1156f5be129d050e9eba23f4683fd03e402ac4a Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Tue, 28 May 2024 14:23:38 +0200 Subject: [PATCH] Move `Order` into new module `boc` --- CHANGELOG.md | 2 +- pineappl/src/{order.rs => boc.rs} | 9 +++++---- pineappl/src/evolution.rs | 2 +- pineappl/src/fk_table.rs | 2 +- pineappl/src/grid.rs | 2 +- pineappl/src/lib.rs | 2 +- pineappl/tests/drell_yan_lo.rs | 2 +- pineappl_capi/src/lib.rs | 2 +- pineappl_cli/src/export.rs | 2 +- pineappl_cli/src/export/applgrid.rs | 2 +- pineappl_cli/src/import/applgrid.rs | 2 +- pineappl_cli/src/import/fastnlo.rs | 2 +- pineappl_cli/src/import/fktable.rs | 2 +- pineappl_cli/src/read.rs | 2 +- pineappl_cli/src/write.rs | 2 +- 15 files changed, 19 insertions(+), 18 deletions(-) rename pineappl/src/{order.rs => boc.rs} (98%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d11bb2..345e705a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- moved `Order` and `ParseOrderError` to their own module `order` +- moved `Order` and `ParseOrderError` to the new module `boc` ### Removed diff --git a/pineappl/src/order.rs b/pineappl/src/boc.rs similarity index 98% rename from pineappl/src/order.rs rename to pineappl/src/boc.rs index aa6b52db..be5cd0d2 100644 --- a/pineappl/src/order.rs +++ b/pineappl/src/boc.rs @@ -1,4 +1,5 @@ -//! TODO +//! Module containing structures for the 3 dimensions of a [`Grid`]: bins, [`Order`] and channels +//! (`boc`). use serde::{Deserialize, Serialize}; use std::cmp::Ordering; @@ -130,7 +131,7 @@ impl Order { /// - the mixed NNLO QCD—EW. /// /// ```rust - /// use pineappl::order::Order; + /// use pineappl::boc::Order; /// /// let orders = [ /// Order::new(0, 2, 0, 0), // LO : alpha^2 @@ -161,7 +162,7 @@ impl Order { /// `true`: /// /// ```rust - /// use pineappl::order::Order; + /// use pineappl::boc::Order; /// /// let orders = [ /// Order::new(0, 2, 0, 0), // LO : alpha^2 @@ -178,7 +179,7 @@ impl Order { /// the selection for different LOs: /// /// ```rust - /// use pineappl::order::Order; + /// use pineappl::boc::Order; /// /// let orders = [ /// Order::new(2, 0, 0, 0), // LO QCD : alphas^2 diff --git a/pineappl/src/evolution.rs b/pineappl/src/evolution.rs index 480bcb8c..76f21fa8 100644 --- a/pineappl/src/evolution.rs +++ b/pineappl/src/evolution.rs @@ -1,10 +1,10 @@ //! Supporting classes and functions for [`Grid::evolve`]. +use super::boc::Order; use super::grid::{Convolution, Grid, GridError}; use super::import_only_subgrid::ImportOnlySubgridV2; use super::lumi::LumiEntry; use super::lumi_entry; -use super::order::Order; use super::sparse_array3::SparseArray3; use super::subgrid::{Mu2, Subgrid, SubgridEnum}; use float_cmp::approx_eq; diff --git a/pineappl/src/fk_table.rs b/pineappl/src/fk_table.rs index aa364c1d..6b041abd 100644 --- a/pineappl/src/fk_table.rs +++ b/pineappl/src/fk_table.rs @@ -1,8 +1,8 @@ //! Provides the [`FkTable`] type. +use super::boc::Order; use super::grid::{Convolution, Grid, GridError}; use super::lumi::LumiCache; -use super::order::Order; use super::subgrid::Subgrid; use float_cmp::approx_eq; use ndarray::Array4; diff --git a/pineappl/src/grid.rs b/pineappl/src/grid.rs index 23c0a19e..ca159f2a 100644 --- a/pineappl/src/grid.rs +++ b/pineappl/src/grid.rs @@ -1,6 +1,7 @@ //! Module containing all traits and supporting structures for grids. use super::bin::{BinInfo, BinLimits, BinRemapper}; +use super::boc::Order; use super::empty_subgrid::EmptySubgridV1; use super::evolution::{self, AlphasTable, EvolveInfo, OperatorInfo, OperatorSliceInfo}; use super::fk_table::FkTable; @@ -8,7 +9,6 @@ use super::import_only_subgrid::ImportOnlySubgridV2; use super::lagrange_subgrid::{LagrangeSparseSubgridV1, LagrangeSubgridV1, LagrangeSubgridV2}; use super::lumi::{LumiCache, LumiEntry}; use super::ntuple_subgrid::NtupleSubgridV1; -use super::order::Order; use super::pids::{self, PidBasis}; use super::subgrid::{ExtraSubgridParams, Mu2, Subgrid, SubgridEnum, SubgridParams}; use bitflags::bitflags; diff --git a/pineappl/src/lib.rs b/pineappl/src/lib.rs index 51f5a8a2..08cfe449 100644 --- a/pineappl/src/lib.rs +++ b/pineappl/src/lib.rs @@ -37,6 +37,7 @@ mod convert; pub mod bin; +pub mod boc; pub mod empty_subgrid; pub mod evolution; pub mod fk_table; @@ -45,7 +46,6 @@ pub mod import_only_subgrid; pub mod lagrange_subgrid; pub mod lumi; pub mod ntuple_subgrid; -pub mod order; pub mod packed_array; pub mod pids; pub mod sparse_array3; diff --git a/pineappl/tests/drell_yan_lo.rs b/pineappl/tests/drell_yan_lo.rs index e6c6838b..ed33d7e1 100644 --- a/pineappl/tests/drell_yan_lo.rs +++ b/pineappl/tests/drell_yan_lo.rs @@ -3,10 +3,10 @@ use float_cmp::assert_approx_eq; use lhapdf::Pdf; use num_complex::Complex; use pineappl::bin::BinRemapper; +use pineappl::boc::Order; use pineappl::grid::{Grid, GridOptFlags, Ntuple}; use pineappl::lumi::LumiCache; use pineappl::lumi_entry; -use pineappl::order::Order; use pineappl::subgrid::{ExtraSubgridParams, Subgrid, SubgridEnum, SubgridParams}; use rand::Rng; use rand_pcg::Pcg64; diff --git a/pineappl_capi/src/lib.rs b/pineappl_capi/src/lib.rs index 02fdb477..b059ad80 100644 --- a/pineappl_capi/src/lib.rs +++ b/pineappl_capi/src/lib.rs @@ -57,9 +57,9 @@ use itertools::izip; use pineappl::bin::BinRemapper; +use pineappl::boc::Order; use pineappl::grid::{Grid, GridOptFlags, Ntuple}; use pineappl::lumi::{LumiCache, LumiEntry}; -use pineappl::order::Order; use pineappl::subgrid::{ExtraSubgridParams, SubgridParams}; use std::collections::HashMap; use std::ffi::{CStr, CString}; diff --git a/pineappl_cli/src/export.rs b/pineappl_cli/src/export.rs index 8724ed23..7986a6c8 100644 --- a/pineappl_cli/src/export.rs +++ b/pineappl_cli/src/export.rs @@ -3,8 +3,8 @@ use super::{GlobalConfiguration, Subcommand}; use anyhow::{anyhow, Result}; use clap::builder::{PossibleValuesParser, TypedValueParser}; use clap::{Parser, ValueHint}; +use pineappl::boc::Order; use pineappl::grid::Grid; -use pineappl::order::Order; use std::path::{Path, PathBuf}; use std::process::ExitCode; diff --git a/pineappl_cli/src/export/applgrid.rs b/pineappl_cli/src/export/applgrid.rs index f6c202f6..74709bee 100644 --- a/pineappl_cli/src/export/applgrid.rs +++ b/pineappl_cli/src/export/applgrid.rs @@ -2,8 +2,8 @@ use anyhow::{anyhow, bail, Result}; use cxx::{let_cxx_string, UniquePtr}; use float_cmp::approx_eq; use ndarray::{s, Axis}; +use pineappl::boc::Order; use pineappl::grid::{Convolution, Grid}; -use pineappl::order::Order; use pineappl::subgrid::{Mu2, Subgrid, SubgridParams}; use pineappl_applgrid::ffi::{self, grid}; use std::borrow::Cow; diff --git a/pineappl_cli/src/import/applgrid.rs b/pineappl_cli/src/import/applgrid.rs index 0b39c56d..67d62384 100644 --- a/pineappl_cli/src/import/applgrid.rs +++ b/pineappl_cli/src/import/applgrid.rs @@ -1,8 +1,8 @@ use anyhow::Result; +use pineappl::boc::Order; use pineappl::grid::{Convolution, Grid}; use pineappl::import_only_subgrid::ImportOnlySubgridV2; use pineappl::lumi::LumiEntry; -use pineappl::order::Order; use pineappl::sparse_array3::SparseArray3; use pineappl::subgrid::{Mu2, SubgridParams}; use pineappl_applgrid::ffi::{self, grid}; diff --git a/pineappl_cli/src/import/fastnlo.rs b/pineappl_cli/src/import/fastnlo.rs index 36cac3a9..28d11a56 100644 --- a/pineappl_cli/src/import/fastnlo.rs +++ b/pineappl_cli/src/import/fastnlo.rs @@ -1,10 +1,10 @@ use anyhow::Result; use itertools::Itertools; use pineappl::bin::BinRemapper; +use pineappl::boc::Order; use pineappl::grid::{Convolution, Grid}; use pineappl::import_only_subgrid::ImportOnlySubgridV2; use pineappl::lumi::LumiEntry; -use pineappl::order::Order; use pineappl::sparse_array3::SparseArray3; use pineappl::subgrid::{Mu2, SubgridParams}; use pineappl_fastnlo::ffi::{ diff --git a/pineappl_cli/src/import/fktable.rs b/pineappl_cli/src/import/fktable.rs index 85dc7ac0..7e9f3848 100644 --- a/pineappl_cli/src/import/fktable.rs +++ b/pineappl_cli/src/import/fktable.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Context, Result}; use flate2::read::GzDecoder; +use pineappl::boc::Order; use pineappl::grid::{Convolution, Grid}; use pineappl::import_only_subgrid::ImportOnlySubgridV1; use pineappl::lumi_entry; -use pineappl::order::Order; use pineappl::sparse_array3::SparseArray3; use pineappl::subgrid::SubgridParams; use std::fs::File; diff --git a/pineappl_cli/src/read.rs b/pineappl_cli/src/read.rs index 17d27dd8..eedcc4c2 100644 --- a/pineappl_cli/src/read.rs +++ b/pineappl_cli/src/read.rs @@ -3,8 +3,8 @@ use super::{GlobalConfiguration, Subcommand}; use anyhow::Result; use clap::{Args, Parser, ValueHint}; use itertools::Itertools; +use pineappl::boc::Order; use pineappl::fk_table::FkTable; -use pineappl::order::Order; use prettytable::{cell, row, Row}; use std::path::PathBuf; use std::process::ExitCode; diff --git a/pineappl_cli/src/write.rs b/pineappl_cli/src/write.rs index 78770944..fc59fe85 100644 --- a/pineappl_cli/src/write.rs +++ b/pineappl_cli/src/write.rs @@ -7,9 +7,9 @@ use clap::{ ValueHint, }; use pineappl::bin::BinRemapper; +use pineappl::boc::Order; use pineappl::fk_table::{FkAssumptions, FkTable}; use pineappl::lumi::LumiEntry; -use pineappl::order::Order; use pineappl::pids; use pineappl::pids::PidBasis; use std::fs;