pub struct PySubGrid { /* private fields */ }Expand description
Python wrapper for the SubGrid struct.
Implementations§
Source§impl PySubGrid
impl PySubGrid
Sourcepub fn new(
xs: Vec<f64>,
q2s: Vec<f64>,
kts: Vec<f64>,
xsis: Vec<f64>,
deltas: Vec<f64>,
nucleons: Vec<f64>,
alphas: Vec<f64>,
grid: PyReadonlyArrayDyn<'_, f64>,
) -> PyResult<Self>
pub fn new( xs: Vec<f64>, q2s: Vec<f64>, kts: Vec<f64>, xsis: Vec<f64>, deltas: Vec<f64>, nucleons: Vec<f64>, alphas: Vec<f64>, grid: PyReadonlyArrayDyn<'_, f64>, ) -> PyResult<Self>
Constructs a new SubGrid instance from the provided axes and grid data.
§Parameters
xs: The x-axis values.q2s: The Q^2-axis values.kts: The kT-axis values.xsis: The Skeweness\xi.deltas: The total momentum fraction\Delta.nucleons: The nucleon number axis values.alphas: Thealpha_saxis values.grid: The 6D grid data as aNumPyarray.
§Returns
Returns a new PySubGrid instance.
§Panics
Panics if any of the input vectors are empty.
§Errors
Returns a PyErr if the grid cannot be constructed from the input data.
Sourcepub const fn alphas_range(&self) -> (f64, f64)
pub const fn alphas_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the alpha_s axis.
Sourcepub const fn x_range(&self) -> (f64, f64)
pub const fn x_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the momentum fraction x.
Sourcepub const fn q2_range(&self) -> (f64, f64)
pub const fn q2_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the momentum scale Q^2.
Sourcepub const fn xi_range(&self) -> (f64, f64)
pub const fn xi_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the skeweness xi.
Sourcepub const fn delta_range(&self) -> (f64, f64)
pub const fn delta_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the total momentum fraction delta.
Sourcepub const fn nucleons_range(&self) -> (f64, f64)
pub const fn nucleons_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the Nucleon number A.
Sourcepub const fn kt_range(&self) -> (f64, f64)
pub const fn kt_range(&self) -> (f64, f64)
Returns the minimum and maximum values of the transverse momentum kT.
Sourcepub fn grid_shape(&self) -> Vec<usize>
pub fn grid_shape(&self) -> Vec<usize>
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for PySubGrid
impl<'py> IntoPyObject<'py> for PySubGrid
Source§type Output = Bound<'py, <PySubGrid as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PySubGrid as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for PySubGrid
impl PyClassImpl for PySubGrid
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Python wrapper for the `SubGrid` struct.
const RAW_DOC: &'static CStr = /// Python wrapper for the `SubGrid` struct.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PySubGrid>
type ThreadChecker = SendablePyClass<PySubGrid>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for PySubGrid
impl PyClassNewTextSignature for PySubGrid
const TEXT_SIGNATURE: &'static str = "(xs, q2s, kts, xsis, deltas, nucleons, alphas, grid)"
Source§impl PyMethods<PySubGrid> for PyClassImplCollector<PySubGrid>
impl PyMethods<PySubGrid> for PyClassImplCollector<PySubGrid>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PySubGrid
impl PyTypeInfo for PySubGrid
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for PySubGrid
impl ExtractPyClassWithClone for PySubGrid
Auto Trait Implementations§
impl Freeze for PySubGrid
impl RefUnwindSafe for PySubGrid
impl Send for PySubGrid
impl Sync for PySubGrid
impl Unpin for PySubGrid
impl UnsafeUnpin for PySubGrid
impl UnwindSafe for PySubGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.