scgraph 3.4.0__tar.gz → 3.4.1__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 (27) hide show
  1. scgraph-3.4.1/CMakeLists.txt +91 -0
  2. {scgraph-3.4.0 → scgraph-3.4.1}/PKG-INFO +2 -2
  3. {scgraph-3.4.0 → scgraph-3.4.1}/pyproject.toml +10 -2
  4. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/utils.py +5 -1
  5. scgraph-3.4.0/CMakeLists.txt +0 -83
  6. {scgraph-3.4.0 → scgraph-3.4.1}/LICENSE +0 -0
  7. {scgraph-3.4.0 → scgraph-3.4.1}/README.md +0 -0
  8. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/__init__.py +0 -0
  9. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/contraction_hierarchies.py +0 -0
  10. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/bindings/graph_bindings.cpp +0 -0
  11. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/bmssp.hpp +0 -0
  12. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/contraction_hierarchies.cpp +0 -0
  13. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/contraction_hierarchies.hpp +0 -0
  14. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/graph.cpp +0 -0
  15. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/graph.hpp +0 -0
  16. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/graph_utils.cpp +0 -0
  17. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/graph_utils.hpp +0 -0
  18. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/transit_node_routing.cpp +0 -0
  19. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/cpp/src/transit_node_routing.hpp +0 -0
  20. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/geograph.py +0 -0
  21. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/graph.py +0 -0
  22. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/graph_utils.py +0 -0
  23. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/grid.py +0 -0
  24. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/helpers/__init__.py +0 -0
  25. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/helpers/geojson.py +0 -0
  26. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/helpers/visvalingam.py +0 -0
  27. {scgraph-3.4.0 → scgraph-3.4.1}/scgraph/transit_node_routing.py +0 -0
@@ -0,0 +1,91 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+
3
+ # -----------------------------
4
+ # Define The Project
5
+ # -----------------------------
6
+ project(scgraph LANGUAGES NONE)
7
+
8
+ # -----------------------------
9
+ # Build Options
10
+ # -----------------------------
11
+ option(SKIP_CPP_BUILD "Skip C++ extension module building" OFF)
12
+
13
+ # -----------------------------
14
+ # C++ detection
15
+ # -----------------------------
16
+ if(NOT SKIP_CPP_BUILD)
17
+ include(CheckLanguage)
18
+ check_language(CXX)
19
+
20
+ if(CMAKE_CXX_COMPILER)
21
+ enable_language(CXX OPTIONAL)
22
+ endif()
23
+ endif()
24
+
25
+
26
+ if(SKIP_CPP_BUILD)
27
+
28
+ message(STATUS
29
+ "C++ build skipped. Using pure python version. Performance will be reduced."
30
+ )
31
+
32
+ elseif(NOT CMAKE_CXX_COMPILER_LOADED)
33
+
34
+ message(WARNING
35
+ "No usable C++ compiler detected. Using pure python version. Performance will be reduced."
36
+ )
37
+
38
+ else()
39
+
40
+ # -----------------------------
41
+ # Find Packages
42
+ # -----------------------------
43
+ find_package(Python 3.10 COMPONENTS Interpreter Development.Module QUIET)
44
+ find_package(nanobind CONFIG QUIET)
45
+
46
+ if(Python_FOUND AND nanobind_FOUND)
47
+ message(STATUS
48
+ "C++ compiler detected: Building compiled extension."
49
+ )
50
+
51
+ # -----------------------------
52
+ # Set C++ standard
53
+ # -----------------------------
54
+ set(CMAKE_CXX_STANDARD 20)
55
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
56
+
57
+ # -----------------------------
58
+ # OPTIMIZATION FLAGS
59
+ # -----------------------------
60
+ set(CMAKE_BUILD_TYPE Release)
61
+ if(MSVC)
62
+ set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
63
+ else()
64
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
65
+ endif()
66
+
67
+ # -----------------------------
68
+ # Graph module
69
+ # -----------------------------
70
+ nanobind_add_module(cpp
71
+ STABLE_ABI
72
+ scgraph/cpp/bindings/graph_bindings.cpp
73
+ scgraph/cpp/src/graph.cpp
74
+ scgraph/cpp/src/graph_utils.cpp
75
+ scgraph/cpp/src/contraction_hierarchies.cpp
76
+ scgraph/cpp/src/transit_node_routing.cpp
77
+ )
78
+
79
+ install(TARGETS cpp DESTINATION scgraph)
80
+ else()
81
+ message(WARNING
82
+ "Python development headers or nanobind not found. Using pure python version. Performance will be reduced."
83
+ )
84
+ endif()
85
+
86
+ endif()
87
+
88
+ # -----------------------------
89
+ # Install Python package files
90
+ # -----------------------------
91
+ install(DIRECTORY scgraph DESTINATION . FILES_MATCHING PATTERN "*.py")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scgraph
3
- Version: 3.4.0
3
+ Version: 3.4.1
4
4
  Summary: Determine an approximate distance and route between two points on earth.
5
5
  Author-Email: Connor Makowski <conmak@mit.edu>
6
6
  License-Expression: MIT
@@ -11,7 +11,7 @@ Project-URL: Homepage, https://github.com/connor-makowski/scgraph
11
11
  Project-URL: Bug Tracker, https://github.com/connor-makowski/scgraph/issues
12
12
  Project-URL: Documentation, https://connor-makowski.github.io/scgraph/scgraph.html
13
13
  Requires-Python: >=3.11
14
- Requires-Dist: geokdtree==1.2.3
14
+ Requires-Dist: geokdtree==1.2.4
15
15
  Requires-Dist: bmsspy<3.0.0,>=2.2.1
16
16
  Requires-Dist: requests<3.0.0,>=2.32.0
17
17
  Provides-Extra: dev
@@ -11,6 +11,10 @@ build-backend = "scikit_build_core.build"
11
11
  build.verbose = false
12
12
  build-dir = "build/{wheel_tag}"
13
13
 
14
+ [[tool.scikit-build.overrides]]
15
+ if.failed = true
16
+ wheel.cmake = false
17
+
14
18
  [tool.scikit-build.sdist]
15
19
  exclude = ["*"]
16
20
  include = [
@@ -26,7 +30,7 @@ include = [
26
30
 
27
31
  [project]
28
32
  name = "scgraph"
29
- version = "3.4.0"
33
+ version = "3.4.1"
30
34
  description = "Determine an approximate distance and route between two points on earth."
31
35
  authors = [
32
36
  {name="Connor Makowski", email="conmak@mit.edu"}
@@ -39,7 +43,11 @@ classifiers = [
39
43
  "Programming Language :: C++",
40
44
  "Operating System :: OS Independent",
41
45
  ]
42
- dependencies = ["geokdtree==1.2.3","bmsspy>=2.2.1,<3.0.0","requests>=2.32.0,<3.0.0"]
46
+ dependencies = [
47
+ "geokdtree==1.2.4",
48
+ "bmsspy>=2.2.1,<3.0.0",
49
+ "requests>=2.32.0,<3.0.0"
50
+ ]
43
51
 
44
52
  [project.optional-dependencies]
45
53
  dev = [
@@ -346,6 +346,8 @@ def time_test(name, function, args=None, kwargs=None):
346
346
 
347
347
  def has_cpp():
348
348
  try:
349
+ from scgraph.cpp import Graph # noqa: F401
350
+
349
351
  return True
350
352
  except ImportError:
351
353
  return False
@@ -353,8 +355,10 @@ def has_cpp():
353
355
 
354
356
  def cpp_check():
355
357
  try:
358
+ from scgraph.cpp import Graph # noqa: F401
359
+
356
360
  print("Using C++ & Python implementation of SCGraph.")
357
- except:
361
+ except ImportError:
358
362
  print("Using Pure Python implementation of SCGraph.")
359
363
 
360
364
 
@@ -1,83 +0,0 @@
1
- cmake_minimum_required(VERSION 3.15)
2
-
3
- # -----------------------------
4
- # Define The Project
5
- # -----------------------------
6
- project(scgraph LANGUAGES NONE)
7
-
8
- # -----------------------------
9
- # Build Options
10
- # -----------------------------
11
- option(SKIP_CPP_BUILD "Skip C++ extension module building" OFF)
12
-
13
- # -----------------------------
14
- # C++ detection
15
- # -----------------------------
16
- include(CheckLanguage)
17
- check_language(CXX)
18
-
19
- if(CMAKE_CXX_COMPILER)
20
- enable_language(CXX)
21
- endif()
22
-
23
-
24
- if(SKIP_CPP_BUILD)
25
-
26
- message(STATUS
27
- "C++ build skipped. Using pure python version. Performance will be reduced."
28
- )
29
-
30
- elseif(NOT CMAKE_CXX_COMPILER_LOADED)
31
-
32
- message(WARNING
33
- "No usable C++ compiler detected. Using pure python version. Performance will be reduced."
34
- )
35
-
36
- else()
37
-
38
- message(STATUS
39
- "C++ compiler detected: Building compiled extension."
40
- )
41
-
42
- # -----------------------------
43
- # Set C++ standard
44
- # -----------------------------
45
- set(CMAKE_CXX_STANDARD 20)
46
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
47
-
48
- # -----------------------------
49
- # OPTIMIZATION FLAGS
50
- # -----------------------------
51
- set(CMAKE_BUILD_TYPE Release)
52
- if(MSVC)
53
- set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
54
- else()
55
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
56
- endif()
57
-
58
- # -----------------------------
59
- # Find Packages
60
- # -----------------------------
61
- find_package(Python 3.10 COMPONENTS Interpreter Development REQUIRED)
62
-
63
- # -----------------------------
64
- # Add nanobind
65
- # -----------------------------
66
- find_package(nanobind CONFIG REQUIRED)
67
-
68
- # -----------------------------
69
- # Graph module
70
- # -----------------------------
71
- nanobind_add_module(cpp
72
- STABLE_ABI
73
- scgraph/cpp/bindings/graph_bindings.cpp
74
- scgraph/cpp/src/graph.cpp
75
- scgraph/cpp/src/graph_utils.cpp
76
- scgraph/cpp/src/contraction_hierarchies.cpp
77
- scgraph/cpp/src/transit_node_routing.cpp
78
- )
79
-
80
-
81
- install(TARGETS cpp DESTINATION scgraph)
82
-
83
- endif()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes