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

doc work and formatting continued (random_region, util, ward) #307

Merged
merged 9 commits into from
Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions spopt/region/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Base classes for spopt/region"""
"""Base classes and functions for spopt/region"""

import libpysal
import numpy
Expand Down Expand Up @@ -205,7 +205,7 @@ def _closest(data, centroids):


def _seeds(areas, k, seed):
"""Randomly select `k` seeds from a sequence of areas.
"""Randomly select ``k`` seeds from a sequence of areas.

Parameters
----------
Expand Down Expand Up @@ -237,7 +237,7 @@ def is_neighbor(area, region, w):
----------

area : int, numpy.int64
Area label
The area label.
region : list
Region members.
w : libpysal.weights.W
Expand Down Expand Up @@ -265,16 +265,16 @@ def infeasible_components(gdf, w, threshold_var, threshold):
Parameters
----------

gdf : geopandas.GeoDataFrame, required
gdf : geopandas.GeoDataFrame
Geodataframe containing original data.
w : libpysal.weights.W, required
w : libpysal.weights.W
Weights object created from given data.
attrs_name : list, required
attrs_name : list
Strings for attribute names to measure similarity
(cols of ``geopandas.GeoDataFrame``).
threshold_var : string, requied
threshold_var : str
The name of the spatial extensive attribute variable.
threshold : {int, float}, required
threshold : {int, float}
The threshold value.

Returns
Expand Down Expand Up @@ -334,8 +334,8 @@ def modify_components(gdf, w, threshold_var, threshold, policy="single"):
The name of the spatial extensive attribute variable.
threshold : {int, float}
The threshold value.
policy: str
``'single'`` (default) will attach an infeasible component to a feasible
policy: str (default 'single')
``'single'`` will attach an infeasible component to a feasible
component based on a single join using the minimum nearest
neighbor distance between areas of infeasible components and
areas in the largest component. ``'multiple'`` will form a join
Expand Down Expand Up @@ -393,12 +393,12 @@ def form_single_component(gdf, w, linkage="single"):
w : libysal.weights.W
PySAL weights object.
linkage : str
`single`: a small component will be joined with the largest
component by adding a single join based on minimum nearest
neighbor relation between areas in the small component and
the largest component. 'multiple': joins are added between each
area in the small component and their nearest neighbor in the
largest component.
`single`: a small component will be joined with the largest
component by adding a single join based on minimum nearest
neighbor relation between areas in the small component and
the largest component. 'multiple': joins are added between each
area in the small component and their nearest neighbor in the
largest component.

Returns
-------
Expand Down
Loading