From 305a8191a97d5f5de100fdee414bad64d3c93274 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 9 Dec 2023 20:16:43 -0500 Subject: [PATCH] resolve #421 --- spopt/locate/coverage.py | 24 ++++++++++++------------ spopt/locate/p_dispersion.py | 8 ++++---- spopt/locate/p_median.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/spopt/locate/coverage.py b/spopt/locate/coverage.py index 10169cbc..d007cccb 100644 --- a/spopt/locate/coverage.py +++ b/spopt/locate/coverage.py @@ -125,7 +125,7 @@ def from_cost_matrix( predefined_facilities_arr: np.array = None, demand_quantity_arr: np.array = None, facility_capacity_arr: np.array = None, - name: str = "LSCP", + name: str = "lscp", ): """ Create an ``LSCP`` object based on a cost matrix. A capacitated @@ -149,7 +149,7 @@ def from_cost_matrix( Amount of demand at each client location. facility_capacity_arr : numpy.array (default None) Capacity for service at each facility location. - name : str, (default 'LSCP') + name : str, (default 'lscp') The name of the problem. Returns @@ -293,7 +293,7 @@ def from_geodataframe( demand_quantity_col: str = None, facility_capacity_col: str = None, distance_metric: str = "euclidean", - name: str = "LSCP", + name: str = "lscp", ): """ Create an ``LSCP`` object from ``geopandas.GeoDataFrame`` objects. @@ -328,7 +328,7 @@ def from_geodataframe( distance_metric : str (default 'euclidean') A metric used for the distance calculations supported by `scipy.spatial.distance.cdist `_. - name : str (default 'LSCP') + name : str (default 'lscp') The name of the problem. Returns @@ -613,7 +613,7 @@ def from_cost_matrix( service_radius: float, solver: pulp.LpSolver, predefined_facilities_arr: np.array = None, - name: str = "LSCP-B", + name: str = "lscp-b", ): """ Create an ``LSCPB`` object based on a cost matrix. @@ -632,7 +632,7 @@ def from_cost_matrix( solution. For example, consider 3 facilites ``['A', 'B', 'C']``. If facility ``'B'`` must be in the model solution, then the passed in array should be ``[0, 1, 0]``. - name : str (default 'LSCP-B') + name : str (default 'lscp-b') The problem name. Returns @@ -753,7 +753,7 @@ def from_geodataframe( solver: pulp.LpSolver, predefined_facility_col: str = None, distance_metric: str = "euclidean", - name: str = "LSCP-B", + name: str = "lscp-b", ): """ @@ -784,7 +784,7 @@ def from_geodataframe( distance_metric : str (default 'euclidean') A metric used for the distance calculations supported by `scipy.spatial.distance.cdist `_. - name : str (default 'LSCP') + name : str (default 'lscp-b') The name of the problem. Returns @@ -1050,7 +1050,7 @@ def from_cost_matrix( service_radius: float, p_facilities: int, predefined_facilities_arr: np.array = None, - name: str = "MCLP", + name: str = "mclp", ): """ Create a ``MCLP`` object based on cost matrix. @@ -1071,7 +1071,7 @@ def from_cost_matrix( solution. For example, consider 3 facilites ``['A', 'B', 'C']``. If facility ``'B'`` must be in the model solution, then the passed in array should be ``[0, 1, 0]``. - name : str (default 'MCLP') + name : str (default 'mclp') The problem name. Returns @@ -1194,7 +1194,7 @@ def from_geodataframe( p_facilities: int, predefined_facility_col: str = None, distance_metric: str = "euclidean", - name: str = "MCLP", + name: str = "mclp", ): """ @@ -1227,7 +1227,7 @@ def from_geodataframe( distance_metric : str (default 'euclidean') A metric used for the distance calculations supported by `scipy.spatial.distance.cdist `_. - name : str (default 'MCLP') + name : str (default 'mclp') The name of the problem. Returns diff --git a/spopt/locate/p_dispersion.py b/spopt/locate/p_dispersion.py index bd67f7ee..247d4909 100644 --- a/spopt/locate/p_dispersion.py +++ b/spopt/locate/p_dispersion.py @@ -79,7 +79,7 @@ def from_cost_matrix( cost_matrix: np.array, p_facilities: int, predefined_facilities_arr: np.array = None, - name: str = "P-Dispersion", + name: str = "p-dispersion", ): """ Create a ``PDispersion`` object based on a cost matrix. @@ -96,7 +96,7 @@ def from_cost_matrix( solution. For example, consider 3 facilites ``['A', 'B', 'C']``. If facility ``'B'`` must be in the model solution, then the passed in array should be ``[0, 1, 0]``. - name : str (default 'P-Dispersion') + name : str (default 'p-dispersion') The name of the problem. Returns @@ -197,7 +197,7 @@ def from_geodataframe( p_facilities: int, predefined_facility_col: str = None, distance_metric: str = "euclidean", - name: str = "P-Dispersion", + name: str = "p-dispersion", ): """ Create a ``PDispersion`` object based on a geodataframe. Calculate the @@ -220,7 +220,7 @@ def from_geodataframe( distance_metric : str (default 'euclidean') A metric used for the distance calculations supported by `scipy.spatial.distance.cdist `_. - name : str (default 'P-Dispersion') + name : str (default 'p-dispersion') The name of the problem. Returns diff --git a/spopt/locate/p_median.py b/spopt/locate/p_median.py index 91a56814..7876b047 100644 --- a/spopt/locate/p_median.py +++ b/spopt/locate/p_median.py @@ -638,7 +638,7 @@ def __init__( p_facilities: int, capacities: np.array = None, distance_metric: str = "euclidean", - name="k-nearest p median", + name="k-nearest-p-median", ): self.ai_sum = weights_sum self.clients = clients