848 class __Test(_TypedParameterizable):
850 class __TestType(_SimpleParameterTypeBase):
851 def _isValid(self,value):
853 class __PSet(_ParameterTypeBase,_Parameterizable):
856 _ParameterTypeBase.__init__(self)
857 _Parameterizable.__init__(self,*arg,**args)
859 return "__PSet(\n"+_Parameterizable.dumpPython(self, options)+options.indentation()+
")" 865 x = __PSet(a = __TestType(4),
867 c = __PSet(gamma = __TestType(5))))
874 c = a.clone(x = dict(a=
None, c=
None))
875 self.assertEqual(a.t.value(),1)
876 self.assertEqual(a.u.value(),2)
877 self.assertEqual(b.t.value(),3)
878 self.assertEqual(b.u.value(),2)
879 self.assertEqual(b.v.value(),4)
880 self.assertEqual(b.x.a.value(),7)
881 self.assertEqual(b.x.b.value(),6)
882 self.assertEqual(b.x.c.gamma.value(),8)
883 self.assertEqual(b.x.d.value(),9)
884 self.assertEqual(hasattr(b,
"w"),
False)
885 self.assertEqual(hasattr(c.x,
"a"),
False)
886 self.assertEqual(hasattr(c.x,
"c"),
False)
887 self.assertRaises(TypeError,a.clone,**{
"v":1})
888 d = a.clone(__PSet(k=__TestType(42)))
889 self.assertEqual(d.t.value(), 1)
890 self.assertEqual(d.k.value(), 42)
891 d2 = a.clone(__PSet(t=__TestType(42)))
892 self.assertEqual(d2.t.value(), 42)
893 d3 = a.clone(__PSet(t=__TestType(42)),
894 __PSet(u=__TestType(56)))
895 self.assertEqual(d3.t.value(), 42)
896 self.assertEqual(d3.u.value(), 56)
897 self.assertRaises(ValueError,a.clone,
898 __PSet(t=__TestType(42)),
899 __PSet(t=__TestType(56)))
900 d4 = a.clone(__PSet(t=__TestType(43)), u = 57)
901 self.assertEqual(d4.t.value(), 43)
902 self.assertEqual(d4.u.value(), 57)
903 self.assertRaises(TypeError,a.clone,t=__TestType(43),**{
"doesNotExist":57})
906 self.assertEqual(len(e.parameterNames_()), 0)
907 f = e.clone(__PSet(a = __TestType(1)), b = __TestType(2))
908 self.assertEqual(f.a.value(), 1)
909 self.assertEqual(f.b.value(), 2)
911 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)