Skip to content

Commit

Permalink
Disable doctest while debugging.
Browse files Browse the repository at this point in the history
Refs #9573
  • Loading branch information
martyngigg committed Jun 11, 2014
1 parent c0c8b26 commit 308990d
Showing 1 changed file with 35 additions and 33 deletions.
68 changes: 35 additions & 33 deletions Code/Mantid/docs/source/algorithms/FixGSASInstrumentFile-v1.rst
Expand Up @@ -20,45 +20,47 @@ Usage

**Example - simple rebin of a histogram workspace:**

.. testcode:: ExHistSimple

# Load original file and check each line
rfile = open("PG3HR60_FmPython.iparm", "r")
lines = rfile.readlines()
rfile.close()

numlinefewer80 = 0
for line in lines:
if len(line) != 80:
numlinefewer80 += 1

# Run algorithm to fix the instrument file
FixGSASInstrumentFile(InputFilename="PG3HR60_FmPython.iparm", OutputFilename="/tmp/Fixed.iparm")

# Load new file and check each line
wfile = open("/tmp/Fixed.iparm", "r")
lines = wfile.readlines()
numlinefewer80b = 0
for line in lines:
if len(line) > 0:
line = line.split("\n")[0]
::

.. testcode:: ExHistSimple

# Load original file and check each line
rfile = open("PG3HR60_FmPython.iparm", "r")
lines = rfile.readlines()
rfile.close()

numlinefewer80 = 0
for line in lines:
if len(line) != 80:
numlinefewer80b += 1
numlinefewer80 += 1

# Run algorithm to fix the instrument file
FixGSASInstrumentFile(InputFilename="PG3HR60_FmPython.iparm", OutputFilename="/tmp/Fixed.iparm")

# Load new file and check each line
wfile = open("/tmp/Fixed.iparm", "r")
lines = wfile.readlines()
numlinefewer80b = 0
for line in lines:
if len(line) > 0:
line = line.split("\n")[0]
if len(line) != 80:
numlinefewer80b += 1

# Print out result
print "Original File: Number of lines that are not equal to 80 characters = ", numlinefewer80
print "Corrected File: Number of lines that are not equal to 80 characters = ", numlinefewer80b
# Print out result
print "Original File: Number of lines that are not equal to 80 characters = ", numlinefewer80
print "Corrected File: Number of lines that are not equal to 80 characters = ", numlinefewer80b

.. testcleanup:: ExHistSimple
.. testcleanup:: ExHistSimple

import os
os.remove("/tmp/Fixed.iparm")
import os
os.remove("/tmp/Fixed.iparm")

Output:
Output:

.. testoutput:: ExHistSimple
.. testoutput:: ExHistSimple

Original File: Number of lines that are not equal to 80 characters = 1510
Corrected File: Number of lines that are not equal to 80 characters = 0
Original File: Number of lines that are not equal to 80 characters = 1510
Corrected File: Number of lines that are not equal to 80 characters = 0

.. categories::

0 comments on commit 308990d

Please sign in to comment.