837 class __Test(_TypedParameterizable):
839 class __TestType(_SimpleParameterTypeBase):
840 def _isValid(self,value):
842 class __PSet(_ParameterTypeBase,_Parameterizable):
845 _ParameterTypeBase.__init__(self)
846 _Parameterizable.__init__(self,*arg,**args)
848 return "__PSet(\n"+_Parameterizable.dumpPython(self, options)+options.indentation()+
")" 854 x = __PSet(a = __TestType(4),
856 c = __PSet(gamma = __TestType(5))))
863 c = a.clone(x = dict(a=
None, c=
None))
864 self.assertEqual(a.t.value(),1)
865 self.assertEqual(a.u.value(),2)
866 self.assertEqual(b.t.value(),3)
867 self.assertEqual(b.u.value(),2)
868 self.assertEqual(b.v.value(),4)
869 self.assertEqual(b.x.a.value(),7)
870 self.assertEqual(b.x.b.value(),6)
871 self.assertEqual(b.x.c.gamma.value(),8)
872 self.assertEqual(b.x.d.value(),9)
873 self.assertEqual(hasattr(b,
"w"),
False)
874 self.assertEqual(hasattr(c.x,
"a"),
False)
875 self.assertEqual(hasattr(c.x,
"c"),
False)
876 self.assertRaises(TypeError,a.clone,**{
"v":1})
877 d = a.clone(__PSet(k=__TestType(42)))
878 self.assertEqual(d.t.value(), 1)
879 self.assertEqual(d.k.value(), 42)
880 d2 = a.clone(__PSet(t=__TestType(42)))
881 self.assertEqual(d2.t.value(), 42)
882 d3 = a.clone(__PSet(t=__TestType(42)),
883 __PSet(u=__TestType(56)))
884 self.assertEqual(d3.t.value(), 42)
885 self.assertEqual(d3.u.value(), 56)
886 self.assertRaises(ValueError,a.clone,
887 __PSet(t=__TestType(42)),
888 __PSet(t=__TestType(56)))
889 d4 = a.clone(__PSet(t=__TestType(43)), u = 57)
890 self.assertEqual(d4.t.value(), 43)
891 self.assertEqual(d4.u.value(), 57)
892 self.assertRaises(TypeError,a.clone,t=__TestType(43),**{
"doesNotExist":57})
895 self.assertEqual(len(e.parameterNames_()), 0)
896 f = e.clone(__PSet(a = __TestType(1)), b = __TestType(2))
897 self.assertEqual(f.a.value(), 1)
898 self.assertEqual(f.b.value(), 2)
900 self.assertEqual(len(g.parameterNames_()), 0)
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
def dumpPython(process, name)