Skip to content

Commit 1d75225

Browse files
Address Clippy warnings
1 parent ec7834f commit 1d75225

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

neopdf/src/strategy.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,8 +2812,8 @@ mod tests {
28122812
// Create 4D test grid
28132813
let x0_coords = create_logspaced(1e-5, 1e-3, 6);
28142814
let x1_coords = create_logspaced(1e2, 1e4, 6);
2815-
let x2_coords = vec![1.0, 5.0, 25.0, 100.0, 150.0, 200.0];
2816-
let x3_coords = vec![0.5, 1.0, 2.0, 5.0, 10.0, 20.0];
2815+
let x2_coords = [1.0, 5.0, 25.0, 100.0, 150.0, 200.0];
2816+
let x3_coords = [0.5, 1.0, 2.0, 5.0, 10.0, 20.0];
28172817

28182818
// Generate test values: f(x0, x1, x2, x3) = x0 * x1 * x2 * x3
28192819
let values: Vec<f64> = x0_coords
@@ -2871,10 +2871,10 @@ mod tests {
28712871
use ninterp::data::InterpDataND;
28722872

28732873
// Test that interpolation at grid points returns exact values
2874-
let x0_coords = vec![0.1, 0.2, 0.3, 0.4];
2875-
let x1_coords = vec![1.0, 2.0, 3.0, 4.0];
2876-
let x2_coords = vec![10.0, 20.0, 30.0, 40.0];
2877-
let x3_coords = vec![100.0, 200.0, 300.0, 400.0];
2874+
let x0_coords = [0.1, 0.2, 0.3, 0.4];
2875+
let x1_coords = [1.0, 2.0, 3.0, 4.0];
2876+
let x2_coords = [10.0, 20.0, 30.0, 40.0];
2877+
let x3_coords = [100.0, 200.0, 300.0, 400.0];
28782878

28792879
let values: Vec<f64> = x0_coords
28802880
.iter()
@@ -2957,9 +2957,9 @@ mod tests {
29572957
// Create 5D test grid
29582958
let x0_coords = create_logspaced(1e-5, 1e-3, 5);
29592959
let x1_coords = create_logspaced(1e2, 1e4, 5);
2960-
let x2_coords = vec![1.0, 5.0, 25.0, 100.0, 200.0];
2961-
let x3_coords = vec![0.5, 1.0, 2.0, 5.0, 10.0];
2962-
let x4_coords = vec![10.0, 20.0, 50.0, 100.0, 200.0];
2960+
let x2_coords = [1.0, 5.0, 25.0, 100.0, 200.0];
2961+
let x3_coords = [0.5, 1.0, 2.0, 5.0, 10.0];
2962+
let x4_coords = [10.0, 20.0, 50.0, 100.0, 200.0];
29632963

29642964
// Generate test values: f(x0, x1, x2, x3, x4) = x0 * x1 * x2 * x3 * x4
29652965
let values: Vec<f64> = x0_coords
@@ -3026,11 +3026,11 @@ mod tests {
30263026
use ninterp::data::InterpDataND;
30273027

30283028
// Test that interpolation at grid points returns exact values
3029-
let x0_coords = vec![0.1, 0.2, 0.3, 0.4];
3030-
let x1_coords = vec![1.0, 2.0, 3.0, 4.0];
3031-
let x2_coords = vec![10.0, 20.0, 30.0, 40.0];
3032-
let x3_coords = vec![100.0, 200.0, 300.0, 400.0];
3033-
let x4_coords = vec![1000.0, 2000.0, 3000.0, 4000.0];
3029+
let x0_coords = [0.1, 0.2, 0.3, 0.4];
3030+
let x1_coords = [1.0, 2.0, 3.0, 4.0];
3031+
let x2_coords = [10.0, 20.0, 30.0, 40.0];
3032+
let x3_coords = [100.0, 200.0, 300.0, 400.0];
3033+
let x4_coords = [1000.0, 2000.0, 3000.0, 4000.0];
30343034

30353035
let values: Vec<f64> = x0_coords
30363036
.iter()

neopdf_cli/src/converter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ fn load_pdf_names(
168168
/// # Errors
169169
///
170170
/// TODO
171+
#[allow(clippy::implicit_clone)]
171172
#[allow(clippy::needless_pass_by_value)]
172173
pub fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
173174
match &cli.command {

neopdf_cli/src/read.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub struct SubgridArgs {
9292
/// # Panics
9393
///
9494
/// This function panics when a PID not present in the Grid is requested.
95+
#[allow(clippy::too_many_lines)]
9596
#[allow(clippy::needless_pass_by_value)]
9697
pub fn main(cli: ReadCli) {
9798
match &cli.command {

neopdf_pyapi/src/converter.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use pyo3::prelude::*;
44

55
/// Python interface for PDF set conversion utilities.
66
///
7-
/// This module provides functions to convert LHAPDF sets to NeoPDF format and to combine
8-
/// nuclear PDF sets into a single NeoPDF file.
7+
/// This module provides functions to convert LHAPDF sets to `NeoPDF` format and to combine
8+
/// nuclear PDF sets into a single `NeoPDF` file.
99
///
1010
/// # Errors
1111
///
@@ -18,15 +18,15 @@ pub fn converter(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
1818
Ok(())
1919
}
2020

21-
/// Converts an LHAPDF set to the NeoPDF format and writes it to disk.
21+
/// Converts an LHAPDF set to the `NeoPDF` format and writes it to disk.
2222
///
23-
/// Converts the specified LHAPDF set into the NeoPDF format and saves the result to the given
23+
/// Converts the specified LHAPDF set into the `NeoPDF` format and saves the result to the given
2424
/// output path.
2525
///
2626
/// # Parameters
2727
///
28-
/// - `pdf_name`: The name of the LHAPDF set (e.g., "NNPDF40_nnlo_as_01180").
29-
/// - `output_path`: The path to the output NeoPDF file.
28+
/// - `pdf_name`: The name of the LHAPDF set (e.g., "`NNPDF40_nnlo_as_01180`").
29+
/// - `output_path`: The path to the output `NeoPDF` file.
3030
///
3131
/// # Returns
3232
///
@@ -42,15 +42,15 @@ pub fn py_convert_lhapdf(pdf_name: &str, output_path: &str) -> PyResult<()> {
4242
.map_err(|e| PyRuntimeError::new_err(format!("Conversion failed: {e}")))
4343
}
4444

45-
/// Combines a list of nuclear PDF sets into a single NeoPDF file with explicit A dependence.
45+
/// Combines a list of nuclear PDF sets into a single `NeoPDF` file with explicit A dependence.
4646
///
47-
/// Combines multiple LHAPDF nuclear PDF sets into a single NeoPDF file, allowing for explicit
47+
/// Combines multiple LHAPDF nuclear PDF sets into a single `NeoPDF` file, allowing for explicit
4848
/// nuclear dependence.
4949
///
5050
/// # Parameters
5151
///
5252
/// - `pdf_names`: List of PDF set names (each with a different A).
53-
/// - `output_path`: Output NeoPDF file path.
53+
/// - `output_path`: Output `NeoPDF` file path.
5454
///
5555
/// # Returns
5656
///

neopdf_pyapi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub mod pdf;
1919
/// Python bindings for the `writer` module.
2020
pub mod writer;
2121

22-
/// PyO3 Python module that contains all exposed classes from Rust.
22+
/// `PyO3` Python module that contains all exposed classes from Rust.
2323
#[pymodule]
2424
fn neopdf(m: &Bound<'_, PyModule>) -> PyResult<()> {
2525
m.add("version", env!("CARGO_PKG_VERSION"))?;

neopdf_pyapi/src/manage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use pyo3::prelude::*;
88
pub enum PyPdfSetFormat {
99
/// LHAPDF format (standard PDF set format used by LHAPDF).
1010
Lhapdf,
11-
/// NeoPDF format (native format for this library).
11+
/// `NeoPDF` format (native format for this library).
1212
Neopdf,
1313
}
1414

@@ -29,7 +29,7 @@ pub struct PyManageData {
2929

3030
#[pymethods]
3131
impl PyManageData {
32-
/// Create a new ManageData instance.
32+
/// Create a new `ManageData` instance.
3333
#[new]
3434
#[must_use]
3535
pub fn new(set_name: &str, format: PyPdfSetFormat) -> Self {

neopdf_pyapi/src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct PyLhapdfSet {
1212

1313
#[pymethods]
1414
impl PyLhapdfSet {
15-
/// Create a new LhapdfSet instance for a given PDF set name.
15+
/// Create a new `LhapdfSet` instance for a given PDF set name.
1616
#[new]
1717
#[must_use]
1818
pub fn new(pdf_name: &str) -> Self {
@@ -56,7 +56,7 @@ pub struct PyNeopdfSet {
5656

5757
#[pymethods]
5858
impl PyNeopdfSet {
59-
/// Create a new NeopdfSet instance for a given PDF set name.
59+
/// Create a new `NeopdfSet` instance for a given PDF set name.
6060
#[new]
6161
#[must_use]
6262
pub fn new(pdf_name: &str) -> Self {

neopdf_pyapi/src/pdf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ pub struct PyPDF {
121121
}
122122

123123
#[pymethods]
124+
#[allow(clippy::doc_markdown)]
124125
impl PyPDF {
125126
/// Creates a new `PDF` instance for a given PDF set and member.
126127
///

0 commit comments

Comments
 (0)