Commit c7aa1d00 authored by kyleabeauchamp's avatar kyleabeauchamp
Browse files

Merge remote-tracking branch 'upstream/master' into vagrant

parents aea4e454 f7127d33
...@@ -47,7 +47,6 @@ class CharmmFile(object): ...@@ -47,7 +47,6 @@ class CharmmFile(object):
""" """
def __init__(self, fname, mode='r'): def __init__(self, fname, mode='r'):
self.closed = False
if mode not in ('r', 'w'): if mode not in ('r', 'w'):
raise ValueError('Cannot open CharmmFile with mode "%s"' % mode) raise ValueError('Cannot open CharmmFile with mode "%s"' % mode)
if mode == 'r': if mode == 'r':
...@@ -58,6 +57,7 @@ class CharmmFile(object): ...@@ -58,6 +57,7 @@ class CharmmFile(object):
self._handle = open(fname, mode) self._handle = open(fname, mode)
except IOError, e: except IOError, e:
raise CharmmFileError(str(e)) raise CharmmFileError(str(e))
self.closed = False
self.line_number = 0 self.line_number = 0
def write(self, *args, **kwargs): def write(self, *args, **kwargs):
......
...@@ -41,12 +41,12 @@ Quantity(value=1.0, unit=calorie) ...@@ -41,12 +41,12 @@ Quantity(value=1.0, unit=calorie)
>>> print(joule.conversion_factor_to(calorie)) >>> print(joule.conversion_factor_to(calorie))
0.239005736138 0.239005736138
>>> c.in_units_of(joules) >>> c.in_units_of(joules)
Quantity(value=4.1840000000000002, unit=joule) Quantity(value=4.184, unit=joule)
>>> j = 1.0*joules >>> j = 1.0*joules
>>> j >>> j
Quantity(value=1.0, unit=joule) Quantity(value=1.0, unit=joule)
>>> j.in_units_of(calories) >>> j.in_units_of(calories)
Quantity(value=0.23900573613766729, unit=calorie) Quantity(value=0.2390057361376673, unit=calorie)
>>> j/joules >>> j/joules
1.0 1.0
>>> print(j/calories) >>> print(j/calories)
...@@ -58,7 +58,7 @@ Quantity(value=0.23900573613766729, unit=calorie) ...@@ -58,7 +58,7 @@ Quantity(value=0.23900573613766729, unit=calorie)
>>> c**2 >>> c**2
Quantity(value=1.0, unit=calorie**2) Quantity(value=1.0, unit=calorie**2)
>>> (c**2).in_units_of(joule*joule) >>> (c**2).in_units_of(joule*joule)
Quantity(value=17.505856000000001, unit=joule**2) Quantity(value=17.505856, unit=joule**2)
>>> ScaledUnit(1000.0, kelvin, "kilokelvin", "kK") >>> ScaledUnit(1000.0, kelvin, "kilokelvin", "kK")
ScaledUnit(factor=1000.0, master=kelvin, name='kilokelvin', symbol='kK') ScaledUnit(factor=1000.0, master=kelvin, name='kilokelvin', symbol='kK')
...@@ -252,12 +252,12 @@ Collections of numbers can also be used as values. ...@@ -252,12 +252,12 @@ Collections of numbers can also be used as values.
>>> print(s4) >>> print(s4)
((1, 2, 3), (4, 5, 6)) cm ((1, 2, 3), (4, 5, 6)) cm
>>> print(s4 / millimeters) >>> print(s4 / millimeters)
[(10.0, 20.0, 30.0), (40.0, 50.0, 60.0)] ((10.0, 20.0, 30.0), (40.0, 50.0, 60.0))
>>> t = (1,2,3) * centimeters >>> t = (1,2,3) * centimeters
>>> print(t) >>> print(t)
(1, 2, 3) cm (1, 2, 3) cm
>>> print(t / millimeters) >>> print(t / millimeters)
[10.0, 20.0, 30.0] (10.0, 20.0, 30.0)
Numpy examples are commented out because not all systems have numpy installed Numpy examples are commented out because not all systems have numpy installed
# >>> import numpy # >>> import numpy
...@@ -772,7 +772,7 @@ Examples ...@@ -772,7 +772,7 @@ Examples
Creating a new ScaledUnit: Creating a new ScaledUnit:
>>> mC = milli * ScaledUnit(4.184, joule, "calorie", "cal") >>> mC = milli * ScaledUnit(4.184, joule, "calorie", "cal")
>>> mC >>> mC
ScaledUnit(factor=0.0041840000000000002, master=joule, name='millicalorie', symbol='mcal') ScaledUnit(factor=0.004184, master=joule, name='millicalorie', symbol='mcal')
Creating a new Unit: Creating a new Unit:
>>> ms = milli * second >>> ms = milli * second
...@@ -795,7 +795,7 @@ Examples ...@@ -795,7 +795,7 @@ Examples
Formatting of Quantities Formatting of Quantities
>>> x = 5.439999999 * picosecond >>> x = 5.439999999 * picosecond
>>> x >>> x
Quantity(value=5.4399999990000003, unit=picosecond) Quantity(value=5.439999999, unit=picosecond)
>>> x.format("%.3f") >>> x.format("%.3f")
'5.440 ps' '5.440 ps'
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment