Skip to content

Commit adec947

Browse files
author
Alan Christie
committed
- Minor doc tweaks
1 parent f5429e9 commit adec947

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/python/pipelines_utils/TypedColumnReader.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ def __init__(self, filename,
129129
:param type_sep: The type separator
130130
:param header: An optional header. If provided the must not have
131131
a header line. This is provided to allow processing
132-
of exiting files that have no header. You are strongly
133-
encouraged to create new files with a header.
132+
of exiting files that have no header. The headder
133+
must contain column names and optional types.
134+
"smiles:string" would be a column named "smiles"
135+
of type "string" and "n:int" would be a column known as
136+
"n" of type "integer". Although you can provide
137+
thew header here you are strongly
138+
encouraged to add a header line to all new files.
134139
"""
135140

136141
self._filename = filename
@@ -156,10 +161,12 @@ def __init__(self, filename,
156161

157162
def __iter__(self):
158163
"""Return the next type-converted row from the file.
159-
The first row is expected to be a header with optional
160-
type definitions.
164+
Unless the header is provided in the initialiser, the first row is
165+
expected to be a header with optional type definitions.
161166
162167
:returns: A dictionary of type-converted values for the next row
168+
where the dictionary key is the name of the column
169+
(as defined in the header).
163170
164171
:raises: ValueError if a column value cannot be converted
165172
:raises: ContentError if the column value is unknown or does not

0 commit comments

Comments
 (0)