@@ -129,8 +129,13 @@ def __init__(self, filename,
129
129
:param type_sep: The type separator
130
130
:param header: An optional header. If provided the must not have
131
131
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.
134
139
"""
135
140
136
141
self ._filename = filename
@@ -156,10 +161,12 @@ def __init__(self, filename,
156
161
157
162
def __iter__ (self ):
158
163
"""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.
161
166
162
167
: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).
163
170
164
171
:raises: ValueError if a column value cannot be converted
165
172
:raises: ContentError if the column value is unknown or does not
0 commit comments