Skip to content

Commit a1de7d9

Browse files
nh13msto
andcommitted
Apply suggestions from code review
Co-authored-by: Matt Stone <[email protected]>
1 parent 5060e80 commit a1de7d9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fgpyo/util/metric.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _parsers(cls) -> Dict[type, Callable[[str], Any]]:
211211

212212
@classmethod
213213
def read(
214-
cls, path: Path, ignore_extra_fields: bool = True, strip_whitespace: bool = True
214+
cls, path: Path, ignore_extra_fields: bool = True, strip_whitespace: bool = False
215215
) -> Iterator[Any]:
216216
"""Reads in zero or more metrics from the given path.
217217
@@ -223,7 +223,8 @@ def read(
223223
Args:
224224
path: the path to the metrics file.
225225
ignore_extra_fields: True to ignore any extra columns, False to raise an exception.
226-
strip_whitespace: True to strip leading and trailing whitespace, False to keep as-is.
226+
strip_whitespace: True to strip leading and trailing whitespace from each field,
227+
False to keep as-is.
227228
"""
228229
parsers = cls._parsers()
229230
with io.to_reader(path) as reader:
@@ -358,7 +359,7 @@ def format_value(cls, value: Any) -> str: # noqa: C901
358359
+ "}"
359360
)
360361
elif isinstance(value, float):
361-
return f"{round(value, 5)}".strip()
362+
return f"{round(value, 5)}"
362363
elif value is None:
363364
return ""
364365
else:

0 commit comments

Comments
 (0)