Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
t7phy committed Aug 6, 2024
1 parent edad700 commit c4f871e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 12 deletions.
36 changes: 30 additions & 6 deletions pineappl/src/import_only_subgrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ impl Subgrid for ImportOnlySubgridV1 {
self.q2_grid
.iter()
.copied()
.map(|q2| Mu2 { ren: q2, fac: q2, frg: -1.0 })
.map(|q2| Mu2 {
ren: q2,
fac: q2,
frg: -1.0,
})
.collect()
}

Expand Down Expand Up @@ -468,7 +472,11 @@ mod tests {
}
);

let mu2 = vec![Mu2 { ren: 0.0, fac: 0.0, frg: -1.0 }];
let mu2 = vec![Mu2 {
ren: 0.0,
fac: 0.0,
frg: -1.0,
}];

assert_eq!(grid1.mu2_grid().as_ref(), mu2);
assert_eq!(grid1.x1_grid().as_ref(), x);
Expand Down Expand Up @@ -559,13 +567,21 @@ mod tests {
];
let mut grid1: SubgridEnum = ImportOnlySubgridV2::new(
SparseArray3::new(1, 10, 10),
vec![Mu2 { ren: 0.0, fac: 0.0, frg: -1.0 }],
vec![Mu2 {
ren: 0.0,
fac: 0.0,
frg: -1.0,
}],
x.clone(),
x.clone(),
)
.into();

let mu2 = vec![Mu2 { ren: 0.0, fac: 0.0, frg: -1.0 }];
let mu2 = vec![Mu2 {
ren: 0.0,
fac: 0.0,
frg: -1.0,
}];

assert_eq!(grid1.mu2_grid().as_ref(), mu2);
assert_eq!(grid1.x1_grid().as_ref(), x);
Expand Down Expand Up @@ -599,7 +615,11 @@ mod tests {
// create grid with transposed entries, but different q2
let mut grid2: SubgridEnum = ImportOnlySubgridV2::new(
SparseArray3::new(1, 10, 10),
vec![Mu2 { ren: 1.0, fac: 1.0, frg: -1.0 }],
vec![Mu2 {
ren: 1.0,
fac: 1.0,
frg: -1.0,
}],
x.clone(),
x.clone(),
)
Expand Down Expand Up @@ -668,7 +688,11 @@ mod tests {
fn fill_panic_v2() {
let mut grid = ImportOnlySubgridV2::new(
SparseArray3::new(1, 1, 1),
vec![Mu2 { ren: 1.0, fac: 1.0, frg: -1.0 }],
vec![Mu2 {
ren: 1.0,
fac: 1.0,
frg: -1.0,
}],
vec![1.0],
vec![1.0],
);
Expand Down
18 changes: 15 additions & 3 deletions pineappl/src/lagrange_subgrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ impl Subgrid for LagrangeSubgridV1 {
(0..self.ntau)
.map(|itau| {
let q2 = fq2(self.gettau(itau));
Mu2 { ren: q2, fac: q2, frg: -1.0 }
Mu2 {
ren: q2,
fac: q2,
frg: -1.0,
}
})
.collect()
}
Expand Down Expand Up @@ -614,7 +618,11 @@ impl Subgrid for LagrangeSubgridV2 {
(0..self.ntau)
.map(|itau| {
let q2 = fq2(self.gettau(itau));
Mu2 { ren: q2, fac: q2, frg: -1.0 }
Mu2 {
ren: q2,
fac: q2,
frg: -1.0,
}
})
.collect()
}
Expand Down Expand Up @@ -927,7 +935,11 @@ impl Subgrid for LagrangeSparseSubgridV1 {
(0..self.ntau)
.map(|itau| {
let q2 = fq2(self.gettau(itau));
Mu2 { ren: q2, fac: q2, frg: -1.0 }
Mu2 {
ren: q2,
fac: q2,
frg: -1.0,
}
})
.collect()
}
Expand Down
18 changes: 15 additions & 3 deletions pineappl/src/packed_subgrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,21 @@ mod tests {
];
let mut grid1: SubgridEnum = PackedQ1X2SubgridV1::new(
PackedArray::new([1, 10, 10]),
vec![Mu2 { ren: 0.0, fac: 0.0, frg: 0.0 }],
vec![Mu2 {
ren: 0.0,
fac: 0.0,
frg: 0.0,
}],
x.clone(),
x.clone(),
)
.into();

let mu2 = vec![Mu2 { ren: 0.0, fac: 0.0, frg: 0.0 }];
let mu2 = vec![Mu2 {
ren: 0.0,
fac: 0.0,
frg: 0.0,
}];

assert_eq!(grid1.mu2_grid().as_ref(), mu2);
assert_eq!(grid1.x1_grid().as_ref(), x);
Expand Down Expand Up @@ -314,7 +322,11 @@ mod tests {
// create grid with transposed entries, but different q2
let mut grid2: SubgridEnum = PackedQ1X2SubgridV1::new(
PackedArray::new([1, 10, 10]),
vec![Mu2 { ren: 1.0, fac: 1.0, frg: 1.0 }],
vec![Mu2 {
ren: 1.0,
fac: 1.0,
frg: 1.0,
}],
x.clone(),
x.clone(),
)
Expand Down

0 comments on commit c4f871e

Please sign in to comment.