diff --git a/Code/Mantid/docs/source/algorithms/SaveCSV-v1.rst b/Code/Mantid/docs/source/algorithms/SaveCSV-v1.rst index e9285359a36b91049ccf1100b33c25c7b4fc38a6..75fc7a219c220655665e9d13c6626d208c26c619 100644 --- a/Code/Mantid/docs/source/algorithms/SaveCSV-v1.rst +++ b/Code/Mantid/docs/source/algorithms/SaveCSV-v1.rst @@ -11,20 +11,20 @@ Description The format of the saved ascii CSV file for a 1D worksspace consists of three columns where the numbers of each row are seperated by the -Seperator and each line by the LineSeperator. +Separator and each line by the LineSeparator. -The format of the saved CSV file for a 2D workspace is as follows: +The format of the saved CSV file for a 2D workspace is as follows:: -| ``   A      0, 200, 400, 600, ..., 50000 `` -| ``    0     10,   4, 234,  35, ...,    32 `` -| ``    1      4, 234,   4,   9, ...,    12 `` -| ``    A      0, 100, 200, 300, ..., 25000 `` -| ``    2     34,   0,   0,   0, ...,    23`` + A 0, 200, 400, 600, ..., 50000 + 0 10, 4, 234, 35, ..., 32 + 1 4, 234, 4, 9, ..., 12 + A 0, 100, 200, 300, ..., 25000 + 2 34, 0, 0, 0, ..., 23 -| ``   ERRORS`` -| ``    0    0.1, 3.4, 2.4, 3.5, ...,     2 `` -| ``    1    3.1, 3.3, 2.5, 3.5, ...,     2 `` -| ``    2    1.1, 3.3, 2.4,   5, ...,   2.4`` + ERRORS + 0 0.1, 3.4, 2.4, 3.5, ..., 2 + 1 3.1, 3.3, 2.5, 3.5, ..., 2 + 2 1.1, 3.3, 2.4, 5, ..., 2.4 where for the matrix above the ERRORS line the first column shows the content of the numbers on the of the same line; i.e. 'A' is followed by @@ -37,4 +37,22 @@ the same x-axis but the third histogram has a different x-axis. The matrix following the ERRORS line lists the errors as recorded for each histogram. +Usage +----- + +.. testcode:: + + import os + # Create a file path in the user home directory + filePath = os.path.expanduser('~/SavedCSVFile.csv') + + # Create a workspace + ws=CreateSampleWorkspace() + # Save it in Nexus format + SaveCSV(ws,filePath) + +.. testcleanup:: + + os.remove(filePath) + .. categories:: diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py index 469da90563c8198129b972e27b778dfa40d0af24..c8883ffcbccdaaffc518782ff798e69378c217a7 100644 --- a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py +++ b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py @@ -140,6 +140,11 @@ class PropertiesDirective(BaseDirective): # Fall-back default for anything defaultstr = str(default) + # replace nonprintable characters with their printable + # representations, such as \n, \t, ... + defaultstr = repr(defaultstr)[1:-1] + defaultstr = defaultstr.replace('\\','\\\\') + # Replace the ugly default values with "Optional" if (defaultstr == "8.9884656743115785e+307") or \ (defaultstr == "1.7976931348623157e+308") or \