Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Change]: Remove save file func #159

Merged
merged 10 commits into from
May 25, 2022
Prev Previous commit
Next Next commit
docs: Remove docstring info about save file format
  • Loading branch information
Milind220 committed May 23, 2022
commit 3faaeddd0960eb499a519ff5f9422a865ae6740f
32 changes: 4 additions & 28 deletions src/ozone/ozone.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class Ozone:

Attributes:
token (str): The private API token for the WAQI API service.
output_dir_path (str): The path to the directory where
any output artifacts will be created
"""
_search_aqi_url: str = URLs.search_aqi_url
_find_stations_url: str = URLs.find_stations_url
Expand All @@ -78,9 +76,6 @@ def __init__(

Args:
token (str): The users private API token for the WAQI API.
output_path (str): The path to the location where
any output artifacts will be created
file_name (str): Name of output file
"""
self.token: str = token
self._check_token_validity()
Expand Down Expand Up @@ -362,8 +357,6 @@ def get_coordinate_air(
Args:
lat (float): Latitude
lon (float): Longitude
data_format (str): File format for data. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
df (pandas.DataFrame, optional): An existing dataframe to
append the data to.
params (List[str], optional): A list of parameters to get data for.
Expand All @@ -374,7 +367,6 @@ def get_coordinate_air(

Returns:
pandas.DataFrame: The dataframe containing the data.
(If you selected another data format, this dataframe will be empty)
"""
if params == [""]:
params = self._default_params
Expand All @@ -398,8 +390,6 @@ def get_city_air(

Args:
city (str): The city to get data for.
data_format (str): File format for data. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
df (pandas.DataFrame, optional): An existing dataframe to
append the data to.
params (List[str], optional): A list of parameters to get data for.
Expand All @@ -410,7 +400,6 @@ def get_city_air(

Returns:
pandas.DataFrame: The dataframe containing the data.
(If you selected another data format, this dataframe will be empty)
"""
if params == [""]:
params = self._default_params
Expand All @@ -434,8 +423,6 @@ def get_multiple_coordinate_air(

Args:
locations (list): A list of pair (latitude,longitude) to get data for.
data_format (str): File format. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
df (pandas.DataFrame, optional): An existing dataframe to
append the data to.
params (List[str], optional): A list of parameters to get data for.
Expand All @@ -445,8 +432,7 @@ def get_multiple_coordinate_air(
Gets all parameters by default..

Returns:
pandas.DataFrame: The dataframe containing the data. (If you
selected another data format, this dataframe will be empty)
pandas.DataFrame: The dataframe containing the data.
"""
for loc in locations:
try:
Expand Down Expand Up @@ -477,8 +463,6 @@ def get_range_coordinates_air(
Args:
lower_bound (tuple): start coordinate
upper_bound (tuple): end coordinate
data_format (str): File format. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
df (pandas.DataFrame, optional): An existing dataframe to
append the data to.
params (List[str], optional): A list of parameters to get data for.
Expand All @@ -488,8 +472,7 @@ def get_range_coordinates_air(
Gets all parameters by default.

Returns:
pandas.DataFrame: The dataframe containing the data. (If you
selected another data format, this dataframe will be empty)
pandas.DataFrame: The dataframe containing the data.
"""
locations = self._locate_all_coordinates(
lower_bound=lower_bound, upper_bound=upper_bound
Expand All @@ -508,8 +491,6 @@ def get_multiple_city_air(

Args:
cities (list): A list of cities to get data for.
data_format (str): File format. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
params (List[str], optional): A list of parameters to get data for.
Choose from the following values:
["aqi", "pm2.5", "pm10", "o3", "co", "no2", "so2", "dew", "h",
Expand All @@ -519,8 +500,7 @@ def get_multiple_city_air(
append the data to.

Returns:
pandas.DataFrame: The dataframe containing the data. (If you
selected another data format, this dataframe will be empty)
pandas.DataFrame: The dataframe containing the data.
"""
for city in cities:
try:
Expand Down Expand Up @@ -612,8 +592,6 @@ def get_historical_data(
"""Get historical air quality data for a city

Args:
data_format (str): File format. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
city (str): Name of the city. If given, the argument must be named.
city_id (int): City ID. If given, the argument must be named.
If not given, city argument must not be None.
Expand Down Expand Up @@ -674,14 +652,12 @@ def get_city_forecast(

Args:
city (str): The city to get data for.
data_format (str): File format for data. Defaults to 'df'.
Choose from 'csv', 'json', 'xlsx'.
df (pandas.DataFrame, optional): An existing dataframe to
append the data to.

Returns:
pandas.DataFrame: The dataframe containing the data.
(If you selected another data format, this dataframe will be empty)"""
"""
r = self._make_api_request(f"{self._search_aqi_url}/{city}/?token={self.token}")
data_obj = self._check_and_get_data_obj(r)

Expand Down