Skip to content

Commit

Permalink
docs: Improve docstrings and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Milind220 committed Mar 11, 2022
1 parent 09014e8 commit b5ade4f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ozone/ozone.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ def _parse_data(
"""Parse the data from the API response
Args:
data_obj (dict): The data from the API response.
data_obj (JSON object returned by json.loads): The data from the API response.
city (str): The city name.
params (List[str]): The parameters to parse.
Returns:
list: A list of dictionaries containing the data.
list: A list containing a single dictionary with the data.
"""
# A single row of data for the dataframe.
row: Dict[str, Union[str, float]] = {}
Expand Down Expand Up @@ -178,6 +180,9 @@ def _parse_data(
except KeyError:
# Gets triggered if the parameter is not provided by station.
row[param] = numpy.nan

# Return a list containing the dictionary so that it can be used with
# pandas.concat method later.
return [row]

def _AQI_meaning(self, aqi: float) -> Tuple[str, str]:
Expand Down Expand Up @@ -349,7 +354,7 @@ def get_specific_parameter(
Gets all parameters by default.
Returns:
float: Value of the city's specified parameter
float: Value of the specified parameter for the given city.
"""
result: float = 0.0
try:
Expand Down

0 comments on commit b5ade4f

Please sign in to comment.