本文整理汇总了Python中ShipGeoConfig.ConfigRegistry.register_config方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigRegistry.register_config方法的具体用法?Python ConfigRegistry.register_config怎么用?Python ConfigRegistry.register_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShipGeoConfig.ConfigRegistry
的用法示例。
在下文中一共展示了ConfigRegistry.register_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from ShipGeoConfig import ConfigRegistry [as 别名]
# 或者: from ShipGeoConfig.ConfigRegistry import register_config [as 别名]
def setUp(self):
with ConfigRegistry.register_config("bb") as c:
c.length = 10
c.width = 20
c.muShield = AttrDict(z=10)
with ConfigRegistry.register_config("cc", base="bb") as c:
c.height = 30
c.volume = c.length * c.height * c.width
示例2: execute
# 需要导入模块: from ShipGeoConfig import ConfigRegistry [as 别名]
# 或者: from ShipGeoConfig.ConfigRegistry import register_config [as 别名]
def execute(f,ox,name='ShipGeo'):
if type(ox) == type(''): ox = ConfigRegistry.register_config("basic")
o = retrieveGitTags(ox)
if type(f)==type("s"): fg = ROOT.TFile.Open(f,'update')
else: fg = f
pkl = Pickler(fg)
pkl.dump(o,name)
if type(f)==type("s"): fg.Close()
示例3: AttrDict
# 需要导入模块: from ShipGeoConfig import ConfigRegistry [as 别名]
# 或者: from ShipGeoConfig.ConfigRegistry import register_config [as 别名]
import shipunit as u
from ShipGeoConfig import AttrDict, ConfigRegistry
# the following params should be passed through 'ConfigRegistry.loadpy' method
# muShieldDesign = 1 # 1=passive 2=active
# targetOpt = 5 # 0=solid >0 sliced, 5 pieces of tungsten, 4 air slits
with ConfigRegistry.register_config("basic") as c:
c.vetoStation = AttrDict(z=-2390.*u.cm)
c.TrackStation1 = AttrDict(z=1510.*u.cm)
c.TrackStation2 = AttrDict(z=1710.*u.cm)
c.TrackStation3 = AttrDict(z=2150.*u.cm)
c.TrackStation4 = AttrDict(z=2370.*u.cm)
c.z = c.TrackStation2.z + 0.5 * (c.TrackStation3.z - c.TrackStation2.z)
c.Bfield = AttrDict(z=c.z)
c.Bfield.max = 1.5*u.kilogauss # was 1.15 in EOI
# target absorber muon shield setup
c.decayVolume = AttrDict(z=0*u.cm)
c.decayVolume.length = 50*u.m
c.muShield = AttrDict(z=0*u.cm)
c.muShield.dZ1 = 2.5*u.m
c.muShield.dZ2 = 3.5*u.m
c.muShield.dZ3 = 3.0*u.m
c.muShield.dZ4 = 3.0*u.m
c.muShield.dZ5 = 2.5*u.m
c.muShield.dZ6 = 2.5*u.m
c.muShield.LE = 5*u.m