Skip to content

Commit

Permalink
hotfix for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio9701 committed Sep 20, 2023
1 parent 959788c commit 56c7d43
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
9 changes: 6 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
# sys.path.insert(0, os.path.abspath('../../urbanpy/utils'))
import sphinx_rtd_theme


# -- Project information -----------------------------------------------------

project = "urbanpy"
copyright = "2020, IADB"
copyright = "2023, IADB"
author = "Andres Regal, Claudio Ortega & Antonio Vasquez Brust"

# The full version, including alpha/beta/rc tags
Expand All @@ -38,7 +37,11 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx_rtd_theme", "numpydoc"]
extensions = [
"sphinx.ext.autodoc",
"sphinx_rtd_theme",
"numpydoc",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
6 changes: 0 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ UrbanPy's original authors are Claudio Ortega
(`socials <https://www.linkedin.com/in/claudioortega27/>`__) and Andrés
Regal (`socials <https://www.linkedin.com/in/andrés-regal/>`__).

.. toctree::
:maxdepth: 6
:caption: Contents:

modules

\*Current support is tested on Linux Ubuntu 18.04 & Mac OS Catalina,
coming soon we will test and support Windows 10.

Expand Down
25 changes: 15 additions & 10 deletions urbanpy/download/download.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
from typing import Optional, Tuple, Union
from warnings import warn
import requests

import geopandas as gpd
import pandas as pd
import numpy as np
import osmnx as ox
from shapely.geometry import Polygon, MultiPolygon
import pandas as pd
import requests
from geopandas import GeoDataFrame, GeoSeries
from hdx.api.configuration import Configuration
from hdx.data.dataset import Dataset
from typing import Optional, Union, Tuple
from pandas import DataFrame
from geopandas import GeoDataFrame, GeoSeries
from shapely.geometry import MultiPolygon, Polygon

from urbanpy.utils import (
to_overpass_query,
overpass_to_gdf,
get_hdx_label,
HDX_POPULATION_TYPES,
get_hdx_label,
overpass_to_gdf,
to_overpass_query,
)

__all__ = [
Expand Down Expand Up @@ -176,7 +178,8 @@ def overpass(
'key1': 'v1',
'key2': None
}
mask:
mask: GeoDataFrame, GeoSeries, Polygon or MultiPolygon
Total bounds of mask to be used for the query.
Returns
-------
Expand All @@ -185,6 +188,7 @@ def overpass(
df: DataFrame
Relations metadata such as ID and tags. Returns None if 'type_of_data' other than 'relation'.
"""

minx, miny, maxx, maxy = mask.total_bounds
bbox_string = f"{minx},{miny},{maxx},{maxy}"

Expand Down Expand Up @@ -353,7 +357,6 @@ def get_hdx_dataset(resources_df: DataFrame, ids: Union[int, list]) -> DataFrame
----------
resources_df: pd.DataFrame
Resources dataframe from returned by search_hdx_dataset
ids: int or list
IDs in the resources dataframe
Expand All @@ -373,7 +376,9 @@ def get_hdx_dataset(resources_df: DataFrame, ids: Union[int, list]) -> DataFrame
-18.335694 | -70.387361 | 11.318147 | 12.099885
-18.335417 | -70.394028 | 11.318147 | 12.099885
-18.335139 | -70.394306 | 11.318147 | 12.099885
"""

urls = resources_df.loc[ids, "url"]

if isinstance(ids, list) and len(ids) > 1:
Expand Down
22 changes: 10 additions & 12 deletions urbanpy/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from math import ceil
from typing import Optional, Tuple, Union

import geopandas as gpd
import pandas as pd
import numpy as np
import pandas as pd
from geopandas import GeoDataFrame, GeoSeries
from h3 import h3
from math import ceil
from shapely.geometry import Polygon, MultiPolygon
from pandas import DataFrame
from shapely.geometry import MultiPolygon, Polygon
from shapely.validation import make_valid
from sklearn.neighbors import BallTree
from typing import Optional, Union, Tuple
from pandas import DataFrame
from geopandas import GeoDataFrame, GeoSeries

__all__ = [
"swap_xy",
Expand Down Expand Up @@ -176,22 +177,20 @@ def create_duration_labels(durations):
Parameters
----------
durations: Pandas Series
Series containing trip durations in minutes.
Returns
-------
custom_bins: list
List of numbers with the inputs for the bins parameter of pd.cut function
custom_labels: list
List of numbers with the inputs for the labels parameter of pd.cut function
"""
default_bins = [0, 15, 30, 45, 60, 90, 120]
default_labels = [f"{default_bins[i]}-{default_bins[i+1]}" for i in range(len(default_bins) - 1)]
default_labels = [
f"{default_bins[i]}-{default_bins[i+1]}" for i in range(len(default_bins) - 1)
]
default_labels.append(f">{default_bins[-1]}")

bins_ = default_bins.copy()
Expand Down Expand Up @@ -346,7 +345,6 @@ def overpass_to_gdf(
ov_keys: list. Optional
Unique OSM keys used in Overpass query (e.g. "amenity", "shop", etc) to fill "poi_type" df column.
Returns
-------
gdf: GeoDataFrame
Expand Down

0 comments on commit 56c7d43

Please sign in to comment.