Changeset b3e8629 in sasview for src/sas/qtgui/Plotting/ConvertUnits.py
- Timestamp:
- Nov 9, 2017 8:41:54 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- cee5c78
- Parents:
- 749b715
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/26/17 03:13:05)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:41:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/ConvertUnits.py
r749b715 rb3e8629 42 42 unit = toks[0] + "^{" + str(powerer) + "}" 43 43 else: 44 raise ValueError , "missing } in unit expression"44 raise ValueError("missing } in unit expression") 45 45 else: # no powerer 46 46 if power != 1: 47 47 unit = "(" + unit + ")" + "^{" + str(power) + "}" 48 48 else: 49 raise ValueError , "empty unit ,enter a powerer different from zero"49 raise ValueError("empty unit ,enter a powerer different from zero") 50 50 return unit 51 51 … … 68 68 unit8 = "m/s^{4}" # x^2 (m/s^{4})^{2} 69 69 70 print "this unit1 %s ,its powerer %s , and value %s" % (unit1, 1, convert_unit(1, unit1))71 print "this unit2 %s ,its powerer %s , and value %s" % (unit2, 1, convert_unit(1, unit2))72 print "this unit3 %s ,its powerer %s , and value %s" % (unit3, 2, convert_unit(2, unit3))73 print "this unit4 %s ,its powerer %s , and value %s" % (unit4, -1, convert_unit(-1, unit4))74 print "this unit5 %s ,its powerer %s , and value %s" % (unit5, 2, convert_unit(2, unit5))75 print "this unit6 %s ,its powerer %s , and value %s" % (unit6, 2, convert_unit(2, unit6))76 print "this unit7 %s ,its powerer %s , and value %s" % (unit7, -1, convert_unit(-1, unit7))77 print "this unit8 %s ,its powerer %s , and value %s" % (unit8, 2, convert_unit(2, unit8))78 print "this unit9 %s ,its powerer %s , and value %s" % (unit9, 2, convert_unit(2, unit9))70 print("this unit1 %s ,its powerer %s , and value %s" % (unit1, 1, convert_unit(1, unit1))) 71 print("this unit2 %s ,its powerer %s , and value %s" % (unit2, 1, convert_unit(1, unit2))) 72 print("this unit3 %s ,its powerer %s , and value %s" % (unit3, 2, convert_unit(2, unit3))) 73 print("this unit4 %s ,its powerer %s , and value %s" % (unit4, -1, convert_unit(-1, unit4))) 74 print("this unit5 %s ,its powerer %s , and value %s" % (unit5, 2, convert_unit(2, unit5))) 75 print("this unit6 %s ,its powerer %s , and value %s" % (unit6, 2, convert_unit(2, unit6))) 76 print("this unit7 %s ,its powerer %s , and value %s" % (unit7, -1, convert_unit(-1, unit7))) 77 print("this unit8 %s ,its powerer %s , and value %s" % (unit8, 2, convert_unit(2, unit8))) 78 print("this unit9 %s ,its powerer %s , and value %s" % (unit9, 2, convert_unit(2, unit9))) 79 79 80 80
Note: See TracChangeset
for help on using the changeset viewer.