Skip to content

Commit 9d7c3cd

Browse files
introduce SModelSUnit for type hinting
1 parent bec5f58 commit 9d7c3cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

smodels/base/physicsUnits.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
import unum
12+
SModelSUnit = unum.Unum # for type hinting
1213

1314
# description see
1415
# http://home.scarlet.be/be052320/Unum.html
@@ -54,7 +55,11 @@
5455
Called as script, will print some base.physicsUnits.
5556
5657
"""
58+
def getXSec() -> SModelSUnit:
59+
return 3.0*fb
60+
5761
three = 3.0 * fb
5862
print(three, "=", three.asUnit(pb))
5963
seven = 7.0 * TeV
6064
print(seven, "=", seven.asUnit(GeV))
65+
print ( getXSec() )

0 commit comments

Comments
 (0)