当前位置: 首页>>代码示例>>Python>>正文


Python ConfigRegistry.register_config方法代码示例

本文整理汇总了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
开发者ID:ShipSoft,项目名称:FairShip,代码行数:10,代码来源:test_shipGeoConfig.py

示例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()
开发者ID:fserret,项目名称:FairShip,代码行数:10,代码来源:saveBasicParameters.py

示例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
开发者ID:dicrescenzo,项目名称:FairShip,代码行数:32,代码来源:geometry_config_inherit.py


注:本文中的ShipGeoConfig.ConfigRegistry.register_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。