def test_LogAxisTics_chooseLimits_axisMin_1(self):
   y = glyph._LogAxisTics(1.0, 1000, unitSystem='si')
   y.applySettings(axisMin=1.0)
   y.chooseLimits()
   self.assertEqual((y.bottom, y.top, y.span), (1.0, 1000.0, 999.0))
 def test_LogAxisTics_chooseLimits_yMax_0_axisMax_0_1(self):
   y = glyph._LogAxisTics(0.0, 0.0, unitSystem='si')
   y.applySettings(axisMax=0.1)
   with self.assertRaises(glyph.GraphError):
     y.chooseLimits()
 def test_LogAxisTics_makeLabel_small_span_int(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
     self.assertEqual(y.reconcileLimits(), None)
     y.span = 1
     self.assertEqual(y.makeLabel(int(5)), '5.00 ')
示例#4
0
 def test_LogAxisTics_makeLabel_med_span_int(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem="si")
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float("inf"))
     self.assertEqual(y.reconcileLimits(), None)
     y.span = 5
     self.assertEqual(y.makeLabel(int(10)), "10.0 ")
 def test_LogAxisTics_invalid_base_value(self):
     with self.assertRaises(glyph.GraphError):
         glyph._LogAxisTics(0.0, 100.0, base=1.0, unitSystem='binary')
 def test_LogAxisTics_reconcileLimits_axisLimit_above_max(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     y.applySettings(axisMin=None, axisMax=10, axisLimit=float('inf'))
     self.assertEqual(y.reconcileLimits(), None)
示例#7
0
 def test_LogAxisTics_chooseLimits_defaults(self):
     y = glyph._LogAxisTics(1.0, 1000, unitSystem="si")
     y.applySettings()
     y.chooseLimits()
     self.assertEqual((y.bottom, y.top, y.span), (1.0, 1000.0, 999.0))
 def test_LogAxisTics_getLabelValues_neg(self):
     y = glyph._LogAxisTics(1, 5, unitSystem='si')
     y.applySettings()
     y.chooseLimits()
     self.assertEqual(y.getLabelValues(), [1.0, 10.0])
示例#9
0
 def test_LogAxisTics_chooseStep_default_divisors(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem="si")
     self.assertEqual(y.chooseStep([4, 5, 6]), None)
     self.assertEqual(y.step, None)
示例#10
0
 def test_LogAxisTics_chooseStep_min_max_0_0(self):
     y = glyph._LogAxisTics(0.0, 0.0, unitSystem="si")
     self.assertEqual(y.chooseStep([4, 5, 6]), None)
     self.assertEqual(y.step, None)
示例#11
0
 def test_LogAxisTics_setStep_nan(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem="si")
     y.setStep(float("nan"))
     self.assertEqual(y.step, None)
示例#12
0
 def test_LogAxisTics_setStep_5_0(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem="si")
     y.setStep(5.0)
     self.assertEqual(y.step, None)
示例#13
0
 def test_LogAxisTics_makeLabel_small_span_float(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem="si")
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float("inf"))
     self.assertEqual(y.reconcileLimits(), None)
     y.span = 1
     self.assertEqual(y.makeLabel(5.1234), "5.12 ")
 def test_LogAxisTics_chooseStep_min_max_neg_1_0(self):
     y = glyph._LogAxisTics(-1.0, -1.0, unitSystem='si')
     self.assertEqual(y.chooseStep([4, 5, 6]), None)
     self.assertEqual(y.step, None)
示例#15
0
 def test_LogAxisTics_getLabelValues_defaults(self):
     y = glyph._LogAxisTics(1, 1000, unitSystem="si")
     y.applySettings()
     y.chooseLimits()
     self.assertEqual(y.getLabelValues(), [1.0, 10.0, 100.0, 1000.0])
 def test_LogAxisTics_chooseLimits_axisMax_0(self):
     y = glyph._LogAxisTics(1, 1000, unitSystem='si')
     y.applySettings(axisMax=1.0)
     y.chooseLimits()
     self.assertEqual((y.bottom, y.top, y.span), (0.1, 1.0, 0.9))
示例#17
0
 def test_LogAxisTics_invalid_base_value(self):
   with self.assertRaises(glyph.GraphError):
       glyph._LogAxisTics(0.0, 100.0, base=1.0, unitSystem='binary')
 def test_LogAxisTics_invalid_min_value(self):
     with self.assertRaises(glyph.GraphError):
         glyph._LogAxisTics(float('NaN'), 100.0, unitSystem='binary')
 def test_LogAxisTics_getLabelValues_neg(self):
   y = glyph._LogAxisTics(1, 5, unitSystem='si')
   y.applySettings()
   y.chooseLimits()
   self.assertEqual(y.getLabelValues(), [1.0, 10.0])
 def test_LogAxisTics_reconcileLimits_defaults(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     self.assertEqual(y.reconcileLimits(), None)
 def test_LogAxisTics_valid_input(self):
   self.assertTrue(glyph._LogAxisTics(0.0, 100.0, unitSystem='binary'))
 def test_LogAxisTics_makeLabel_small_decimal(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
     self.assertEqual(y.reconcileLimits(), None)
     self.assertEqual(y.makeLabel(0.01), '0.01 ')
 def test_LogAxisTics_invalid_min_value(self):
   with self.assertRaises(glyph.GraphError):
       glyph._LogAxisTics(float('NaN'), 100.0, unitSystem='binary')
 def test_LogAxisTics_setStep_None(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     y.setStep(None)
     self.assertEqual(y.step, None)
 def test_LogAxisTics_invalid_max_value(self):
   with self.assertRaises(glyph.GraphError):
       glyph._LogAxisTics(0.0, float('inf'), unitSystem='binary')
 def test_LogAxisTics_chooseStep_min_max_neg_1_0(self):
   y = glyph._LogAxisTics(-1.0, -1.0, unitSystem='si')
   self.assertEqual(y.chooseStep([4,5,6]), None)
   self.assertEqual(y.step, None)
 def test_LogAxisTics_applySettings_axisLimit_min_greater_max(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   with self.assertRaises(glyph.GraphError):
       y.applySettings(axisMin=1000, axisMax=10, axisLimit=None)
 def test_LogAxisTics_chooseLimits_axisMax_0(self):
   y = glyph._LogAxisTics(1, 1000, unitSystem='si')
   y.applySettings(axisMax=1.0)
   y.chooseLimits()
   self.assertEqual((y.bottom, y.top, y.span), (0.1, 1.0, 0.9))
 def test_LogAxisTics_reconcileLimits_defaults(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   self.assertEqual(y.reconcileLimits(), None)
 def test_LogAxisTics_chooseStep_bad_divisors(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     self.assertEqual(y.chooseStep([0, 1, 2]), None)
     self.assertEqual(y.step, None)
 def test_LogAxisTics_reconcileLimits_axisLimit_None(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   y.applySettings(axisMin=None, axisMax=None, axisLimit=None)
   self.assertEqual(y.reconcileLimits(), None)
 def test_LogAxisTics_chooseLimits_axisMin_1(self):
     y = glyph._LogAxisTics(1.0, 1000, unitSystem='si')
     y.applySettings(axisMin=1.0)
     y.chooseLimits()
     self.assertEqual((y.bottom, y.top, y.span), (1.0, 1000.0, 999.0))
 def test_LogAxisTics_reconcileLimits_axisLimit_above_max(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   y.applySettings(axisMin=None, axisMax=10, axisLimit=float('inf'))
   self.assertEqual(y.reconcileLimits(), None)
 def test_LogAxisTics_chooseLimits_yMax_0_axisMax_0_1(self):
     y = glyph._LogAxisTics(0.0, 0.0, unitSystem='si')
     y.applySettings(axisMax=0.1)
     with self.assertRaises(glyph.GraphError):
         y.chooseLimits()
 def test_LogAxisTics_makeLabel_2k(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   y.applySettings(axisMin=None, axisMax=10, axisLimit=float('inf'))
   self.assertEqual(y.reconcileLimits(), None)
   self.assertEqual(y.makeLabel(2000), '2.0 Ki ')
 def test_LogAxisTics_valid_input(self):
     self.assertTrue(glyph._LogAxisTics(0.0, 100.0, unitSystem='binary'))
 def test_LogAxisTics_makeLabel_small_decimal(self):
   y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
   y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
   self.assertEqual(y.reconcileLimits(), None)
   self.assertEqual(y.makeLabel(0.01), '0.01 ')
 def test_LogAxisTics_invalid_max_value(self):
     with self.assertRaises(glyph.GraphError):
         glyph._LogAxisTics(0.0, float('inf'), unitSystem='binary')
 def test_LogAxisTics_makeLabel_med_span_float(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
   self.assertEqual(y.reconcileLimits(), None)
   y.span=5
   self.assertEqual(y.makeLabel(50.1234), '50.1 ')
 def test_LogAxisTics_applySettings_axisLimit_min_greater_max(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     with self.assertRaises(glyph.GraphError):
         y.applySettings(axisMin=1000, axisMax=10, axisLimit=None)
 def test_LogAxisTics_makeLabel_small_span_int(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
   self.assertEqual(y.reconcileLimits(), None)
   y.span=1
   self.assertEqual(y.makeLabel(int(5)), '5.00 ')
 def test_LogAxisTics_reconcileLimits_axisLimit_None(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     y.applySettings(axisMin=None, axisMax=None, axisLimit=None)
     self.assertEqual(y.reconcileLimits(), None)
 def test_LogAxisTics_setStep_inf(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   y.setStep(float('inf'))
   self.assertEqual(y.step, None)
 def test_LogAxisTics_makeLabel_2k(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem='binary')
     y.applySettings(axisMin=None, axisMax=10, axisLimit=float('inf'))
     self.assertEqual(y.reconcileLimits(), None)
     self.assertEqual(y.makeLabel(2000), '2.0 Ki ')
 def test_LogAxisTics_setStep_None(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   y.setStep(None)
   self.assertEqual(y.step, None)
 def test_LogAxisTics_makeLabel_med_span_float(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float('inf'))
     self.assertEqual(y.reconcileLimits(), None)
     y.span = 5
     self.assertEqual(y.makeLabel(50.1234), '50.1 ')
 def test_LogAxisTics_chooseStep_default(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   self.assertEqual(y.chooseStep(), None)
   self.assertEqual(y.step, None)
 def test_LogAxisTics_setStep_inf(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     y.setStep(float('inf'))
     self.assertEqual(y.step, None)
 def test_LogAxisTics_chooseStep_bad_divisors(self):
   y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
   self.assertEqual(y.chooseStep([0,1,2]), None)
   self.assertEqual(y.step, None)
 def test_LogAxisTics_chooseStep_default(self):
     y = glyph._LogAxisTics(0.0, 1000.0, unitSystem='si')
     self.assertEqual(y.chooseStep(), None)
     self.assertEqual(y.step, None)
示例#51
0
 def test_LogAxisTics_makeLabel_decimal(self):
     y = glyph._LogAxisTics(0.0, 100.0, unitSystem="binary")
     y.applySettings(axisMin=None, axisMax=None, axisLimit=float("inf"))
     self.assertEqual(y.reconcileLimits(), None)
     self.assertEqual(y.makeLabel(0.1), "0.10 ")