844 class __Test(_TypedParameterizable):
846 class __TestType(_SimpleParameterTypeBase):
847 def _isValid(self,value):
849 class __PSet(_ParameterTypeBase,_Parameterizable):
852 _ParameterTypeBase.__init__(self)
853 _Parameterizable.__init__(self,*arg,**args)
855 return "__PSet(\n"+_Parameterizable.dumpPython(self, options)+options.indentation()+
")" 861 x = __PSet(a = __TestType(4),
863 c = __PSet(gamma = __TestType(5))))
870 c = a.clone(x = dict(a=
None, c=
None))
871 self.assertEqual(a.t.value(),1)
872 self.assertEqual(a.u.value(),2)
873 self.assertEqual(b.t.value(),3)
874 self.assertEqual(b.u.value(),2)
875 self.assertEqual(b.v.value(),4)
876 self.assertEqual(b.x.a.value(),7)
877 self.assertEqual(b.x.b.value(),6)
878 self.assertEqual(b.x.c.gamma.value(),8)
879 self.assertEqual(b.x.d.value(),9)
880 self.assertEqual(hasattr(b,
"w"),
False)
881 self.assertEqual(hasattr(c.x,
"a"),
False)
882 self.assertEqual(hasattr(c.x,
"c"),
False)
883 self.assertRaises(TypeError,a.clone,**{
"v":1})
884 d = a.clone(__PSet(k=__TestType(42)))
885 self.assertEqual(d.t.value(), 1)
886 self.assertEqual(d.k.value(), 42)
887 d2 = a.clone(__PSet(t=__TestType(42)))
888 self.assertEqual(d2.t.value(), 42)
889 d3 = a.clone(__PSet(t=__TestType(42)),
890 __PSet(u=__TestType(56)))
891 self.assertEqual(d3.t.value(), 42)
892 self.assertEqual(d3.u.value(), 56)
893 self.assertRaises(ValueError,a.clone,
894 __PSet(t=__TestType(42)),
895 __PSet(t=__TestType(56)))
896 d4 = a.clone(__PSet(t=__TestType(43)), u = 57)
897 self.assertEqual(d4.t.value(), 43)
898 self.assertEqual(d4.u.value(), 57)
899 self.assertRaises(TypeError,a.clone,t=__TestType(43),**{
"doesNotExist":57})
902 self.assertEqual(len(e.parameterNames_()), 0)
903 f = e.clone(__PSet(a = __TestType(1)), b = __TestType(2))
904 self.assertEqual(f.a.value(), 1)
905 self.assertEqual(f.b.value(), 2)
907 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)