huff 1.3.1__py3-none-any.whl → 1.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- huff/gistools.py +2 -2
- huff/models.py +29 -9
- huff/ors.py +2 -2
- huff/osm.py +2 -2
- huff/tests/tests_huff.py +15 -2
- {huff-1.3.1.dist-info → huff-1.3.2.dist-info}/METADATA +9 -2
- {huff-1.3.1.dist-info → huff-1.3.2.dist-info}/RECORD +9 -9
- {huff-1.3.1.dist-info → huff-1.3.2.dist-info}/WHEEL +1 -1
- {huff-1.3.1.dist-info → huff-1.3.2.dist-info}/top_level.txt +0 -0
huff/gistools.py
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# Author: Thomas Wieland
|
5
5
|
# ORCID: 0000-0001-5168-9846
|
6
6
|
# mail: geowieland@googlemail.com
|
7
|
-
# Version: 1.3.
|
8
|
-
# Last update: 2025-05-
|
7
|
+
# Version: 1.3.2
|
8
|
+
# Last update: 2025-05-30 11:06
|
9
9
|
# Copyright (c) 2025 Thomas Wieland
|
10
10
|
#-----------------------------------------------------------------------
|
11
11
|
|
huff/models.py
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# Author: Thomas Wieland
|
5
5
|
# ORCID: 0000-0001-5168-9846
|
6
6
|
# mail: geowieland@googlemail.com
|
7
|
-
# Version: 1.3.
|
8
|
-
# Last update: 2025-05-
|
7
|
+
# Version: 1.3.2
|
8
|
+
# Last update: 2025-05-30 11:06
|
9
9
|
# Copyright (c) 2025 Thomas Wieland
|
10
10
|
#-----------------------------------------------------------------------
|
11
11
|
|
@@ -62,7 +62,7 @@ class CustomerOrigins:
|
|
62
62
|
|
63
63
|
metadata = self.metadata
|
64
64
|
|
65
|
-
print("
|
65
|
+
print("Customer Origins")
|
66
66
|
print("No. locations " + str(metadata["no_points"]))
|
67
67
|
|
68
68
|
if metadata["marketsize_col"] is None:
|
@@ -230,11 +230,8 @@ class SupplyLocations:
|
|
230
230
|
|
231
231
|
metadata = self.metadata
|
232
232
|
|
233
|
-
print("
|
233
|
+
print("Supply Locations")
|
234
234
|
print("No. locations " + str(metadata["no_points"]))
|
235
|
-
|
236
|
-
if metadata["attraction_col"][0] is None or metadata["attraction_col"] == []:
|
237
|
-
print("Attraction column(s) not defined")
|
238
235
|
else:
|
239
236
|
print("Attraction column(s) " + ",".join(metadata["attraction_col"]))
|
240
237
|
|
@@ -443,7 +440,7 @@ class InteractionMatrix:
|
|
443
440
|
customer_origins_metadata = self.get_customer_origins().get_metadata()
|
444
441
|
supply_locations_metadata = self.get_supply_locations().get_metadata()
|
445
442
|
|
446
|
-
print("
|
443
|
+
print("Interaction Matrix")
|
447
444
|
print("----------------------------------")
|
448
445
|
print("Supply locations " + str(supply_locations_metadata["no_points"]))
|
449
446
|
if supply_locations_metadata["attraction_col"][0] is None:
|
@@ -659,7 +656,7 @@ class InteractionMatrix:
|
|
659
656
|
|
660
657
|
return self
|
661
658
|
|
662
|
-
def marketareas
|
659
|
+
def marketareas(self):
|
663
660
|
|
664
661
|
interaction_matrix_df = self.interaction_matrix_df
|
665
662
|
|
@@ -679,6 +676,29 @@ class InteractionMatrix:
|
|
679
676
|
|
680
677
|
return huff_model
|
681
678
|
|
679
|
+
|
680
|
+
def hansen(
|
681
|
+
self,
|
682
|
+
from_origins: bool = True
|
683
|
+
):
|
684
|
+
|
685
|
+
interaction_matrix_df = self.interaction_matrix_df
|
686
|
+
|
687
|
+
if interaction_matrix_df["U_ij"].isna().all():
|
688
|
+
self.utility()
|
689
|
+
interaction_matrix_df = self.interaction_matrix_df
|
690
|
+
|
691
|
+
if from_origins:
|
692
|
+
hansen_df = pd.DataFrame(interaction_matrix_df.groupby("i")["U_ij"].sum()).reset_index()
|
693
|
+
hansen_df = hansen_df.rename(columns = {"U_ij": "A_i"})
|
694
|
+
else:
|
695
|
+
hansen_df = pd.DataFrame(interaction_matrix_df.groupby("j")["U_ij"].sum()).reset_index()
|
696
|
+
hansen_df = hansen_df.rename(columns = {"U_ij": "A_j"})
|
697
|
+
|
698
|
+
return hansen_df
|
699
|
+
|
700
|
+
=======
|
701
|
+
>>>>>>> e9583d0cd7f349f17f005df0fa75e70160655aa3
|
682
702
|
def mci_transformation(
|
683
703
|
self,
|
684
704
|
cols: list = ["A_j", "t_ij"]
|
huff/ors.py
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# Author: Thomas Wieland
|
5
5
|
# ORCID: 0000-0001-5168-9846
|
6
6
|
# mail: geowieland@googlemail.com
|
7
|
-
# Version: 1.3.
|
8
|
-
# Last update: 2025-05-
|
7
|
+
# Version: 1.3.2
|
8
|
+
# Last update: 2025-05-30 11:07
|
9
9
|
# Copyright (c) 2025 Thomas Wieland
|
10
10
|
#-----------------------------------------------------------------------
|
11
11
|
|
huff/osm.py
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# Author: Thomas Wieland
|
5
5
|
# ORCID: 0000-0001-5168-9846
|
6
6
|
# mail: geowieland@googlemail.com
|
7
|
-
# Version: 1.3.
|
8
|
-
# Last update: 2025-05-
|
7
|
+
# Version: 1.3.2
|
8
|
+
# Last update: 2025-05-30 11:07
|
9
9
|
# Copyright (c) 2025 Thomas Wieland
|
10
10
|
#-----------------------------------------------------------------------
|
11
11
|
|
huff/tests/tests_huff.py
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# Author: Thomas Wieland
|
5
5
|
# ORCID: 0000-0001-5168-9846
|
6
6
|
# mail: geowieland@googlemail.com
|
7
|
-
# Version: 1.3.
|
8
|
-
# Last update: 2025-05-
|
7
|
+
# Version: 1.3.2
|
8
|
+
# Last update: 2025-05-30 09:37
|
9
9
|
# Copyright (c) 2025 Thomas Wieland
|
10
10
|
#-----------------------------------------------------------------------
|
11
11
|
|
@@ -102,6 +102,19 @@ interaction_matrix = haslach_interactionmatrix.transport_costs(
|
|
102
102
|
# Obtaining transport costs (default: driving-car)
|
103
103
|
# ORS API documentation: https://openrouteservice.org/dev/#/api-docs/v2/
|
104
104
|
|
105
|
+
interaction_matrix.summary()
|
106
|
+
# Summary of interaction matrix
|
107
|
+
|
108
|
+
print(interaction_matrix.hansen())
|
109
|
+
# Hansen accessibility for interaction matrix
|
110
|
+
|
111
|
+
interaction_matrix = interaction_matrix.flows()
|
112
|
+
# Calculating spatial flows for interaction matrix
|
113
|
+
|
114
|
+
huff_model = interaction_matrix.marketareas()
|
115
|
+
# Calculating total market areas for interaction matrix
|
116
|
+
# Result of class HuffModel
|
117
|
+
|
105
118
|
interaction_matrix = interaction_matrix.flows()
|
106
119
|
# Calculating spatial flows
|
107
120
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: huff
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.2
|
4
4
|
Summary: huff: Huff Model Market Area Analysis
|
5
5
|
Author: Thomas Wieland
|
6
6
|
Author-email: geowieland@googlemail.com
|
@@ -15,6 +15,12 @@ Requires-Dist: matplotlib
|
|
15
15
|
Requires-Dist: pillow
|
16
16
|
Requires-Dist: contextily
|
17
17
|
Requires-Dist: openpyxl
|
18
|
+
Dynamic: author
|
19
|
+
Dynamic: author-email
|
20
|
+
Dynamic: description
|
21
|
+
Dynamic: description-content-type
|
22
|
+
Dynamic: requires-dist
|
23
|
+
Dynamic: summary
|
18
24
|
|
19
25
|
# huff: Huff Model Market Area Analysis
|
20
26
|
|
@@ -49,6 +55,7 @@ See the /tests directory for usage examples of most of the included functions.
|
|
49
55
|
- Spatial join with with statistics
|
50
56
|
- Creating euclidean distance matrix from origins and destinations
|
51
57
|
- Overlay-difference analysis of polygons
|
58
|
+
- Hansen accessibility
|
52
59
|
- **Data management tools**:
|
53
60
|
- Loading own interaction matrix for analysis
|
54
61
|
- Creating origins/destinations objects from point geodata
|
@@ -1,10 +1,10 @@
|
|
1
1
|
huff/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
huff/gistools.py,sha256=
|
3
|
-
huff/models.py,sha256=
|
4
|
-
huff/ors.py,sha256=
|
5
|
-
huff/osm.py,sha256=
|
2
|
+
huff/gistools.py,sha256=Zcckofl4OWueSXZmUHRsbrLvAHZuxeI5Gwh4g7hi2H0,6857
|
3
|
+
huff/models.py,sha256=gSVZims_7TvXr-pzUYAP19fnEtHmr0QmT8LFI_LsIVw,61452
|
4
|
+
huff/ors.py,sha256=hjLJzBBQUP0frF-Aj8aCkOFVeCHc_3rGkJ8srOYIPOE,11929
|
5
|
+
huff/osm.py,sha256=KTJo9NYDNZjDDYp4FKNH0MxMnY9A7kfg12FvCAvpmQw,6858
|
6
6
|
huff/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
huff/tests/tests_huff.py,sha256=
|
7
|
+
huff/tests/tests_huff.py,sha256=iITEaA96WrewlLyC3l8wWPMwVigAgG9OYsHbix7hI0A,7595
|
8
8
|
huff/tests/data/Haslach.cpg,sha256=OtMDH1UDpEBK-CUmLugjLMBNTqZoPULF3QovKiesmCQ,5
|
9
9
|
huff/tests/data/Haslach.dbf,sha256=GVPIt05OzDO7UrRDcsMhiYWvyXAPg6Z-qkiysFzj-fc,506
|
10
10
|
huff/tests/data/Haslach.prj,sha256=2Jy1Vlzh7UxQ1MXpZ9UYLs2SxfrObj2xkEkZyLqmGTY,437
|
@@ -18,7 +18,7 @@ huff/tests/data/Haslach_supermarkets.qmd,sha256=JlcOYzG4vI1NH1IuOpxwIPnJsCyC-pDR
|
|
18
18
|
huff/tests/data/Haslach_supermarkets.shp,sha256=X7QbQ0BTMag_B-bDRbpr-go2BQIXo3Y8zMAKpYZmlps,324
|
19
19
|
huff/tests/data/Haslach_supermarkets.shx,sha256=j23QHX-SmdAeN04rw0x8nUOran-OCg_T6r_LvzzEPWs,164
|
20
20
|
huff/tests/data/Wieland2015.xlsx,sha256=SaVM-Hi5dBTmf2bzszMnZ2Ec8NUE05S_5F2lQj0ayS0,19641
|
21
|
-
huff-1.3.
|
22
|
-
huff-1.3.
|
23
|
-
huff-1.3.
|
24
|
-
huff-1.3.
|
21
|
+
huff-1.3.2.dist-info/METADATA,sha256=cf90Dvp0NVO4ZoUx1uBT90ahuAmKKHloGd_z4ne4-I8,4697
|
22
|
+
huff-1.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
23
|
+
huff-1.3.2.dist-info/top_level.txt,sha256=nlzX-PxZNFmIxANIJMySuIFPihd6qOBkRlhIC28NEsQ,5
|
24
|
+
huff-1.3.2.dist-info/RECORD,,
|
File without changes
|