Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jun 12, 2024
1 parent 44e8b03 commit 9d15597
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/anemoi/datasets/create/functions/filters/rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@


class RenamedFieldMapping:
"""Rename a field based on the value of another field.
Args:
field (Field): The field to be renamed.
what (str): The name of the field that will be used to rename the field.
renaming (dict): A dictionary mapping the values of 'what' to the new names.
"""

def __init__(self, field, what, renaming):
self.field = field
self.what = what
Expand All @@ -29,6 +37,12 @@ def __getattr__(self, name):


class RenamedFieldFormat:
"""Rename a field based on a format string.
Args:
format (str): A string that defines the new name of the field.
"""

def __init__(self, field, format):
self.field = field
self.format = format
Expand Down

0 comments on commit 9d15597

Please sign in to comment.