tests/fromdecay/test_fromdecay.py
def check_norm(full_decay: GenMultiDecay, **kwargs) -> list[tuple]:
    """Helper function that tests whether the normalize_weights argument works for GenMultiDecay.generate.

    Args:
        full_decay: full_decay.generate will be called.
        kwargs: Additional parameters passed to generate.

    Returns:
        All the values returned by generate, both times.
        The return arguments from normalize_weights=True is the first element in the returned list.
    """
    all_return_args = []
    for norm in (True, False):
        return_args = full_decay.generate(normalize_weights=norm, **kwargs)
        assert len(return_args) == 2 if norm else 3
        assert sum(len(w) for w in return_args[0]) == kwargs["n_events"]
        if not norm:
            assert all(
                len(w) == len(mw) for w, mw in zip(return_args[0], return_args[1])
            )

        all_return_args.append(return_args)

    return all_return_args
Helper function that tests whether the normalize_weights argument works for GenMultiDecay.generate.

    Args:
        full_decay: full_decay.generate will be called.
        kwargs: Additional parameters passed to generate.

    Returns:
        All the values returned by generate, both times.
        The return arguments from normalize_weights=True is the first element in the returned list.
    
Helper function that tests whether the normalize_weights argument works for GenMultiDecay.generate.
Helper function that tests whether the normalize_weights argument works for GenMultiDecay . generate .
def check_norm(full_decay: GenMultiDecay, **kwargs) -> list[tuple]:
    all_return_args = []
    for norm in (True, False):
        return_args = full_decay.generate(normalize_weights=norm, **kwargs)
        assert len(return_args) == 2 if norm else 3
        assert sum(len(w) for w in return_args[0]) == kwargs["n_events"]
        if not norm:
            assert all(
                len(w) == len(mw) for w, mw in zip(return_args[0], return_args[1])
            )
        all_return_args.append(return_args)
    return all_return_args
def check_norm ( full_decay : GenMultiDecay , ** kwargs ) -> list [ tuple ] : all_return_args = [ ] for norm in ( True , False ) : return_args = full_decay . generate ( normalize_weights = norm , ** kwargs ) assert len ( return_args ) == 2 if norm else 3 assert sum ( len ( w ) for w in return_args [ 0 ] ) == kwargs [ "n_events" ] if not norm : assert all ( len ( w ) == len ( mw ) for w , mw in zip ( return_args [ 0 ] , return_args [ 1 ] ) ) all_return_args . append ( return_args ) return all_return_args
Helper function that tests whether the normalize_weights argument works for GenMultiDecay.generate.
Helper function that tests whether the normalize_weights argument works for GenMultiDecay . generate .
"""Helper function that tests whether the normalize_weights argument works for GenMultiDecay.generate.

    Args:
        full_decay: full_decay.generate will be called.
        kwargs: Additional parameters passed to generate.

    Returns:
        All the values returned by generate, both times.
        The return arguments from normalize_weights=True is the first element in the returned list.
    """
All the values returned by generate, both times.
The return arguments from normalize_weights=True is the first element in the returned list.
All the values returned by generate both times . The return arguments from normalize_weights = True is the first element in the returned list .
full_decay
GenMultiDecay
full_decay.generate will be called.
full_decay . generate will be called .
kwargs
Additional parameters passed to generate.
Additional parameters passed to generate .