-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbb7c4d
commit 9df6242
Showing
2 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ | |
__author__ = "Vanya BELYAEV [email protected]" | ||
__date__ = "2023-02-14" | ||
__all__ = ( | ||
'make_fun1' , ## conbert 1D python function/callable into C++ function | ||
'make_fun2' , ## conbert 2D python function/callable into C++ function | ||
'make_fun3' , ## conbert 3D python function/callable into C++ function | ||
'make_fun1' , ## convert 1D python function/callable into C++ function | ||
'make_fun2' , ## convert 2D python function/callable into C++ function | ||
'make_fun3' , ## convert 3D python function/callable into C++ function | ||
) | ||
# ============================================================================= | ||
from ostap.core.meta_info import root_info | ||
|
@@ -30,7 +30,7 @@ | |
if ( 6 , 24 ) <= root_info : | ||
## convert python 1D-function into C++ functor | ||
def make_fun1 ( fun , forcepc = False ) : | ||
"""Convert python 1D-function into C++ functor""" | ||
""" Convert python 1D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
## | ||
if forcepc : | ||
|
@@ -40,7 +40,7 @@ def make_fun1 ( fun , forcepc = False ) : | |
return Ostap.Math.Apply ( fun ) | ||
## convert python 2D-function into C++ functor | ||
def make_fun2 ( fun , forcepc = False ) : | ||
"""Convert python 2D-function into C++ functor""" | ||
""" Convert python 2D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
## | ||
if forcepc : | ||
|
@@ -50,7 +50,7 @@ def make_fun2 ( fun , forcepc = False ) : | |
return Ostap.Math.Apply2 ( fun ) | ||
## convert python 3D-function into C++ functor | ||
def make_fun3 ( fun , forcepc = False ) : | ||
"""Convert python 3D-function into C++ functor""" | ||
""" Convert python 3D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
## | ||
if forcepc : | ||
|
@@ -62,7 +62,7 @@ def make_fun3 ( fun , forcepc = False ) : | |
elif (6,18) <= root_info : | ||
# ========================================================================= | ||
def make_fun1 ( fun , forcepc = False ) : | ||
"""Convert python 1D-function into C++ functor""" | ||
""" Convert python 1D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC = Ostap.Functions.PyCallable | ||
pc = fun if isinstance ( fun , PC ) else PC ( fun , True ) | ||
|
@@ -73,7 +73,7 @@ def make_fun1 ( fun , forcepc = False ) : | |
res ._pc = pc,fun | ||
return res | ||
def make_fun2 ( fun , forcepc = False ) : | ||
"""Convert python 2D-function into C++ functor""" | ||
""" Convert python 2D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC2 = Ostap.Functions.PyCallable2 | ||
pc = fun if isinstance ( fun , PC2 ) else PC2 ( fun , True ) | ||
|
@@ -84,7 +84,7 @@ def make_fun2 ( fun , forcepc = False ) : | |
res ._pc = pc,fun | ||
return res | ||
def make_fun3 ( fun , forcepc = False ) : | ||
"""Convert python 3D-function into C++ functor""" | ||
""" Convert python 3D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC3 = Ostap.Functions.PyCallable3 | ||
pc = fun if isinstance ( fun , PC3 ) else PC3 ( fun , True ) | ||
|
@@ -98,17 +98,17 @@ def make_fun3 ( fun , forcepc = False ) : | |
else : | ||
# ========================================================================= | ||
def make_fun1 ( fun , forcepc = False ) : | ||
"""Convert python 1D-function into C++ functor""" | ||
""" Convert python 1D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC = Ostap.Functions.PyCallable | ||
return fun if isinstance ( fun , PC ) else PC ( fun , True ) | ||
def make_fun2 ( fun , forcepc = False ) : | ||
"""Convert python 2D-function into C++ functor""" | ||
""" Convert python 2D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC2 = Ostap.Functions.PyCallable2 | ||
return fun if isinstance ( fun , PC2 ) else PC2 ( fun , True ) | ||
def make_fun3 ( fun , forcepc = False ) : | ||
"""Convert python 3D-function into C++ functor""" | ||
""" Convert python 3D-function into C++ functor""" | ||
assert callable ( fun ) , 'Function must be callable!' | ||
PC3 = Ostap.Functions.PyCallable3 | ||
return fun if isinstance ( fun , PC3 ) else PC3 ( fun , True ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters