Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bindings/pyroot/cppyy/cppyy/test/test_operators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, pytest, os

Check failure on line 1 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:1:8: F401 `py` imported but unused

Check failure on line 1 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E401)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:1:1: E401 Multiple imports on one line
from pytest import raises, skip, mark
from support import setup_make, pylong, maxvalue, IS_WINDOWS, IS_MAC, no_root_errors

Check failure on line 3 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:3:63: F401 `support.IS_MAC` imported but unused

Check failure on line 3 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:3:21: F401 `support.setup_make` imported but unused

Check failure on line 3 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (I001)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:1:1: I001 Import block is un-sorted or un-formatted

Expand Down Expand Up @@ -54,7 +54,7 @@
n /= number(2)
assert n == number(100)

nn = -n;

Check failure on line 57 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E703)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:57:16: E703 Statement ends with an unnecessary semicolon
assert nn == number(-100)

def test03_comparison_operators(self):
Expand All @@ -64,10 +64,10 @@

number = cppyy.gbl.number

assert (number(20) > number(10)) == True

Check failure on line 67 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E712)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:67:16: E712 Avoid equality comparisons to `True`; use `number(20) > number(10):` for truth checks
assert (number(20) < number(10)) == False

Check failure on line 68 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E712)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:68:16: E712 Avoid equality comparisons to `False`; use `not number(20) < number(10):` for false checks
assert (number(20) >= number(20)) == True

Check failure on line 69 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E712)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:69:16: E712 Avoid equality comparisons to `True`; use `number(20) >= number(20):` for truth checks
assert (number(20) <= number(10)) == False

Check failure on line 70 in bindings/pyroot/cppyy/cppyy/test/test_operators.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E712)

bindings/pyroot/cppyy/cppyy/test/test_operators.py:70:16: E712 Avoid equality comparisons to `False`; use `not number(20) <= number(10):` for false checks
assert (number(20) != number(10)) == True
assert (number(20) == number(10)) == False

Expand Down Expand Up @@ -338,7 +338,7 @@
b = ns.Bar()
assert b[42] == 42

@mark.xfail(condition=IS_MAC, reason="Fails on OSX")
@mark.xfail(reason='Fails on macOS and on Linux with gcc 16 because cppyy picks the wrong "operator-" overload.')
def test15_class_and_global_mix(self):
"""Iterator methods have both class and global overloads"""

Expand All @@ -349,6 +349,10 @@

x = std.vector[int]([1,2,3])
assert (x.end() - 1).__deref__() == 3
# Next line fails with "TypeError: int/long conversion expects an integer object".
# The subtraction should pick the (iterator, iterator) -> int overload,
# but it somehow chooses the (iterator, iterator) -> iterator overload
# with compiling ROOT with gcc 16. TODO: fix this.
assert std.max_element(x.begin(), x.end())-x.begin() == 2
assert (x.end() - 3).__deref__() == 1

Expand Down
1 change: 1 addition & 0 deletions bindings/pyroot/pythonizations/test/import_load_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ImportLoadLibs(unittest.TestCase):
"ld.*",
"libffi",
"libgcc_s",
"libatomic",
# AddressSanitizer runtime and ROOT configuration
"libclang_rt.asan-.*",
"libROOTSanitizerConfig",
Expand Down
10 changes: 5 additions & 5 deletions roofit/roofitcore/test/testRooFuncWrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
#include <RooWorkspace.h>

#include <ROOT/StringUtils.hxx>
#include <TMath.h>
#include <TROOT.h>
#include <TRandom3.h>
#include <TSystem.h>
#include <TMath.h>

#include <functional>
#include <random>

#include "gtest_wrapper.h"

Expand All @@ -66,13 +66,13 @@ double getNumDerivative(const RooAbsReal &pdf, RooRealVar &var, const RooArgSet

void randomizeParameters(const RooArgSet &parameters)
{
TRandom3 rng(1337);

double lowerBound = -0.1;
double upperBound = 0.1;
std::uniform_real_distribution<double> unif(lowerBound, upperBound);
std::default_random_engine re;

for (auto *param : parameters) {
double mul = unif(re);
double mul = rng.Uniform(lowerBound, upperBound);

auto par = dynamic_cast<RooAbsRealLValue *>(param);
if (!par)
Expand Down
Loading