huff 1.3.1__tar.gz → 1.3.3__tar.gz

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.
Files changed (30) hide show
  1. {huff-1.3.1 → huff-1.3.3}/PKG-INFO +19 -2
  2. {huff-1.3.1 → huff-1.3.3}/README.md +1 -0
  3. {huff-1.3.1 → huff-1.3.3}/huff/gistools.py +2 -2
  4. {huff-1.3.1 → huff-1.3.3}/huff/models.py +27 -9
  5. {huff-1.3.1 → huff-1.3.3}/huff/ors.py +2 -2
  6. {huff-1.3.1 → huff-1.3.3}/huff/osm.py +2 -2
  7. {huff-1.3.1 → huff-1.3.3}/huff/tests/tests_huff.py +15 -2
  8. {huff-1.3.1 → huff-1.3.3}/huff.egg-info/PKG-INFO +19 -2
  9. {huff-1.3.1 → huff-1.3.3}/setup.py +1 -1
  10. {huff-1.3.1 → huff-1.3.3}/MANIFEST.in +0 -0
  11. {huff-1.3.1 → huff-1.3.3}/huff/__init__.py +0 -0
  12. {huff-1.3.1 → huff-1.3.3}/huff/tests/__init__.py +0 -0
  13. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.cpg +0 -0
  14. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.dbf +0 -0
  15. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.prj +0 -0
  16. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.qmd +0 -0
  17. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.shp +0 -0
  18. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach.shx +0 -0
  19. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.cpg +0 -0
  20. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.dbf +0 -0
  21. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.prj +0 -0
  22. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.qmd +0 -0
  23. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.shp +0 -0
  24. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Haslach_supermarkets.shx +0 -0
  25. {huff-1.3.1 → huff-1.3.3}/huff/tests/data/Wieland2015.xlsx +0 -0
  26. {huff-1.3.1 → huff-1.3.3}/huff.egg-info/SOURCES.txt +0 -0
  27. {huff-1.3.1 → huff-1.3.3}/huff.egg-info/dependency_links.txt +0 -0
  28. {huff-1.3.1 → huff-1.3.3}/huff.egg-info/requires.txt +0 -0
  29. {huff-1.3.1 → huff-1.3.3}/huff.egg-info/top_level.txt +0 -0
  30. {huff-1.3.1 → huff-1.3.3}/setup.cfg +0 -0
@@ -1,10 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: huff
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: huff: Huff Model Market Area Analysis
5
5
  Author: Thomas Wieland
6
6
  Author-email: geowieland@googlemail.com
7
7
  Description-Content-Type: text/markdown
8
+ Requires-Dist: geopandas
9
+ Requires-Dist: pandas
10
+ Requires-Dist: numpy
11
+ Requires-Dist: statsmodels
12
+ Requires-Dist: shapely
13
+ Requires-Dist: requests
14
+ Requires-Dist: matplotlib
15
+ Requires-Dist: pillow
16
+ Requires-Dist: contextily
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
8
24
 
9
25
  # huff: Huff Model Market Area Analysis
10
26
 
@@ -39,6 +55,7 @@ See the /tests directory for usage examples of most of the included functions.
39
55
  - Spatial join with with statistics
40
56
  - Creating euclidean distance matrix from origins and destinations
41
57
  - Overlay-difference analysis of polygons
58
+ - Hansen accessibility
42
59
  - **Data management tools**:
43
60
  - Loading own interaction matrix for analysis
44
61
  - Creating origins/destinations objects from point geodata
@@ -31,6 +31,7 @@ See the /tests directory for usage examples of most of the included functions.
31
31
  - Spatial join with with statistics
32
32
  - Creating euclidean distance matrix from origins and destinations
33
33
  - Overlay-difference analysis of polygons
34
+ - Hansen accessibility
34
35
  - **Data management tools**:
35
36
  - Loading own interaction matrix for analysis
36
37
  - Creating origins/destinations objects from point geodata
@@ -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.1
8
- # Last update: 2025-05-28 18:01
7
+ # Version: 1.3.3
8
+ # Last update: 2025-06-01 14:30
9
9
  # Copyright (c) 2025 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -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.1
8
- # Last update: 2025-05-28 18:01
7
+ # Version: 1.3.3
8
+ # Last update: 2025-06-01 14:29
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("Huff Model Customer Origins")
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("Huff Model Supply Locations")
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("Huff Model Interaction Matrix")
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 (self):
659
+ def marketareas(self):
663
660
 
664
661
  interaction_matrix_df = self.interaction_matrix_df
665
662
 
@@ -679,6 +676,27 @@ 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
+
682
700
  def mci_transformation(
683
701
  self,
684
702
  cols: list = ["A_j", "t_ij"]
@@ -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.1
8
- # Last update: 2025-05-28 18:01
7
+ # Version: 1.3.3
8
+ # Last update: 2025-06-01 14:30
9
9
  # Copyright (c) 2025 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -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.1
8
- # Last update: 2025-05-28 18:01
7
+ # Version: 1.3.3
8
+ # Last update: 2025-06-01 14:30
9
9
  # Copyright (c) 2025 Thomas Wieland
10
10
  #-----------------------------------------------------------------------
11
11
 
@@ -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.1
8
- # Last update: 2025-05-28 13:10
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,10 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: huff
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: huff: Huff Model Market Area Analysis
5
5
  Author: Thomas Wieland
6
6
  Author-email: geowieland@googlemail.com
7
7
  Description-Content-Type: text/markdown
8
+ Requires-Dist: geopandas
9
+ Requires-Dist: pandas
10
+ Requires-Dist: numpy
11
+ Requires-Dist: statsmodels
12
+ Requires-Dist: shapely
13
+ Requires-Dist: requests
14
+ Requires-Dist: matplotlib
15
+ Requires-Dist: pillow
16
+ Requires-Dist: contextily
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
8
24
 
9
25
  # huff: Huff Model Market Area Analysis
10
26
 
@@ -39,6 +55,7 @@ See the /tests directory for usage examples of most of the included functions.
39
55
  - Spatial join with with statistics
40
56
  - Creating euclidean distance matrix from origins and destinations
41
57
  - Overlay-difference analysis of polygons
58
+ - Hansen accessibility
42
59
  - **Data management tools**:
43
60
  - Loading own interaction matrix for analysis
44
61
  - Creating origins/destinations objects from point geodata
@@ -7,7 +7,7 @@ def read_README():
7
7
 
8
8
  setup(
9
9
  name='huff',
10
- version='1.3.1',
10
+ version='1.3.3',
11
11
  description='huff: Huff Model Market Area Analysis',
12
12
  packages=find_packages(include=["huff", "huff.tests"]),
13
13
  include_package_data=True,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes