Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 committed Aug 14, 2024
1 parent 92aee19 commit cb5f403
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions fgpyo/util/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,7 @@ def write(cls, path: Path, *values: MetricType) -> None:
@classmethod
@final
def header(cls) -> List[str]:
"""The list of header values for the metric.
This method may be overridden to re-order or subset the columns written to file with
`write()` or returned by `values()`.
"""
"""The list of header values for the metric."""
field_types = list(inspect.get_fields(cls)) # type: ignore[arg-type]
field_names = {field.name for field in field_types}
header = cls._header(field_types=field_types)
Expand All @@ -307,10 +303,10 @@ def header(cls) -> List[str]:

@classmethod
def _header(cls, field_types: Optional[List[FieldType]] = None) -> List[str]:
"""Returns a mapping of a field to the index it should be returned in `values()`
based on the field names returned by `header()`.
"""Returns a list of field names for the header and values.
This is useful for re-ordering or sub-setting the output columns in `write()`.
This method may be overridden to re-order or subset the columns written to file with
`write()` or returned by `values()`.
"""
if field_types is None:
field_types = list(inspect.get_fields(cls)) # type: ignore[arg-type]
Expand Down

0 comments on commit cb5f403

Please sign in to comment.