pub struct PyDataset(pub Arc<Dataset>);Expand description
A set of Events
Datasets can be created from lists of Events or by using the constructor helpers
such as :meth:laddu.Dataset.from_parquet, :meth:laddu.Dataset.from_root, and
:meth:laddu.Dataset.from_amptools
Datasets can also be indexed directly to access individual Events
§Parameters
events : list of Event p4_names : list of str, optional Names assigned to each four-momentum; enables name-based lookups if provided. aux_names : list of str, optional Names for auxiliary scalars stored alongside the events. aliases : dict of {str: str or liststr}, optional Additional particle identifiers that override aliases stored on the Events.
§Notes
Explicit metadata provided here takes precedence over metadata embedded in the input Events.
Tuple Fields§
§0: Arc<Dataset>Implementations§
Source§impl PyDataset
impl PyDataset
Sourcepub fn filter(&self, expression: &PyVariableExpression) -> PyResult<PyDataset>
pub fn filter(&self, expression: &PyVariableExpression) -> PyResult<PyDataset>
Filter the Dataset by a given VariableExpression, selecting events for which the expression returns True.
§Parameters
expression : VariableExpression The expression with which to filter the Dataset
§Returns
Dataset The filtered Dataset
§Examples
from laddu.utils.variables import Mass # doctest: +SKIP heavy = dataset.filter(Mass([‘kshort1’]) > 1.0) # doctest: +SKIP
Sourcepub fn boost_to_rest_frame_of(&self, names: Vec<String>) -> PyDataset
pub fn boost_to_rest_frame_of(&self, names: Vec<String>) -> PyDataset
Boost all the four-momenta in all events to the rest frame of the given set of named four-momenta.
§Parameters
names : list of str The names of the four-momenta defining the rest frame
§Returns
Dataset The boosted dataset
§Examples
dataset.boost_to_rest_frame_of([‘kshort1’, ‘kshort2’]) # doctest: +SKIP
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for PyDataset
impl<'py> IntoPyObject<'py> for PyDataset
Source§type Output = Bound<'py, <PyDataset as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyDataset 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 PyClassBaseType for PyDataset
impl PyClassBaseType for PyDataset
type LayoutAsBase = PyClassObject<PyDataset>
type BaseNativeType = <PyDataset as PyClassImpl>::BaseNativeType
type Initializer = PyClassInitializer<PyDataset>
type PyClassMutability = <PyDataset as PyClassImpl>::PyClassMutability
Source§impl PyClassImpl for PyDataset
impl PyClassImpl for PyDataset
Source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
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 = /// A set of Events
///
/// Datasets can be created from lists of Events or by using the constructor helpers
/// such as :meth:`laddu.Dataset.from_parquet`, :meth:`laddu.Dataset.from_root`, and
/// :meth:`laddu.Dataset.from_amptools`
///
/// Datasets can also be indexed directly to access individual Events
///
/// Parameters
/// ----------
/// events : list of Event
/// p4_names : list of str, optional
/// Names assigned to each four-momentum; enables name-based lookups if provided.
/// aux_names : list of str, optional
/// Names for auxiliary scalars stored alongside the events.
/// aliases : dict of {str: str or list[str]}, optional
/// Additional particle identifiers that override aliases stored on the Events.
///
/// Notes
/// -----
/// Explicit metadata provided here takes precedence over metadata embedded in the
/// input Events.
///
const RAW_DOC: &'static CStr = /// A set of Events /// /// Datasets can be created from lists of Events or by using the constructor helpers /// such as :meth:`laddu.Dataset.from_parquet`, :meth:`laddu.Dataset.from_root`, and /// :meth:`laddu.Dataset.from_amptools` /// /// Datasets can also be indexed directly to access individual Events /// /// Parameters /// ---------- /// events : list of Event /// p4_names : list of str, optional /// Names assigned to each four-momentum; enables name-based lookups if provided. /// aux_names : list of str, optional /// Names for auxiliary scalars stored alongside the events. /// aliases : dict of {str: str or list[str]}, optional /// Additional particle identifiers that override aliases stored on the Events. /// /// Notes /// ----- /// Explicit metadata provided here takes precedence over metadata embedded in the /// input Events. ///
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyDataset>
type ThreadChecker = SendablePyClass<PyDataset>
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 PyDataset
impl PyClassNewTextSignature for PyDataset
const TEXT_SIGNATURE: &'static str = "(events, *, p4_names=None, aux_names=None, aliases=None)"
Source§impl PyMethods<PyDataset> for PyClassImplCollector<PyDataset>
impl PyMethods<PyDataset> for PyClassImplCollector<PyDataset>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyDataset
impl PyTypeInfo for PyDataset
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 PyDataset
impl ExtractPyClassWithClone for PyDataset
Auto Trait Implementations§
impl Freeze for PyDataset
impl RefUnwindSafe for PyDataset
impl Send for PyDataset
impl Sync for PyDataset
impl Unpin for PyDataset
impl UnwindSafe for PyDataset
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
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> 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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.