From 63494006161e97e181caf38b370bdf2cda2a137d Mon Sep 17 00:00:00 2001 From: mgcooper Date: Tue, 7 Nov 2023 10:27:17 -0800 Subject: [PATCH 01/15] fix(data.rst): Add space after :: so recommended input directory tree renders. --- docs/source/data/data.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/source/data/data.rst b/docs/source/data/data.rst index f545e49..9fd3b2a 100644 --- a/docs/source/data/data.rst +++ b/docs/source/data/data.rst @@ -230,15 +230,16 @@ Inputs The following recommended workspace structure and example input files are provided to run a PyFlowline simulation. Although the repo includes example configuration files in the examples/ directory, they can be placed wherever the user prefers, as long as the paths within them point to the correct locations for input (and output) data. :: - data - └── - ├── input - │ ├── boundary_wgs.geojson - │ ├── flowline.geojson - │ ├── pyflowline__.json - │ └── pyflowline__basins.json - └── output - └── ... + + data + └── + ├── input + │ ├── boundary_wgs.geojson + │ ├── flowline.geojson + │ ├── pyflowline__.json + │ └── pyflowline__basins.json + └── output + └── ... ============================== Outputs From 1613e74b26130f39aaf421dc198c9f43a9ca6419 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Wed, 29 Nov 2023 21:31:11 -0800 Subject: [PATCH 02/15] rebuild dep to pyearth --- .../auxiliary/calculate_area_of_difference.py | 5 +- .../algorithms/auxiliary/longlat_to_3d.py | 9 - .../temp.linux-x86_64-cpython-311/kernel.o | Bin 129240 -> 152264 bytes pyflowline/algorithms/cython/kernel.cpp | 48 +- pyflowline/algorithms/cython/kernel.pyx | 2 +- .../intersect/intersect_flowline_with_mesh.py | 11 +- pyflowline/classes/_visual.py | 8 +- pyflowline/classes/_visual_basin.py | 8 +- pyflowline/classes/basin.py | 7 +- pyflowline/classes/confluence.py | 2 +- pyflowline/classes/dggrid.py | 2 +- pyflowline/classes/edge.py | 5 +- pyflowline/classes/hexagon.py | 2 +- pyflowline/classes/latlon.py | 2 +- pyflowline/classes/mpas.py | 2 +- pyflowline/classes/pycase.py | 60 +- pyflowline/classes/square.py | 2 +- pyflowline/classes/vertex.py | 6 +- .../pyearth/gis/gdal/gdal_functions.py | 512 ------------------ .../pyearth/gis/kml/convert_geojson_to_kml.py | 39 -- .../pyearth/system/define_global_variables.py | 61 --- .../pyearth/toolbox/math/stat/remap.py | 29 - .../toolbox/reader/text_reader_string.py | 167 ------ .../animate/animate_vector_polygon_data.py | 279 ---------- .../pyearth/visual/choose_line_width.py | 12 - .../visual/map/map_multiple_vector_data.py | 502 ----------------- .../visual/map/map_vector_polygon_data.py | 355 ------------ .../visual/map/map_vector_polyline_data.py | 317 ----------- pyflowline/formats/convert_coordinates.py | 8 +- pyflowline/formats/read_mesh.py | 2 +- pyflowline/mesh/dggrid/create_dggrid_mesh.py | 4 +- .../mesh/hexagon/create_hexagon_mesh.py | 2 +- pyflowline/mesh/mpas/create_mpas_mesh.py | 2 +- pyflowline/mesh/square/create_square_mesh.py | 2 +- pyflowline/mesh/tin/create_tin_mesh.py | 2 +- 35 files changed, 106 insertions(+), 2370 deletions(-) delete mode 100644 pyflowline/algorithms/auxiliary/longlat_to_3d.py delete mode 100644 pyflowline/external/pyearth/gis/gdal/gdal_functions.py delete mode 100644 pyflowline/external/pyearth/gis/kml/convert_geojson_to_kml.py delete mode 100644 pyflowline/external/pyearth/system/define_global_variables.py delete mode 100644 pyflowline/external/pyearth/toolbox/math/stat/remap.py delete mode 100644 pyflowline/external/pyearth/toolbox/reader/text_reader_string.py delete mode 100644 pyflowline/external/pyearth/visual/animate/animate_vector_polygon_data.py delete mode 100644 pyflowline/external/pyearth/visual/choose_line_width.py delete mode 100644 pyflowline/external/pyearth/visual/map/map_multiple_vector_data.py delete mode 100644 pyflowline/external/pyearth/visual/map/map_vector_polygon_data.py delete mode 100644 pyflowline/external/pyearth/visual/map/map_vector_polyline_data.py diff --git a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py index 10e8657..f9b0b82 100644 --- a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py +++ b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py @@ -4,8 +4,9 @@ import importlib from pyflowline.algorithms.auxiliary.find_index_in_list import find_list_in_list -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_angle_betwen_vertex_normal -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area + +from pyearth.gis.geometry.calculate_angle_betwen_vertex_normal import calculate_angle_betwen_vertex_normal +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: diff --git a/pyflowline/algorithms/auxiliary/longlat_to_3d.py b/pyflowline/algorithms/auxiliary/longlat_to_3d.py deleted file mode 100644 index d57806c..0000000 --- a/pyflowline/algorithms/auxiliary/longlat_to_3d.py +++ /dev/null @@ -1,9 +0,0 @@ -import numpy as np -from math import cos, sin, sqrt, acos -def longlat_to_3d(lonr, latr): - """Convert a point given latitude and longitude in radians to - 3-dimensional space, assuming a sphere radius of one.""" - a = cos(latr) * cos(lonr) - b = cos(latr) * sin(lonr) - c = sin(latr) - return np.array((a,b,c)) \ No newline at end of file diff --git a/pyflowline/algorithms/cython/build/temp.linux-x86_64-cpython-311/kernel.o b/pyflowline/algorithms/cython/build/temp.linux-x86_64-cpython-311/kernel.o index b7ff7eb60962706e4ae36700dca41b503455f210..f7398f3778f3cd61b671383d14a12055b518a688 100644 GIT binary patch literal 152264 zcmdSC34B!5`97XV)VTG=9WCnAjv6;4E-e9t#w5h!w#;93n*4_Ddsxhf(nR*{GaDN=iGZ|k^r_}`}fD^L*|}y&+?vk zKkr%YRTZ(*w#(1YGyn4QPR{dFCO0o{N@P1PQ6^7ic@=r(Qnm}ytaG6L4e8%Q^>4BM zJwpE;rGLBX-){Q%Sp9pv{{4;q?XG`&=-(6ZYyL%?uOf{t`4fjkD;GLn*|R<>DD7tz zPX1j*vN`^{l69Hgt%Dj^_KMP`vH6kGudY0-+?jRw*UrLOEeGWR!haK z!qPXdTpDqjQS7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0kU!0+QoFnzie>qTo;U1R1DNuezhVpx7DF2H< z`9t@x{7(Yq&&^PNL5A{=l7T 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_distance_based_on_lon_lat") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_distance_based_on_longitude_latitude") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -1823,29 +1823,29 @@ static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_lon_lat(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_lon_lat", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("kernel.calculate_distance_based_on_lon_lat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_calculate_distance_based_on_lon_lat(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in); + __pyx_r = __pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_lon_lat(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in) { +static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_distance_based_on_lon_lat", 0); + __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_calculate_distance_based_on_lon_lat(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1854,7 +1854,7 @@ static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_lon_lat(CYTHON_UNU /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.calculate_distance_based_on_lon_lat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5633,7 +5633,7 @@ static std::vector __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) { } static PyMethodDef __pyx_methods[] = { - {"calculate_distance_based_on_lon_lat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_1calculate_distance_based_on_lon_lat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_calculate_distance_based_on_lon_lat}, + {"calculate_distance_based_on_longitude_latitude", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_calculate_distance_based_on_longitude_latitude}, {"convert_360_to_180", (PyCFunction)__pyx_pw_6kernel_3convert_360_to_180, METH_O, __pyx_doc_6kernel_2convert_360_to_180}, {"find_vertex_in_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_5find_vertex_in_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_4find_vertex_in_list}, {"find_vertex_on_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_7find_vertex_on_edge, METH_VARARGS|METH_KEYWORDS, 0}, diff --git a/pyflowline/algorithms/cython/kernel.pyx b/pyflowline/algorithms/cython/kernel.pyx index f83861c..6a6e6c0 100644 --- a/pyflowline/algorithms/cython/kernel.pyx +++ b/pyflowline/algorithms/cython/kernel.pyx @@ -14,7 +14,7 @@ cdef double pi = 3.14159265358979323846264338327 cdef double dRadius = 6378137.0 @cython.boundscheck(False) # deactivate bnds checking -cpdef calculate_distance_based_on_lon_lat(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): +cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): """ Calculate the great circle distance between two points on the earth (specified in decimal degrees) diff --git a/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py b/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py index 6eaabb5..0b21e0b 100644 --- a/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py +++ b/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py @@ -7,7 +7,7 @@ from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_flowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords +from pyearth.gis.location.get_geometry_coordinates import get_geometry_coordinates iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -78,7 +78,7 @@ def intersect_flowline_with_mesh(iMesh_type_in, sFilename_mesh_in, sFilename_flo for j in range (nfeature_mesh): pFeature_mesh = pLayer_mesh.GetFeature(j) pGeometry_mesh = pFeature_mesh.GetGeometryRef() - aCoords_gcs = get_geometry_coords(pGeometry_mesh) + aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) lCellID = pFeature_mesh.GetField("cellid") dLon = pFeature_mesh.GetField("longitude") dLat = pFeature_mesh.GetField("latitude") @@ -187,11 +187,8 @@ def intersect_flowline_with_mesh(iMesh_type_in, sFilename_mesh_in, sFilename_flo else: for pFeature_mesh in pLayer_mesh: - pGeometry_mesh = pFeature_mesh.GetGeometryRef() - #dummy0 = loads( pGeometry_mesh.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_mesh) + pGeometry_mesh = pFeature_mesh.GetGeometryRef() + aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) lCellID = pFeature_mesh.GetField("cellid") dLon = pFeature_mesh.GetField("longitude") diff --git a/pyflowline/classes/_visual.py b/pyflowline/classes/_visual.py index 46d57ad..618fe04 100644 --- a/pyflowline/classes/_visual.py +++ b/pyflowline/classes/_visual.py @@ -1,9 +1,9 @@ import os -from pathlib import Path + #dependency packages -from pyflowline.external.pyearth.visual.map.map_vector_polygon_data import map_vector_polygon_data -from pyflowline.external.pyearth.visual.map.map_vector_polyline_data import map_vector_polyline_data -from pyflowline.external.pyearth.visual.map.map_multiple_vector_data import map_multiple_vector_data +from pyearth.visual.map.vector.map_vector_polygon_data import map_vector_polygon_data +from pyearth.visual.map.vector.map_vector_polyline_data import map_vector_polyline_data +from pyearth.visual.map.vector.map_multiple_vector_data import map_multiple_vector_data #plot function diff --git a/pyflowline/classes/_visual_basin.py b/pyflowline/classes/_visual_basin.py index 57bfd8e..7576fee 100644 --- a/pyflowline/classes/_visual_basin.py +++ b/pyflowline/classes/_visual_basin.py @@ -1,9 +1,9 @@ import os -from pathlib import Path + #dependency packages -from pyflowline.external.pyearth.visual.map.map_vector_polygon_data import map_vector_polygon_data -from pyflowline.external.pyearth.visual.map.map_vector_polyline_data import map_vector_polyline_data -from pyflowline.external.pyearth.visual.map.map_multiple_vector_data import map_multiple_vector_data +from pyearth.visual.map.vector.map_vector_polygon_data import map_vector_polygon_data +from pyearth.visual.map.vector.map_vector_polyline_data import map_vector_polyline_data +from pyearth.visual.map.vector.map_multiple_vector_data import map_multiple_vector_data def replace_last_occurrence(sFilename_path_in, sSubstring_in, sSubstring_out): last_occurrence_index = sFilename_path_in.rfind(sSubstring_in) diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index d83e769..ac6d2a0 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -17,7 +17,7 @@ from pyflowline.formats.convert_flowline_to_geojson import convert_flowline_to_geojson from pyflowline.formats.export_flowline import export_flowline_to_geojson from pyflowline.formats.export_vertex import export_vertex_to_geojson -from pyflowline.external.pyearth.toolbox.reader.text_reader_string import text_reader_string +from pyearth.toolbox.reader.text_reader_string import text_reader_string iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.external.tinyr.tinyr.tinyr import RTree @@ -52,7 +52,8 @@ iFlag_kml = importlib.util.find_spec("simplekml") if iFlag_kml is not None: - from pyflowline.external.pyearth.gis.kml.convert_geojson_to_kml import convert_geojson_to_kml + #from pyearth.gis.kml.convert_geojson_to_kml import convert_geojson_to_kml + pass else: pass sys.setrecursionlimit(10000) @@ -968,7 +969,7 @@ def basin_export(self): sFilename_conceptual = self.sFilename_flowline_conceptual sFilename_conceptual_kml = self.sFilename_flowline_conceptual_kml - convert_geojson_to_kml(sFilename_conceptual, sFilename_conceptual_kml) + #convert_geojson_to_kml(sFilename_conceptual, sFilename_conceptual_kml) return diff --git a/pyflowline/classes/confluence.py b/pyflowline/classes/confluence.py index 81bccf1..21b80b9 100644 --- a/pyflowline/classes/confluence.py +++ b/pyflowline/classes/confluence.py @@ -9,7 +9,7 @@ if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import calculate_angle_betwen_vertex else: - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_angle_betwen_vertex + from pyearth.gis.geometry.calculate_angle_betwen_vertex import calculate_angle_betwen_vertex class ConfluenceClassEncoder(JSONEncoder): """Confluence Class Encoder diff --git a/pyflowline/classes/dggrid.py b/pyflowline/classes/dggrid.py index 4999bbf..1f83fb7 100644 --- a/pyflowline/classes/dggrid.py +++ b/pyflowline/classes/dggrid.py @@ -5,7 +5,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.cell import pycell from pyflowline.classes.flowline import pyflowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area class DggridClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/edge.py b/pyflowline/classes/edge.py index 8616f10..932aaaa 100644 --- a/pyflowline/classes/edge.py +++ b/pyflowline/classes/edge.py @@ -11,8 +11,9 @@ from pyflowline.algorithms.cython.kernel import calculate_angle_betwen_vertex from pyflowline.algorithms.cython.kernel import calculate_distance_to_plane else: - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_angle_betwen_vertex - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_distance_to_plane + from pyearth.gis.geometry.calculate_angle_betwen_vertex import calculate_angle_betwen_vertex + from pyearth.gis.geometry.calculate_distance_to_plane import calculate_distance_to_plane + class EdgeClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/hexagon.py b/pyflowline/classes/hexagon.py index 0cce22d..3e15b09 100644 --- a/pyflowline/classes/hexagon.py +++ b/pyflowline/classes/hexagon.py @@ -5,7 +5,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.cell import pycell from pyflowline.classes.flowline import pyflowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area class HexagonClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/latlon.py b/pyflowline/classes/latlon.py index 3f668fb..96c1429 100644 --- a/pyflowline/classes/latlon.py +++ b/pyflowline/classes/latlon.py @@ -6,7 +6,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.cell import pycell from pyflowline.classes.flowline import pyflowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area class LatlonClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/mpas.py b/pyflowline/classes/mpas.py index 672d2eb..5edf9d0 100644 --- a/pyflowline/classes/mpas.py +++ b/pyflowline/classes/mpas.py @@ -7,7 +7,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.cell import pycell from pyflowline.classes.flowline import pyflowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area class MpasClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 2ff085b..4cba971 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -9,7 +9,7 @@ import numpy as np from osgeo import ogr, osr, gdal -from pyflowline.external.pyearth.system.define_global_variables import * +from pyearth.system.define_global_variables import * from pyflowline.classes.timer import pytimer from pyflowline.classes.mpas import pympas from pyflowline.classes.hexagon import pyhexagon @@ -21,18 +21,17 @@ from pyflowline.classes.flowline import pyflowline from pyflowline.classes.edge import pyedge from pyflowline.formats.read_mesh import read_mesh_json, read_mesh_json_w_topology -from pyflowline.external.pyearth.gis.gdal.gdal_functions import reproject_coordinates -from pyflowline.external.pyearth.gis.gdal.gdal_functions import degree_to_meter -from pyflowline.external.pyearth.gis.gdal.gdal_functions import meter_to_degree -from pyflowline.external.pyearth.gis.gdal.gdal_functions import retrieve_geotiff_metadata -from pyflowline.external.pyearth.gis.gdal.gdal_functions import read_mesh_boundary -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_utm_spatial_reference + + +from pyearth.gis.spatialref.reproject_coodinates import reproject_coordinates +from pyearth.gis.spatialref.conversion_between_degree_and_meter import degree_to_meter +from pyearth.gis.spatialref.conversion_between_degree_and_meter import meter_to_degree +from pyearth.gis.gdal.read.raster.gdal_read_geotiff_file import gdal_read_geotiff_file +from pyearth.gis.gdal.read.vector.gdal_read_geojson_boundary import gdal_read_geojson_boundary +from pyearth.gis.spatialref.get_utm_spatial_reference import get_utm_spatial_reference iFlag_kml = importlib.util.find_spec("simplekml") -if iFlag_kml is not None: - from pyflowline.external.pyearth.gis.kml.convert_geojson_to_kml import convert_geojson_to_kml -else: - pass + iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -513,7 +512,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): if iFlag_mesh_boundary ==1: #create a polygon based on real boundary - pBoundary_wkt, aExtent = read_mesh_boundary(self.sFilename_mesh_boundary) + pBoundary_wkt, aExtent = gdal_read_geojson_boundary(self.sFilename_mesh_boundary) if iMesh_type != 4: #not mpas spatial_reference_target = osr.SpatialReference() @@ -521,8 +520,18 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): #check whether DEM exists if os.path.isfile(sFilename_dem): - dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, pSpatialRef_dem, pProjection, pGeotransform\ - = retrieve_geotiff_metadata(sFilename_dem) + #dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, pSpatialRef_dem, pProjection, pGeotransform\ + # = retrieve_geotiff_metadata(sFilename_dem) + dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) + dPixelWidth = dummy['pixelWidth'] + pPixelHeight = dummy['pixelHeight'] + dOriginX = dummy['originX'] + dOriginY = dummy['originY'] + nrow = dummy['nrow'] + ncolumn = dummy['ncolumn'] + pSpatialRef_dem = dummy['spatialReference'] + pProjection= dummy['projection'] + pGeotransform = dummy['geotransform'] #lower left dX_lowerleft = dOriginX @@ -600,8 +609,16 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): #check whether DEM exists if os.path.isfile(sFilename_dem): - dPixelWidth, dOriginX, dOriginY, nrow, ncolumn, pSpatialRef_dem, pProjection, pGeotransform\ - = retrieve_geotiff_metadata(sFilename_dem) + dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) + dPixelWidth = dummy['pixelWidth'] + pPixelHeight = dummy['pixelHeight'] + dOriginX = dummy['originX'] + dOriginY = dummy['originY'] + nrow = dummy['nrow'] + ncolumn = dummy['ncolumn'] + pSpatialRef_dem = dummy['spatialReference'] + pProjection= dummy['projection'] + pGeotransform = dummy['geotransform'] #lower left dX_lowerleft = dOriginX @@ -664,7 +681,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): if iFlag_mesh_boundary ==1: #create a polygon based on real boundary - pBoundary_wkt, aExtent = read_mesh_boundary(self.sFilename_mesh_boundary) + pBoundary_wkt, aExtent = gdal_read_geojson_boundary(self.sFilename_mesh_boundary) aHexagon = create_hexagon_mesh(iFlag_rotation, dX_lowerleft, dY_lowerleft, dResolution_meter, ncolumn, nrow, sFilename_mesh, sFilename_spatial_reference, pBoundary_wkt) @@ -691,7 +708,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): nrow= int( (dY_upperleft - dY_lowerleft) / dResolution_meter ) if iFlag_mesh_boundary ==1: #create a polygon based on real boundary - pBoundary_wkt, aExtent= read_mesh_boundary(self.sFilename_mesh_boundary) + pBoundary_wkt, aExtent= gdal_read_geojson_boundary(self.sFilename_mesh_boundary) aSquare = create_square_mesh(dX_lowerleft, dY_lowerleft, dResolution_meter, ncolumn, nrow, sFilename_mesh, sFilename_spatial_reference, pBoundary_wkt) @@ -721,7 +738,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): if iFlag_mesh_boundary ==1: #create a polygon based on real boundary #already produced - pBoundary_wkt , aExtent= read_mesh_boundary(self.sFilename_mesh_boundary) + pBoundary_wkt , aExtent= gdal_read_geojson_boundary(self.sFilename_mesh_boundary) aLatlon = create_latlon_mesh(dLongitude_left, dLatitude_bot, dResolution_degree, ncolumn, nrow, sFilename_mesh, pBoundary_wkt) pass @@ -762,7 +779,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): if iFlag_mesh_boundary ==1: #create a polygon based on #read boundary - pBoundary_wkt, aExtent = read_mesh_boundary(self.sFilename_mesh_boundary) + pBoundary_wkt, aExtent = gdal_read_geojson_boundary(self.sFilename_mesh_boundary) aMpas = create_mpas_mesh(iFlag_global, iFlag_use_mesh_dem, iFlag_save_mesh, sFilename_mesh_netcdf, sFilename_mesh, iFlag_antarctic_in=iFlag_antarctic_in, pBoundary_in = pBoundary_wkt) @@ -1132,7 +1149,8 @@ def pyflowline_export(self): #convert the mesh into the kml format so it can be visualized in google earth and google map #shoule move this to the export function if iFlag_kml is not None: - convert_geojson_to_kml(self.sFilename_mesh, self.sFilename_mesh_kml) + #convert_geojson_to_kml(self.sFilename_mesh, self.sFilename_mesh_kml) + pass if self.iFlag_flowline ==1: for pBasin in self.aBasin: diff --git a/pyflowline/classes/square.py b/pyflowline/classes/square.py index ef507f4..722bcff 100644 --- a/pyflowline/classes/square.py +++ b/pyflowline/classes/square.py @@ -5,7 +5,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.cell import pycell from pyflowline.classes.flowline import pyflowline -from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_polygon_area +from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area class SquareClassEncoder(JSONEncoder): def default(self, obj): diff --git a/pyflowline/classes/vertex.py b/pyflowline/classes/vertex.py index 73fd53e..fd28cc5 100644 --- a/pyflowline/classes/vertex.py +++ b/pyflowline/classes/vertex.py @@ -6,9 +6,9 @@ iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: - from pyflowline.algorithms.cython.kernel import calculate_distance_based_on_lon_lat + from pyflowline.algorithms.cython.kernel import calculate_distance_based_on_longitude_latitude else: - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_distance_based_on_lon_lat + from pyearth.gis.geometry.calculate_distance_based_on_longitude_latitude import calculate_distance_based_on_longitude_latitude class VertexClassEncoder(JSONEncoder): def default(self, obj): @@ -175,7 +175,7 @@ def calculate_distance(self, other): lat1 = self.dLatitude_degree lon2 = other.dLongitude_degree lat2 = other.dLatitude_degree - dDistance = calculate_distance_based_on_lon_lat(lon1, lat1, lon2, lat2) + dDistance = calculate_distance_based_on_longitude_latitude(lon1, lat1, lon2, lat2) return dDistance def tojson(self): diff --git a/pyflowline/external/pyearth/gis/gdal/gdal_functions.py b/pyflowline/external/pyearth/gis/gdal/gdal_functions.py deleted file mode 100644 index 122b6e0..0000000 --- a/pyflowline/external/pyearth/gis/gdal/gdal_functions.py +++ /dev/null @@ -1,512 +0,0 @@ -import os,sys -from math import cos, sin, sqrt, acos -import numpy as np -import osgeo -from osgeo import ogr, osr, gdal -#from shapely.wkt import loads -#most of these functions are copied from the pyearth package - -import importlib -iFlag_cython = importlib.util.find_spec("cython") -if iFlag_cython is not None: - from pyflowline.algorithms.cython.kernel import longlat_to_3d -else: - from pyflowline.algorithms.auxiliary.longlat_to_3d import longlat_to_3d - - - -#https://stackoverflow.com/questions/8204998/how-to-check-if-a-pointlonc-latc-lie-on-a-great-circle-running-from-lona-lata -def calculate_distance_to_plane(x1, y1, x2, y2, x3, y3): - - a = np.radians(np.array((x1, y1) )) - b = np.radians(np.array((x2, y2) )) #this is the middle one - c = np.radians(np.array((x3, y3) )) - # The points in 3D space - a3 = longlat_to_3d(*a) - b3 = longlat_to_3d(*b) - c3 = longlat_to_3d(*c) - #The formula is x+b*y+c*z=0 - x1,y1,z1 = a3 - x2,y2,z2 = b3 - x3,y3,z3 = c3 - c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) - b = ( -x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) - distance = abs( x2 + b * y2 + c * z2 ) - return distance - -def calculate_angle_betwen_vertex_normal(x1, y1, x2, y2, x3, y3): - a = np.radians(np.array((x1, y1) )) - b = np.radians(np.array((x2, y2) )) - c = np.radians(np.array((x3, y3) )) - # The points in 3D space - a3 = longlat_to_3d(*a) - b3 = longlat_to_3d(*b) - c3 = longlat_to_3d(*c) - a3vec = a3 - b3 - c3vec = c3 - b3 - dot=np.dot(a3vec, c3vec) - g = np.cross(a3vec, c3vec) - det = np.dot(b3, g) - angle = np.arctan2(det, dot) - f = np.degrees(angle) - if f < 0: - f = 360 + f - - return f - -def calculate_angle_betwen_vertex(x1, y1, x2, y2, x3, y3): - #all in degree - a = np.radians(np.array((x1, y1) )) - b = np.radians(np.array((x2, y2) )) - c = np.radians(np.array((x3, y3) )) - # The points in 3D space - a3 = longlat_to_3d(*a) - b3 = longlat_to_3d(*b) - c3 = longlat_to_3d(*c) - # Vectors in 3D space - a3vec = a3 - b3 - c3vec = c3 - b3 - angle3deg = angle_between_vectors_degrees(a3vec, c3vec) - return angle3deg - -def angle_between_vectors_degrees(u, v): - """Return the angle between two vectors in any dimension space, - in degrees. - """ - a = np.dot(u, v) - b = np.linalg.norm(u) - c = np.linalg.norm(v) - d = a / (b* c) - if d > 1: - d = 1 - if d < -1: - d = -1 - e = acos(d) - f = np.degrees(e) - return f - -def convert_360_to_180(dLongitude_in): - """[This function is modified from - http://www.idlcoyote.com/map_tips/lonconvert.html] - - Args: - dLongitude_in ([type]): [description] - - Returns: - [type]: [description] - """ - a = int(dLongitude_in /180) - dLongitude_out = dLongitude_in - a*360.0 - return dLongitude_out - -def convert_180_to_360(dLongitude_in): - """[This function is modified from - http://www.idlcoyote.com/map_tips/lonconvert.html] - - Args: - dLongitude_in ([type]): [description] - - Returns: - [type]: [description] - """ - - dLongitude_out = (dLongitude_in + 360.0) % 360.0 - - return dLongitude_out - -def retrieve_geotiff_metadata(sFilename_geotiff_in): - """[retrieve the metadata of a geotiff file] - - Args: - sFilename_geotiff_in ([type]): [description] - - Returns: - [type]: [description] - """ - pDriver = gdal.GetDriverByName('GTiff') - - pDataset = gdal.Open(sFilename_geotiff_in, gdal.GA_ReadOnly) - - if pDataset is None: - print("Couldn't open this file: " + sFilename_geotiff_in) - sys.exit("Try again!") - else: - pProjection = pDataset.GetProjection() - pSpatial_reference = osr.SpatialReference(wkt=pProjection) - ncolumn = pDataset.RasterXSize - nrow = pDataset.RasterYSize - pGeotransform = pDataset.GetGeoTransform() - dOriginX = pGeotransform[0] - dOriginY = pGeotransform[3] - dPixelWidth = pGeotransform[1] - pPixelHeight = pGeotransform[5] - return dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, pSpatial_reference, pProjection, pGeotransform - -def degree_to_meter(dLatitude_in, dResolution_degree_in): - """[Conver a degree-based resolution to meter-based resolution] - - Args: - dLatitude_in ([type]): [description] - dResolution_degree_in ([type]): [description] - - Returns: - [type]: [description] - """ - dRadius = 6378137.0 #unit: m earth radius - dRadius2 = dRadius * np.cos( dLatitude_in / 180.0 * np.pi) - dResolution_meter = dResolution_degree_in / 360.0 * (2*np.pi * dRadius2) - - return dResolution_meter - -def meter_to_degree(dResolution_meter_in, dLatitude_mean_in): - """[Convert a meter-based resolution to degree-based resolution] - - Args: - dResolution_meter_in ([type]): [description] - dLatitude_mean_in ([type]): [description] - - Returns: - [type]: [description] - """ - dLatitude_mean = abs(dLatitude_mean_in) - - dRadius = 6378137.0 # #unit: m earth radius - dRadius2 = dRadius * np.cos( dLatitude_mean / 180.0 * np.pi) - - ##dResolution_meter = dResolution_degree / 360.0 * 2*np.pi * dRadius2 - - dResolution_degree= dResolution_meter_in/(2*np.pi * dRadius2) * 360.0 - - return dResolution_degree - -def get_utm_spatial_reference(dLongitude_in): - if -180 <= dLongitude_in <= 180: - zone = int((dLongitude_in + 180) / 6) + 1 - hemisphere = 'N' if dLongitude_in >= 0 else 'S' - epsg_code = 32600 + zone if hemisphere == 'N' else 32700 + zone - utm_sr = osr.SpatialReference() - utm_sr.ImportFromEPSG(epsg_code) - return utm_sr - else: - raise ValueError("Longitude must be in the range [-180, 180].") - -def reproject_coordinates(x_in, y_in, spatial_reference_source, spatial_reference_target=None): - """[Reproject coordinates from one reference to another. By default to WGS84.] - - Args: - x_in ([type]): [description] - y_in ([type]): [description] - spatial_reference_source ([type]): [description] - spatial_reference_target ([type], optional): [description]. Defaults to None. - - Returns: - [type]: [description] - """ - if spatial_reference_target is not None: - pass - else: - spatial_reference_target = osr.SpatialReference() - spatial_reference_target.ImportFromEPSG(4326) - pass - - if int(osgeo.__version__[0]) >= 3: - # GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546 - spatial_reference_source.SetAxisMappingStrategy(osgeo.osr.OAMS_TRADITIONAL_GIS_ORDER) - spatial_reference_target.SetAxisMappingStrategy(osgeo.osr.OAMS_TRADITIONAL_GIS_ORDER) - pass - - pTransform = osr.CoordinateTransformation( spatial_reference_source, spatial_reference_target) - x_new,y_new, z = pTransform.TransformPoint( x_in,y_in) - - return x_new, y_new - -def reproject_coordinates_batch(aX_in, aY_in, spatial_reference_source, spatial_reference_target=None): - """[Reproject coordinates from one reference to another in batch mode. By default to WGS84.] - - Args: - aX_in ([type]): [description] - aY_in ([type]): [description] - spatial_reference_source ([type]): [description] - spatial_reference_target ([type], optional): [description]. Defaults to None. - - Returns: - [type]: [description] - """ - #Reproject a list of x,y coordinates. - - if spatial_reference_target is not None: - - pass - else: - spatial_reference_target = osr.SpatialReference() - spatial_reference_target.ImportFromEPSG(4326) - - pass - - - if int(osgeo.__version__[0]) >= 3: - # GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546 - - spatial_reference_source.SetAxisMappingStrategy(osgeo.osr.OAMS_TRADITIONAL_GIS_ORDER) - spatial_reference_target.SetAxisMappingStrategy(osgeo.osr.OAMS_TRADITIONAL_GIS_ORDER) - - - pTransform = osr.CoordinateTransformation( spatial_reference_source, spatial_reference_target) - - npoint = len(aX_in) - x_new=list() - y_new=list() - for i in range(npoint): - x0 = aX_in[i] - y0 = aY_in[i] - - x1,y1, z = pTransform.TransformPoint( x0,y0) - - x_new.append(x1) - y_new.append(y1) - - return x_new,y_new - -def calculate_distance_based_on_lon_lat(lon1, lat1, lon2, lat2): - """ - Calculate the great circle distance between two points - on the earth (specified in decimal degrees) - """ - # convert decimal degrees to radians - lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2]) - - # haversine formula - dlon = lon2 - lon1 - dlat = lat2 - lat1 - a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 - c = 2 * np.arcsin(sqrt(a)) - # Radius of earth in kilometers. Use 3956 for miles - r = 6378137.0 - return c * r - -def calculate_polygon_area(aLon_in, aLat_in, algorithm = 0): - """ - Computes area of spherical polygon, assuming spherical Earth. - Returns result in ratio of the sphere's area if the radius is specified. Otherwise, in the units of provided radius. - lats and lons are in degrees. - """ - #TODO: take into account geodesy (i.e. convert latitude to authalic sphere, use radius of authalic sphere instead of mean radius of spherical earth) - #for i in range(len(aLon_in)): - # aLon_in[i] = aLon_in[i] + 180.0 - - lons = np.deg2rad(aLon_in) - lats = np.deg2rad(aLat_in) - if algorithm==0: - # Line integral based on Green's Theorem, assumes spherical Earth - #close polygon - if lats[0]==lats[-1] and lons[0]==lons[-1] : - pass - else: - lats = np.append(lats, lats[0]) - lons = np.append(lons, lons[0]) - - # Get colatitude (a measure of surface distance as an angle) - a = np.sin(lats/2)**2 + np.cos(lats)* np.sin(lons/2)**2 - colat = 2*np.arctan2( np.sqrt(a), np.sqrt(1-a) ) - - #azimuth of each point in segment from the arbitrary origin - az = np.arctan2(np.cos(lats) * np.sin(lons), np.sin(lats)) % (2*np.pi) - - # Calculate step sizes - # daz = np.diff(az) % (2*pi) - daz = np.diff(az) - daz = (daz + np.pi) % (2 * np.pi) - np.pi - - # Determine average surface distance for each step - deltas=np.diff(colat)/2 - colat=colat[0:-1]+deltas - - # Integral over azimuth is 1-cos(colatitudes) - integrands = (1-np.cos(colat)) * daz - - # Integrate and save the answer as a fraction of the unit sphere. - # Note that the sum of the integrands will include a factor of 4pi. - area = abs(sum(integrands))/(4*np.pi) # Could be area of inside or outside - - area = min(area,1-area) - radius= 6378137.0 - - dArea = area * 4*np.pi*(radius**2) - return dArea - - - elif algorithm==2: - #L'Huilier Theorem, assumes spherical earth - #see: - # https://mathworld.wolfram.com/SphericalPolygon.html - # https://web.archive.org/web/20160324191929/http://forum.worldwindcentral.com/showthread.php?20724-A-method-to-compute-the-area-of-a-spherical-polygon - # https://github.com/spacetelescope/spherical_geometry/blob/master/spherical_geometry/polygon.py - # https://github.com/tylerjereddy/spherical-SA-docker-demo/blob/master/docker_build/demonstration.py - #TODO - pass - elif algorithm==3: - #https://trs.jpl.nasa.gov/handle/2014/41271 - #TODO - pass - -def gdal_read_geotiff_file(sFilename_in): - """Read a Geotiff format raster file. - - Args: - sFilename_in (string): The file name - - Returns: - tuple: aData_out, pPixelWidth, dOriginX, dOriginY, nrow, ncolumn, dMissing_value , pGeotransform, pProjection, pSpatial_reference - """ - - if os.path.exists(sFilename_in): - pass - else: - print('The file does not exist!') - return - - sDriverName='GTiff' - pDriver = gdal.GetDriverByName(sDriverName) - - if pDriver is None: - print ("%s pDriver not available.\n" % sDriverName) - else: - print ("%s pDriver IS available.\n" % sDriverName) - - pDataset = gdal.Open(sFilename_in, gdal.GA_ReadOnly) - - if pDataset is None: - print("Couldn't open this file: " + sFilename_in) - sys.exit("Try again!") - else: - pProjection = pDataset.GetProjection() - - pDataset.GetMetadata() - - ncolumn = pDataset.RasterXSize - nrow = pDataset.RasterYSize - nband = pDataset.RasterCount - - pGeotransform = pDataset.GetGeoTransform() - dOriginX = pGeotransform[0] - dOriginY = pGeotransform[3] - dPixelWidth = pGeotransform[1] - pPixelHeight = pGeotransform[5] - - pBand = pDataset.GetRasterBand(1) - - # Data type of the values - gdal.GetDataTypeName(pBand.DataType) - # Compute statistics if needed - if pBand.GetMinimum() is None or pBand.GetMaximum() is None: - pBand.ComputeStatistics(0) - - dMissing_value = pBand.GetNoDataValue() - - aData_out = pBand.ReadAsArray(0, 0, ncolumn, nrow) - - #we will use one of them to keep the consistency - pSpatial_reference = osr.SpatialReference(wkt=pProjection) - - - pDataset = None - pBand = None - pBand = None - - return aData_out, dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, dMissing_value, pGeotransform, pProjection, pSpatial_reference - -def Google_MetersPerPixel( zoomLevel ): - - # Return to the caller if there is an error. - #On_Error, 2 - - #; Need a zoom level? - - - # Number of pixels in an image with a zoom level of 0. - pixels_in_image = 256 - - # The equitorial radius of the Earth assuming WGS-84 ellipsoid. - earth_radius = 6378137.0 - - # The number of meters per pixel. - metersPerPixel = (2* np.pi * earth_radius) / pixels_in_image / np.power(2,zoomLevel) - - # Return the value. - return metersPerPixel - -def read_mesh_boundary(sFilename_boundary_in): - """ - convert a shpefile to json format. - This function should be used for stream flowline only. - """ - iReturn_code = 1 - if os.path.isfile(sFilename_boundary_in): - pass - else: - print('This mesh file does not exist: ', sFilename_boundary_in ) - iReturn_code = 0 - return iReturn_code - - - pDriver_json = ogr.GetDriverByName('GeoJSON') - pDataset_mesh = pDriver_json.Open(sFilename_boundary_in, gdal.GA_ReadOnly) - pLayer_mesh = pDataset_mesh.GetLayer(0) - pSpatial_reference_out = pLayer_mesh.GetSpatialRef() - ldefn = pLayer_mesh.GetLayerDefn() - - #we also need to spatial reference - for pFeature_mesh in pLayer_mesh: - pGeometry_mesh = pFeature_mesh.GetGeometryRef() - pGeometrytype_boundary = pGeometry_mesh.GetGeometryName() - if(pGeometrytype_boundary == 'POLYGON'): - pBoundary_ogr = pGeometry_mesh - else: - if(pGeometrytype_boundary == 'MULTIPOLYGON'): - nLine = pGeometry_mesh.GetGeometryCount() - for i in range(nLine): - pBoundary_ogr = pGeometry_mesh.GetGeometryRef(i) - - pass - else: - pass - pass - - - pBoundary_wkt = pBoundary_ogr.ExportToWkt() - aExtent = pBoundary_ogr.GetEnvelope() - min_x, max_x, min_y, max_y = aExtent - - return pBoundary_wkt, aExtent - - -def get_geometry_coords(geometry): - - sGeometry_type = geometry.GetGeometryName() - if sGeometry_type =='POINT': - return get_point_coords(geometry) - elif sGeometry_type == 'LINESTRING': - return get_linestring_coords(geometry) - elif sGeometry_type =='POLYGON': - return get_polygon_exterior_coords(geometry) - else: - raise ValueError("Unsupported geometry type.") - -def get_polygon_exterior_coords(polygon_geometry): - exterior_coords = [] - ring = polygon_geometry.GetGeometryRef(0) # Get the exterior ring - for i in range(ring.GetPointCount()): - point = ring.GetPoint(i) - exterior_coords.append((point[0], point[1])) - return np.array(exterior_coords) - -def get_linestring_coords(linestring_geometry): - coords = [] - for i in range(linestring_geometry.GetPointCount()): - point = linestring_geometry.GetPoint(i) - coords.append((point[0], point[1])) - return np.array(coords) - -def get_point_coords(point_geometry): - point = point_geometry.GetPoint() - return np.array([(point[0], point[1])]) \ No newline at end of file diff --git a/pyflowline/external/pyearth/gis/kml/convert_geojson_to_kml.py b/pyflowline/external/pyearth/gis/kml/convert_geojson_to_kml.py deleted file mode 100644 index e5f7a35..0000000 --- a/pyflowline/external/pyearth/gis/kml/convert_geojson_to_kml.py +++ /dev/null @@ -1,39 +0,0 @@ -from osgeo import ogr -import simplekml -def convert_geojson_to_kml(sFilename_geojson, sFilename_kml): - # Read the GeoJSON file - - #geojson_driver = ogr.GetDriverByName('GeoJSON') - #geojson_data_source = geojson_driver.Open(sFilename_geojson) - #layer = geojson_data_source.GetLayer() - - # Create a KML object - #kml = simplekml.Kml() - - # Iterate over features in the GeoJSON layer - #feature = layer.GetNextFeature() - #while feature: - # Get the geometry of the feature - ## geometry = feature.GetGeometryRef() - # sGeometry_type = geometry.GetGeometryName() - # Convert the geometry to WKT - # wkt = geometry.ExportToWkt() - # if(sGeometry_type == 'POLYGON'): - # Create a KML placemark and add it to the KML object - #polygon = kml.newpolygon() - #polygon.geometry = simplekml.Geometry(wkt=wkt) - # pass - # else: - # if (sGeometry_type == 'LINESTRING'): - # Create a KML placemark and add it to the KML object - #linestring = kml.newlinestring() - #linestring.geometry = simplekml.Geometry(wkt=wkt) - # pass - - # Move to the next feature - #feature = layer.GetNextFeature() - - # Save the KML to a file - #sFilename_kml = 'output.kml' - #kml.save(sFilename_kml) - return \ No newline at end of file diff --git a/pyflowline/external/pyearth/system/define_global_variables.py b/pyflowline/external/pyearth/system/define_global_variables.py deleted file mode 100644 index d552f68..0000000 --- a/pyflowline/external/pyearth/system/define_global_variables.py +++ /dev/null @@ -1,61 +0,0 @@ -""" -this module will be used to define all the global variables -""" - -import platform -from pathlib import Path -import getpass -sPlatform_os = platform.system() - -sUsername = getpass.getuser() - -sWorkspace_home = str(Path.home()) - -if sPlatform_os == 'Windows': #windows - slash = '\\' - sMachine ='None' - - sWorkspace_scratch = 'C:' -else: #linux or unix - slash = '/' - - if (sPlatform_os == 'Linux'): - sWorkspace_scratch = sWorkspace_home + slash + 'scratch' - - else: - if (sPlatform_os == 'Darwin'): - sMachine ='mac' - sWorkspace_scratch = sWorkspace_home + slash + 'scratch' - else: - pass - -#data file type -sExtension_txt = '.txt' -sExtension_envi = '.dat' -sExtension_tiff = '.tif' -sExtension_header ='.hdr' -sExtension_netcdf = '.nc' -sExtension_shapefile = '.shp' -sExtension_json = '.json' - -#graphics format - -sExtension_png = '.png' -sExtension_jpg = '.jpg' -sExtension_ps = '.ps' -sExtension_vtk = '.vtk' - - -#constant values -missing_value = -9999.0 - -nmonth = 12 #be careful with this one - -#unit conversion - -iMonth_start = 1 -iMonth_end = 12 -mms2mmd = 24 * 3600.0 -feet2meter = 0.3048 -inch2mm = 25.4 -cms2cmd = 24 * 3600 diff --git a/pyflowline/external/pyearth/toolbox/math/stat/remap.py b/pyflowline/external/pyearth/toolbox/math/stat/remap.py deleted file mode 100644 index 9326473..0000000 --- a/pyflowline/external/pyearth/toolbox/math/stat/remap.py +++ /dev/null @@ -1,29 +0,0 @@ -import numpy as np -def remap( x, oMin, oMax, nMin, nMax ): - - #range check - if oMin == oMax: - print ("Warning: Zero input range") - return None - if nMin == nMax: - print ("Warning: Zero output range") - return None - #check reversed input range - reverseInput = False - oldMin = np.min( np.array([oMin, oMax]) ) - oldMax = np.max( np.array([oMin, oMax]) ) - if not oldMin == oMin: - reverseInput = True - #check reversed output range - reverseOutput = False - newMin = np.min( np.array([nMin, nMax]) ) - newMax = np.max( np.array([nMin, nMax]) ) - if not newMin == nMin : - reverseOutput = True - portion = (x-oldMin)*(newMax-newMin)/(oldMax-oldMin) - if reverseInput: - portion = (oldMax-x)*(newMax-newMin)/(oldMax-oldMin) - result = portion + newMin - if reverseOutput: - result = newMax - portion - return result \ No newline at end of file diff --git a/pyflowline/external/pyearth/toolbox/reader/text_reader_string.py b/pyflowline/external/pyearth/toolbox/reader/text_reader_string.py deleted file mode 100644 index 7c2a7ca..0000000 --- a/pyflowline/external/pyearth/toolbox/reader/text_reader_string.py +++ /dev/null @@ -1,167 +0,0 @@ -import os -import numpy as np -def text_reader_string( sFilename_in,\ - ncolumn_in = None, \ - nrow_in = None, \ - cDelimiter_in = None, \ - iFlag_remove_quota = None, \ - iSkipline_in = None ): - """ - Read a text based file - sFilename_in, - ncolumn_in = None, - nrow_in = None, - cDelimiter_in = None, - iSkipline_in = None - """ - - aData_out = -1 - if os.path.isfile(sFilename_in): - - if ncolumn_in is not None: - iFlag_column = 1 - ncolumn_out = ncolumn_in - else: - iFlag_column = 0 - - if nrow_in is not None : - #there is nothing - nrow_out = nrow_in - #print(' ') - else : - #get the total line number - ifs = open(sFilename_in, "r") - nrow_out = len(ifs.readlines()) - ifs.close() - - sLine=' ' - ifs = open(sFilename_in, "r") - - if iSkipline_in is not None: - nrow_out = nrow_out - iSkipline_in - for i in range(iSkipline_in): - ifs.readline() - else: - pass - - if iFlag_remove_quota is not None: - iFlag_iFlag_remove_quota = 1 - else: - iFlag_iFlag_remove_quota = 0 - - #get delimiter - if cDelimiter_in is not None: - iFlag_delimiter = 1 - else: - iFlag_delimiter = 0 - #cDelimiter_in = ' ' - pass - - - if iFlag_delimiter == 1: - if iFlag_column == 1: - if ncolumn_out < 1 : - print( 'The file has no data!' ) - pass - - aData_out = np.full( (nrow_out, ncolumn_out), ' ' , dtype=object ) - for iRow in range(nrow_out): - sLine=(ifs.readline()).rstrip() - if iFlag_iFlag_remove_quota ==1: - sLine.replace('"','') - else: - pass - - aDummy = sLine.split(cDelimiter_in) - iDummy = len(aDummy) - if iDummy == ncolumn_out: - aData_out[iRow] = aDummy - else: - #something is missing - aDummy2 =np.full(ncolumn_out, ' ' , dtype=object) - aDummy2[0: iDummy]= aDummy - aData_out[iRow]= aDummy2 - pass - - else : - sLine=(ifs.readline()).rstrip() - dummy = sLine.split(cDelimiter_in) - ncolumn_out = len(dummy) - #check ncolumn_in count - if ncolumn_out < 1 : - print( 'The file has no data!' ) - pass - - aData_out = np.full( (nrow_out, ncolumn_out), ' ' , dtype=object ) - aData_out[0] = dummy - for iRow in range(1, nrow_out): - sLine=(ifs.readline()).rstrip() - if iFlag_iFlag_remove_quota ==1: - sLine.replace('"','') - else: - pass - - aDummy = sLine.split(cDelimiter_in) - iDummy = len(aDummy) - if iDummy == ncolumn_out: - aData_out[iRow] = aDummy - else: - #something is missing - aDummy2 =np.full(ncolumn_out, ' ' , dtype=object) - aDummy2[0: iDummy]= aDummy - aData_out[iRow]= aDummy2 - pass - - else : - if iFlag_column == 1: - #check ncolumn_in count - if ncolumn_out < 1 : - return aData_out - - aData_out = np.full( (nrow_out, ncolumn_out), ' ', dtype=object ) - for iRow in range(nrow_out): - dummy1 = ifs.readline() - - dummy2 = dummy1.rstrip() - if iFlag_iFlag_remove_quota ==1: - dummy2=dummy2.replace('"','') - else: - pass - - dummy3 = dummy2.split() - - aData_out[iRow] = dummy3 - else : - sLine=(ifs.readline()).rstrip() - dummy = sLine.split() - ncolumn_out = len(dummy) - if ncolumn_out < 1 : - return aData_out - - aData_out = np.full( (nrow_out, ncolumn_out), ' ', dtype=object ) - if iFlag_iFlag_remove_quota ==1: - sLine=sLine.replace('"','') - else: - pass - - aData_out[0] = dummy - for iRow in range(1,nrow_out): - dummy1 = ifs.readline() - #print('New line is: ' + dummy1) - dummy2 = dummy1.rstrip() - if iFlag_iFlag_remove_quota ==1: - dummy2=dummy2.replace('"','') - else: - pass - - dummy3 = dummy2.split() - - aData_out[iRow] = dummy3 - - - ifs.close() - - else : - print('file does not exist') - - return aData_out diff --git a/pyflowline/external/pyearth/visual/animate/animate_vector_polygon_data.py b/pyflowline/external/pyearth/visual/animate/animate_vector_polygon_data.py deleted file mode 100644 index 5b6db68..0000000 --- a/pyflowline/external/pyearth/visual/animate/animate_vector_polygon_data.py +++ /dev/null @@ -1,279 +0,0 @@ -import os -import json -import numpy as np -import cartopy.crs as ccrs -import matplotlib as mpl -#from shapely.wkt import loads -from osgeo import osr, gdal, ogr -import matplotlib.pyplot as plt -import matplotlib.patches as mpatches -import matplotlib.cm as cm -from matplotlib import animation -from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords - -pProjection = ccrs.PlateCarree() # for latlon data only - - -class OOMFormatter(mpl.ticker.ScalarFormatter): - def __init__(self, order=0, fformat="%1.1e", offset=True, mathText=True): - self.oom = order - self.fformat = fformat - mpl.ticker.ScalarFormatter.__init__( - self, useOffset=offset, useMathText=mathText - ) - - def _set_order_of_magnitude(self): - self.orderOfMagnitude = self.oom - - def _set_format(self, vmin=None, vmax=None): - self.format = self.fformat - if self._useMathText: - self.format = r"$\mathdefault{%s}$" % self.format - - -iFigwidth_default = 12 -iFigheight_default = 12 - - -def animate_vector_polygon_data( - sFilename_mesh_in, - sFilename_animation_json_in, - sFilename_animation_out, - iFlag_type_in=None, - iFigwidth_in=None, - iFigheight_in=None, - aExtent_in=None, - pProjection_map_in=None, -): - if iFigwidth_in is None: - iFigwidth_in = iFigwidth_default - - if iFigheight_in is None: - iFigheight_in = iFigheight_default - - # read domain json - # read result json - - # read animation json - - dLat_min = 90 - dLat_max = -90 - dLon_min = 180 - dLon_max = -180 - aCellID = list() - aData = list() - aCell_raw = list() - aCell_new = list() - aCell_animation = list() - pDriver = ogr.GetDriverByName("GeoJSON") - - pDataset = pDriver.Open(sFilename_mesh_in, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - pSrs = osr.SpatialReference() - pSrs.ImportFromEPSG(4326) # WGS84 lat/lon - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - - if sGeometry_type == "POLYGON": - #dummy0 = loads(pGeometry_in.ExportToWkt()) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs = np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - - dLon_max = np.max([dLon_max, np.max(aCoords_gcs[:, 0])]) - dLon_min = np.min([dLon_min, np.min(aCoords_gcs[:, 0])]) - dLat_max = np.max([dLat_max, np.max(aCoords_gcs[:, 1])]) - dLat_min = np.min([dLat_min, np.min(aCoords_gcs[:, 1])]) - - if pProjection_map_in is not None: - pProjection_map = pProjection_map_in - else: - pProjection_map = ccrs.Orthographic( - central_longitude=0.50 * (dLon_max + dLon_min), - central_latitude=0.50 * (dLat_max + dLat_min), - globe=None, - ) - - fig = plt.figure(dpi=600) - fig.set_figwidth(iFigwidth_in) - fig.set_figheight(iFigheight_in) - ax = fig.add_axes([0.1, 0.1, 0.65, 0.8], projection=pProjection_map) - ax.set_global() - - aData = np.array(aData) - dData_max = np.max(aData) - dData_min = np.min(aData) - marginx = (dLon_max - dLon_min) / 20 - marginy = (dLat_max - dLat_min) / 20 - if aExtent_in is None: - aExtent = [ - dLon_min - marginx, - dLon_max + marginx, - dLat_min - marginy, - dLat_max + marginy, - ] - else: - aExtent = aExtent_in - - ax.set_extent(aExtent) - ax.coastlines() # resolution='110m') - if iFlag_type_in == 1: # full - gl = ax.gridlines( - crs=ccrs.PlateCarree(), - draw_labels=True, - linewidth=1, - color="gray", - alpha=0.3, - linestyle="--", - ) - gl.xlabel_style = {"size": 8, "color": "k", "rotation": 0, "ha": "right"} - gl.ylabel_style = {"size": 8, "color": "k", "rotation": 90, "weight": "normal"} - else: # track mode - pass - - cmap = cm.get_cmap("Spectral") - # setting a title for the plot - sText = "Priority flood in HexWatershed" - ax.text( - 0.5, - 1.05, - sText, - verticalalignment="center", - horizontalalignment="center", - transform=ax.transAxes, - color="black", - fontsize=9, - ) - cmap_reversed = cmap.reversed() - - with open(sFilename_mesh_in) as json_file: - aCell_new = json.load(json_file) - ncell_new = len(aCell_new) - - with open(sFilename_animation_json_in) as json_file: - aCell_animation = json.load(json_file) - ncell_animation = len(aCell_animation) - - sText = "" - x1 = 0.0 - y1 = 0.0 - pArtist1 = ax.text( - x1, - y1, - sText, - verticalalignment="center", - horizontalalignment="right", - transform=ax.transAxes, - color="black", - fontsize=12, - ) - - x2 = 0.0 - y2 = 0.0 - pArtist2 = ax.text( - x2, - y2, - sText, - verticalalignment="center", - horizontalalignment="left", - transform=ax.transAxes, - color="black", - fontsize=12, - ) - - # trasform elevation - norm = plt.Normalize(dData_min, dData_max) - sm = plt.cm.ScalarMappable(cmap = cmap_reversed, norm=norm) - sm.set_array(aData) - ax_cb = fig.add_axes([0.85, 0.12, 0.04, 0.75]) - cb = fig.colorbar(sm, cax=ax_cb) - sUnit = r"Unit: m" - cb.ax.get_yaxis().set_ticks_position("right") - cb.ax.get_yaxis().labelpad = 5 - cb.ax.set_ylabel(sUnit, rotation=90) - cb.ax.get_yaxis().set_label_position("left") - cb.ax.tick_params(labelsize=6) - - def animate(i): - aArtist = list() - # get the time step global id and updated elevation - pcell_animation = aCell_animation[i] - lCellID = int(pcell_animation["lCellID"]) - lCellIndex = aCellID.index(lCellID) - pcell_new = aCell_new[lCellIndex] - dlon = float(pcell_new["dLongitude_center_degree"]) - dlat = float(pcell_new["dLatitude_center_degree"]) - dummy0 = float(pcell_new["Elevation_raw"]) - dummy = float(pcell_new["Elevation"]) - avertex = pcell_new["vVertex"] - nvertex = len(avertex) - aLocation = np.full((nvertex, 2), 0.0, dtype=float) - for k in range(nvertex): - aLocation[k, 0] = avertex[k]["dLongitude_degree"] - aLocation[k, 1] = avertex[k]["dLatitude_degree"] - - color_index = (dummy - dData_min) / (dData_max - dData_min) - rgb = cmap_reversed(color_index) - polygon = mpatches.Polygon( - aLocation, - closed=True, - facecolor=rgb, - edgecolor="none", - transform=ccrs.Geodetic(), - ) - pArtist0 = ax.add_patch(polygon) - - if iFlag_type_in == 1: - dLon_min_zoom = dLon_min - dLon_max_zoom = dLon_max - dLat_min_zoom = dLat_min - dLat_max_zoom = dLat_max - else: - dLon_min_zoom = dlon - marginx * 2 - dLon_max_zoom = dlon + marginx * 2 - dLat_min_zoom = dlat - marginy * 2 - dLat_max_zoom = dlat + marginy * 2 - - if dummy0 > dummy: - x1 = (dlon - dLon_min_zoom) / (dLon_max_zoom - dLon_min_zoom) - y1 = (dlat - dLat_min_zoom) / (dLat_max_zoom - dLat_min_zoom) + 0.05 - x2 = (dlon - dLon_min_zoom) / (dLon_max_zoom - dLon_min_zoom) - y2 = (dlat - dLat_min_zoom) / (dLat_max_zoom - dLat_min_zoom) - 0.05 - else: - x1 = (dlon - dLon_min_zoom) / (dLon_max_zoom - dLon_min_zoom) - y1 = (dlat - dLat_min_zoom) / (dLat_max_zoom - dLat_min_zoom) - 0.05 - x2 = (dlon - dLon_min_zoom) / (dLon_max_zoom - dLon_min_zoom) - y2 = (dlat - dLat_min_zoom) / (dLat_max_zoom - dLat_min_zoom) + 0.05 - - sText1 = "Before: " + "{:0.2f}".format(dummy0) + "m" - - pArtist1.set_x(x1) - pArtist1.set_y(y1) - pArtist1.set_text(sText1) - sText2 = "After: " + "{:0.2f}".format(dummy) + "m" - - pArtist2.set_x(x2) - pArtist2.set_y(y2) - pArtist2.set_text(sText2) - - if iFlag_type_in == 2: - aExtent_zoom = [ - dlon - marginx * 2, - dlon + marginx * 2, - dlat - marginy * 2, - dlat + marginy * 2, - ] - ax.set_extent(aExtent_zoom) - - return pArtist0, pArtist1, pArtist2 - - plt.rcParams[ - "animation.convert_path" - ] = "/share/apps/ImageMagick/7.1.0-52/bin/convert" - - anim = animation.FuncAnimation(fig, animate, frames=ncell_animation, interval=400, blit=False) - anim.save(sFilename_animation_out, writer="imagemagick") - - return diff --git a/pyflowline/external/pyearth/visual/choose_line_width.py b/pyflowline/external/pyearth/visual/choose_line_width.py deleted file mode 100644 index 0ac7d0f..0000000 --- a/pyflowline/external/pyearth/visual/choose_line_width.py +++ /dev/null @@ -1,12 +0,0 @@ -def choose_line_width(iFigure_width, iDPI): - # Calculate line width based on the figure width and iDPI - dummy = 0.01 * iFigure_width * iDPI / 80 - dummy1 = max(2.5, dummy) - iWidth_out = min(1.5, dummy1) - return iWidth_out - -if __name__ == '__main__': - iFigure_width = 8 #inch - iDPI = 300 #dot per inch - iWidth_out = choose_line_width(iFigure_width, iDPI) - print(iWidth_out) \ No newline at end of file diff --git a/pyflowline/external/pyearth/visual/map/map_multiple_vector_data.py b/pyflowline/external/pyearth/visual/map/map_multiple_vector_data.py deleted file mode 100644 index ae63812..0000000 --- a/pyflowline/external/pyearth/visual/map/map_multiple_vector_data.py +++ /dev/null @@ -1,502 +0,0 @@ -import os -import numpy as np -from osgeo import osr, gdal, ogr -#from shapely.wkt import loads -import matplotlib as mpl -import matplotlib.pyplot as plt -import matplotlib.patches as mpatches -import matplotlib.path as mpath -import matplotlib.cm as cm -import cartopy.crs as ccrs -from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER -from cartopy.io.img_tiles import OSM -from pyflowline.external.pyearth.toolbox.math.stat.remap import remap -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords - -class OOMFormatter(mpl.ticker.ScalarFormatter): - def __init__(self, order=0, fformat="%1.1e", offset=True, mathText=True): - self.oom = order - self.fformat = fformat - mpl.ticker.ScalarFormatter.__init__(self,useOffset=offset,useMathText=mathText) - def _set_order_of_magnitude(self): - self.orderOfMagnitude = self.oom - def _set_format(self, vmin=None, vmax=None): - self.format = self.fformat - if self._useMathText: - self.format = r'$\mathdefault{%s}$' % self.format - -def map_multiple_vector_data(aFiletype_in, - aFilename_in, - iFlag_colorbar_in=None, - iFlag_title_in=None, - aFlag_thickness_in=None, - aFlag_color_in=None, - aFlag_fill_in = None, - aVariable_in = None, - sFilename_output_in=None, - iFlag_scientific_notation_colorbar_in=None, - iFlag_openstreetmap_in = None, - iFont_size_in=None, - iFlag_openstreetmap_level_in = None, - sColormap_in = None, - sTitle_in = None, - iDPI_in = None, - dMissing_value_in=None, - dData_max_in = None, - dData_min_in = None, - sExtend_in =None, - sFont_in = None, - sUnit_in=None, - aLegend_in = None, - aExtent_in = None, - pProjection_map_in=None): - """ - plot vector data on a map - currently only support geojson and shapefile - by default, the program will plot all the polygons in the file - in the furture, the program will support to plot only a subset of polygons - - Because of the overlay effect, it is ideal to plot them in the following order: polygon->polyling->point - - Args: - iFiletype_in (_type_): _description_ - sFilename_in (_type_): _description_ - sFilename_output_in (_type_): _description_ - iFlag_scientific_notation_colorbar_in (_type_, optional): _description_. Defaults to None. - sColormap_in (_type_, optional): _description_. Defaults to None. - sTitle_in (_type_, optional): _description_. Defaults to None. - iDPI_in (_type_, optional): _description_. Defaults to None. - dMissing_value_in (_type_, optional): _description_. Defaults to None. - dData_max_in (_type_, optional): _description_. Defaults to None. - dData_min_in (_type_, optional): _description_. Defaults to None. - sExtend_in (_type_, optional): _description_. Defaults to None. - sUnit_in (_type_, optional): _description_. Defaults to None. - aLegend_in (_type_, optional): _description_. Defaults to None. - """ - - #check vector type first - if aFiletype_in is None: - print('Error: please specify the vector type') - return - else: - #point: 1, polyline: 2, polygon: 3 - arr = np.array(aFiletype_in) - # Check if the array is descending or has the same values - is_descending = np.all(np.diff(arr) <= 0) - if is_descending == True: - pass - else: - print('Error: the vector type is not correct') - return - - pDriver = ogr.GetDriverByName('GeoJSON') - - - nFile = len(aFilename_in) - if aFlag_thickness_in is None: - aFlag_thickness= np.zeros(nFile, dtype=np.int16) - else: - aFlag_thickness = aFlag_thickness_in - - if aFlag_color_in is None: - aFlag_color= np.zeros(nFile, dtype=np.int16) - else: - aFlag_color = aFlag_color_in - - if aFlag_fill_in is None: - aFlag_fill= np.zeros(nFile, dtype=np.int16) - else: - aFlag_fill = aFlag_fill_in - - #get the extent first - sFilename_in = aFilename_in[0] - - pDataset = pDriver.Open(sFilename_in, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - if iFlag_colorbar_in is not None: - iFlag_colorbar = iFlag_colorbar_in - else: - iFlag_colorbar = 0 - if iDPI_in is not None: - iDPI = iDPI_in - else: - iDPI = 300 - - if iFlag_title_in is not None: - iFlag_title = iFlag_title_in - if iFlag_title == 1: - if sTitle_in is not None: - sTitle = sTitle_in - else: - sTitle = '' - - else: - iFlag_title=0 - - else: - iFlag_title = 0 - sTitle = '' - - - if dMissing_value_in is not None: - dMissing_value = dMissing_value_in - else: - dMissing_value = -9999 - - if dData_min_in is not None: - iFlag_data_min = 1 - dData_min = dData_min_in - else: - iFlag_data_min = 0 - pass - - if dData_max_in is not None: - iFlag_data_max = 1 - dData_max = dData_max_in - else: - iFlag_data_max = 0 - pass - - if iFlag_scientific_notation_colorbar_in is not None: - iFlag_scientific_notation_colorbar = iFlag_scientific_notation_colorbar_in - else: - iFlag_scientific_notation_colorbar = 0 - - if sColormap_in is not None: - sColormap = sColormap_in - else: - sColormap = 'rainbow' - - - - if iFont_size_in is not None: - iFont_size = iFont_size_in - else: - iFont_size = 12 - - if sExtend_in is not None: - sExtend = sExtend_in - else: - sExtend = 'max' - - if sUnit_in is not None: - sUnit = sUnit_in - else: - sUnit = '' - - if sFont_in is not None: - sFont = sFont_in - else: - sFont = "Times New Roman" - - plt.rcParams["font.family"] = sFont - - cmap = cm.get_cmap(sColormap) - fig = plt.figure( dpi = iDPI ) - iSize_x= 8 - iSize_y= 8 - fig.set_figwidth( iSize_x ) - fig.set_figheight( iSize_y ) - - - #we require that the first polygon file defines the extent - - pLayer = pDataset.GetLayer(0) - pSrs = osr.SpatialReference() - pSrs.ImportFromEPSG(4326) # WGS84 lat/lon - dLat_min = 90 - dLat_max = -90 - dLon_min = 180 - dLon_max = -180 - - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - if sGeometry_type =='POLYGON': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - - dLon_max = np.max( [dLon_max, np.max(aCoords_gcs[:,0])] ) - dLon_min = np.min( [dLon_min, np.min(aCoords_gcs[:,0])] ) - dLat_max = np.max( [dLat_max, np.max(aCoords_gcs[:,1])] ) - dLat_min = np.min( [dLat_min, np.min(aCoords_gcs[:,1])] ) - else: - if sGeometry_type =='LINESTRING': - aCoords_gcs = get_geometry_coords(pGeometry_in) - dLon_max = np.max( [dLon_max, np.max(aCoords_gcs[:,0])] ) - dLon_min = np.min( [dLon_min, np.min(aCoords_gcs[:,0])] ) - dLat_max = np.max( [dLat_max, np.max(aCoords_gcs[:,1])] ) - dLat_min = np.min( [dLat_min, np.min(aCoords_gcs[:,1])] ) - - if pProjection_map_in is not None: - pProjection_map = pProjection_map_in - else: - pProjection_map = ccrs.Orthographic(central_longitude = 0.50*(dLon_max+dLon_min), - central_latitude = 0.50*(dLat_max+dLat_min), - globe=None) - - ax = fig.add_axes([0.08, 0.1, 0.62, 0.7], projection= pProjection_map ) #projection=ccrs.PlateCarree() - - # Create an OSM image tile source - - - if aExtent_in is None: - marginx = (dLon_max - dLon_min) / 50 - marginy = (dLat_max - dLat_min) / 50 - aExtent = [dLon_min - marginx , dLon_max + marginx , dLat_min -marginy , dLat_max + marginy] - else: - aExtent = aExtent_in - - ax.set_global() - ax.set_extent( aExtent ) - if iFlag_openstreetmap_in is not None: - if iFlag_openstreetmap_level_in is not None: - iFlag_openstreetmap_level = iFlag_openstreetmap_level_in - else: - iFlag_openstreetmap_level = 9 - pass - - osm_tiles = OSM() - #Add the OSM image to the map - ax.add_image(osm_tiles, iFlag_openstreetmap_level) - sLicense_info = "© OpenStreetMap contributors, CC-BY-SA" - ax.text(0.5, 0.05, sLicense_info, transform=ax.transAxes, ha='center', va='center', fontsize=10, color='gray', bbox=dict(facecolor='white', edgecolor='black', boxstyle='round,pad=0.3')) - - - - #==================================== - #should we allow more than one scale for one variable? - aValue_all = list() - for i in range(nFile): - aValue = list() - sFilename = aFilename_in[i] - - iFlag_thickness = aFlag_thickness[i] - iFlag_color = aFlag_color[i] - if iFlag_thickness ==1 : - sVariable = aVariable_in[i] - pDataset = pDriver.Open(sFilename, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - dValue = float(pFeature.GetField(sVariable)) - aValue.append(dValue) - else: - if iFlag_color == 1: - sVariable = aVariable_in[i] - pDataset = pDriver.Open(sFilename, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - dValue = float(pFeature.GetField(sVariable)) - aValue.append(dValue) - - - aValue_all.append(aValue) - - iThickness_max = 2.5 - iThickness_min = 0.3 - - for i in range(nFile): - sFilename = aFilename_in[i] - iFlag_thickness = aFlag_thickness[i] - iFlag_color = aFlag_color[i] - iFlag_fill = aFlag_fill[i] - pDataset = pDriver.Open(sFilename, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - nColor = pLayer.GetFeatureCount() - aColor = cm.rainbow(np.linspace(0, 1, nColor)) - lID = 0 - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - - if iFlag_thickness ==1 : - sVariable = aVariable_in[i] - aValue = np.array(aValue_all[i]) - if iFlag_data_min == 1 and iFlag_data_max ==1: #both are provided - aValue = np.clip(aValue, dData_min, dData_max) - dValue_max = dData_max - dValue_min = dData_min - else: - aValue = aValue[aValue != dMissing_value] - dValue_max = np.max(aValue) - dValue_min = np.min(aValue) - pass - dValue = float(pFeature.GetField(sVariable)) - - if dValue != dMissing_value: - if dValue > dValue_max: - dValue = dValue_max - - if dValue < dValue_min: - dValue = dValue_min - - iThickness = remap( dValue, dValue_min, dValue_max, iThickness_min, iThickness_max ) - else: - iThickness = 0.25 - - if iFlag_color ==1: - if nColor < 10: - sColor = aColor[lID] - else: - sVariable = aVariable_in[i] - aValue = np.array(aValue_all[i]) - if iFlag_data_min == 1 and iFlag_data_max ==1: #both are provided - aValue = np.clip(aValue, dData_min, dData_max) - dValue_max = dData_max - dValue_min = dData_min - else: - aValue = aValue[aValue != dMissing_value] - dValue_max = np.max(aValue) - dValue_min = np.min(aValue) - pass - dValue = float(pFeature.GetField(sVariable)) - - if dValue != dMissing_value: - if dValue > dValue_max: - dValue = dValue_max - - if dValue < dValue_min: - dValue = dValue_min - - iColor_index = int( (dValue - dValue_min) / (dValue_max - dValue_min) * 255 ) - sColor = cmap(iColor_index) - else: - sColor = 'black' - - #pick color from colormap - - if sGeometry_type =='POINT': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - aCoords_gcs = aCoords_gcs[:,0:2] - ax.plot(aCoords_gcs[0], aCoords_gcs[1], 'o', color= sColor, markersize=2, transform=ccrs.Geodetic()) - else: - if sGeometry_type =='LINESTRING': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - aCoords_gcs = aCoords_gcs[:,0:2] - nvertex = len(aCoords_gcs) - codes = np.full(nvertex, mpath.Path.LINETO, dtype=int ) - codes[0] = mpath.Path.MOVETO - path = mpath.Path(aCoords_gcs, codes) - x, y = zip(*path.vertices) - line, = ax.plot(x, y, color= sColor, linewidth=iThickness, transform=ccrs.Geodetic()) - else: - if sGeometry_type == 'POLYGON': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs = np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - if iFlag_fill == 1: - polygon = mpatches.Polygon(aCoords_gcs[:,0:2], closed=True, linewidth=0.25, - alpha=0.8, edgecolor = sColor,facecolor= sColor, - transform=ccrs.Geodetic() ) - else: - polygon = mpatches.Polygon(aCoords_gcs[:,0:2], closed=True, linewidth=0.25, - alpha=0.8, edgecolor = sColor,facecolor='none', - transform=ccrs.Geodetic() ) - ax.add_patch(polygon) - else: - pass - - lID = lID + 1 - - - #reset extent - ax.set_extent( aExtent ) - - ax.coastlines(color='black', linewidth=1) - if iFlag_title==1: - ax.set_title(sTitle) - iFlag_label = 0 - if iFlag_label ==1: - sText = 'Manaus' - dLongitude_label = -60.016667 - dLatitude_label = -3.1 - ax.text(dLongitude_label, dLatitude_label, sText, - verticalalignment='center', horizontalalignment='center', - color='black', fontsize=iFont_size,transform=ccrs.Geodetic()) - - if aLegend_in is not None: - nlegend = len(aLegend_in) - dLocation0 = 0.96 - for i in range(nlegend): - sText = aLegend_in[i] - #dLocation = 0.06 + i * 0.04 - dLocation = dLocation0 - i * 0.06 - ax.text(0.03, dLocation, sText, - verticalalignment='top', horizontalalignment='left', - transform=ax.transAxes, - color='black', fontsize=iFont_size) - - pass - - - if iFlag_colorbar ==1: - ax_cb= fig.add_axes([0.75, 0.15, 0.02, 0.6]) - if iFlag_scientific_notation_colorbar==1: - formatter = OOMFormatter(fformat= "%1.1e") - cb = mpl.colorbar.ColorbarBase(ax_cb, orientation='vertical', - cmap=cmap, - norm=mpl.colors.Normalize(dValue_min, dValue_max), # vmax and vmin - extend=sExtend, format=formatter) - else: - formatter = OOMFormatter(fformat= "%1.1f") - cb = mpl.colorbar.ColorbarBase(ax_cb, orientation='vertical', - cmap=cmap, - norm=mpl.colors.Normalize(dValue_min, dValue_max), # vmax and vmin - extend=sExtend, format=formatter) - - cb.ax.get_yaxis().set_ticks_position('right') - cb.ax.get_yaxis().labelpad = 10 - cb.ax.set_ylabel(sUnit, rotation=270) - cb.ax.tick_params(labelsize=6) - - gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, - linewidth=1, color='gray', alpha=0.5, linestyle='--') - gl.xformatter = LONGITUDE_FORMATTER - gl.yformatter = LATITUDE_FORMATTER - - gl.xlabel_style = {'size': 10, 'color': 'k', 'rotation':0, 'ha':'right'} - gl.ylabel_style = {'size': 10, 'color': 'k', 'rotation':90,'weight': 'normal'} - - - - if iFlag_title==1: - ax.set_title( sTitle ) - else: - pass - - pDataset = pLayer = pFeature = None - if sFilename_output_in is None: - plt.show() - else: - sDirname = os.path.dirname(sFilename_output_in) - sFilename = os.path.basename(sFilename_output_in) - sFilename_out = os.path.join(sDirname, sFilename) - sExtension = os.path.splitext(sFilename)[1] - if sExtension == '.png': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - if sExtension == '.pdf': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - plt.savefig(sFilename_out, bbox_inches='tight', format ='ps') - - #clean cache - plt.close('all') - plt.clf() diff --git a/pyflowline/external/pyearth/visual/map/map_vector_polygon_data.py b/pyflowline/external/pyearth/visual/map/map_vector_polygon_data.py deleted file mode 100644 index ebd7c30..0000000 --- a/pyflowline/external/pyearth/visual/map/map_vector_polygon_data.py +++ /dev/null @@ -1,355 +0,0 @@ -import os -import numpy as np -from osgeo import osr, gdal, ogr -#from shapely.wkt import loads -import matplotlib as mpl -import matplotlib.pyplot as plt -import matplotlib.patches as mpatches -import matplotlib.cm as cm -import cartopy.crs as ccrs -from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER - -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords - -class OOMFormatter(mpl.ticker.ScalarFormatter): - def __init__(self, order=0, fformat="%1.1e", offset=True, mathText=True): - self.oom = order - self.fformat = fformat - mpl.ticker.ScalarFormatter.__init__(self,useOffset=offset,useMathText=mathText) - def _set_order_of_magnitude(self): - self.orderOfMagnitude = self.oom - def _set_format(self, vmin=None, vmax=None): - self.format = self.fformat - if self._useMathText: - self.format = r'$\mathdefault{%s}$' % self.format - -def map_vector_polygon_data(sFilename_in, - iFlag_color_in = None, - iFlag_colorbar_in = None, - sVariable_in = None, - sFilename_output_in=None, - iFlag_scientific_notation_colorbar_in=None, - iFont_size_in = None, - sColormap_in = None, - sTitle_in = None, - iDPI_in = None, - dMissing_value_in=None, - dData_max_in = None, - dData_min_in = None, - sExtend_in =None, - sFont_in = None, - sUnit_in=None, - aLegend_in = None, - aExtent_in = None, - pProjection_map_in=None): - """ - plot vector data on a map - currently only support geojson and shapefile - by default, the program will plot all the polygons in the file - in the furture, the program will support to plot only a subset of polygons - - Args: - iFiletype_in (_type_): _description_ - sFilename_in (_type_): _description_ - sFilename_output_in (_type_): _description_ - iFlag_scientific_notation_colorbar_in (_type_, optional): _description_. Defaults to None. - sColormap_in (_type_, optional): _description_. Defaults to None. - sTitle_in (_type_, optional): _description_. Defaults to None. - iDPI_in (_type_, optional): _description_. Defaults to None. - dMissing_value_in (_type_, optional): _description_. Defaults to None. - dData_max_in (_type_, optional): _description_. Defaults to None. - dData_min_in (_type_, optional): _description_. Defaults to None. - sExtend_in (_type_, optional): _description_. Defaults to None. - sUnit_in (_type_, optional): _description_. Defaults to None. - aLegend_in (_type_, optional): _description_. Defaults to None. - """ - - pDriver = ogr.GetDriverByName('GeoJSON') - - #check if the file exists - if os.path.isfile(sFilename_in): - pass - else: - print('The file does not exist: ', sFilename_in) - return - - pDataset = pDriver.Open(sFilename_in, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - - if iDPI_in is not None: - iDPI = iDPI_in - else: - iDPI = 300 - - if iFlag_color_in is not None: - iFlag_color = iFlag_color_in - else: - iFlag_color = 0 - - if iFlag_colorbar_in is not None: - iFlag_colorbar = iFlag_colorbar_in - else: - iFlag_colorbar = 0 - - if iFlag_colorbar == 1: #if colorbar is used, then the color is used - iFlag_color = 1 - - if iFont_size_in is not None: - iFont_size = iFont_size_in - else: - iFont_size = 12 - - if dMissing_value_in is not None: - dMissing_value = dMissing_value_in - else: - dMissing_value = -9999 - - if dData_min_in is not None: - iFlag_data_min = 1 - dData_min = dData_min_in - else: - iFlag_data_min = 0 - pass - - if dData_max_in is not None: - iFlag_data_max = 1 - dData_max = dData_max_in - else: - iFlag_data_max = 0 - pass - - if iFlag_scientific_notation_colorbar_in is not None: - iFlag_scientific_notation_colorbar = iFlag_scientific_notation_colorbar_in - else: - iFlag_scientific_notation_colorbar = 0 - - if sColormap_in is not None: - sColormap = sColormap_in - else: - sColormap = 'rainbow' - - if sTitle_in is not None: - sTitle = sTitle_in.capitalize() - iFlag_title =1 - else: - iFlag_title=0 - sTitle = '' - - if sExtend_in is not None: - sExtend = sExtend_in - else: - sExtend = 'max' - - if sUnit_in is not None: - sUnit = sUnit_in - else: - sUnit = '' - - if sFont_in is not None: - sFont = sFont_in - else: - sFont = "Times New Roman" - - plt.rcParams["font.family"] = sFont - - if sVariable_in is not None: - sVariable = sVariable_in - else: - sVariable = 'id' - - cmap = cm.get_cmap(sColormap) - - fig = plt.figure( dpi = iDPI ) - iSize_x= 8 - iSize_y= 8 - fig.set_figwidth( iSize_x ) - fig.set_figheight( iSize_y ) - - pLayer = pDataset.GetLayer(0) - pSrs = osr.SpatialReference() - pSrs.ImportFromEPSG(4326) # WGS84 lat/lon - dLat_min = 90 - dLat_max = -90 - dLon_min = 180 - dLon_max = -180 - - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - - if sGeometry_type =='POLYGON': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - dLon_max = np.max( [dLon_max, np.max(aCoords_gcs[:,0])] ) - dLon_min = np.min( [dLon_min, np.min(aCoords_gcs[:,0])] ) - dLat_max = np.max( [dLat_max, np.max(aCoords_gcs[:,1])] ) - dLat_min = np.min( [dLat_min, np.min(aCoords_gcs[:,1])] ) - - if iFlag_color == 1: - aValue = list() #this one need to be fixed - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - if sGeometry_type =='POLYGON': - dummy = float(pFeature.GetField(sVariable)) - aValue.append(dummy) - - aValue = np.array(aValue) - if iFlag_data_min == 1 and iFlag_data_max ==1: #both are provided - aValue = np.clip(aValue, dData_min, dData_max) - dValue_max = dData_max # np.max(aValue) - dValue_min = dData_min # np.min(aValue) - else: - aValue = aValue[aValue != dMissing_value] - dValue_max = np.max(aValue) - dValue_min = np.min(aValue) - pass - - if dValue_max == dValue_min: - iFlag_same_value = 1 - return - else: - iFlag_same_value = 0 - pass - - - cmap = cm.get_cmap(sColormap) - if pProjection_map_in is not None: - pProjection_map = pProjection_map_in - else: - pProjection_map = ccrs.Orthographic(central_longitude = 0.50*(dLon_max+dLon_min), central_latitude = 0.50*(dLat_max+dLat_min), globe=None) - - ax = fig.add_axes([0.08, 0.1, 0.62, 0.7], projection=pProjection_map ) - ax.set_global() - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - #get attribute - if iFlag_color ==1: - dValue = float(pFeature.GetField(sVariable)) - if dValue != dMissing_value: - if dValue > dValue_max: - dValue = dValue_max - if dValue < dValue_min: - dValue = dValue_min - - iColor_index = int( (dValue - dValue_min) / (dValue_max - dValue_min) * 255 ) - #pick color from colormap - sColor = cmap(iColor_index) - else: - sColor='black' - - if iFlag_color ==1: - if sGeometry_type =='POLYGON': - #old way that has a dependency on shapely - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) - #new method that use gdal directly - aCoords_gcs = get_geometry_coords(pGeometry_in) - polygon = mpatches.Polygon(aCoords_gcs[:,0:2], closed=True, linewidth=0.25, - alpha=0.8, edgecolor = sColor, - facecolor = sColor, - transform=ccrs.Geodetic() ) - - ax.add_patch(polygon) - else: - pass - else: - if sGeometry_type =='POLYGON': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - polygon = mpatches.Polygon(aCoords_gcs[:,0:2], - closed=True, - linewidth=0.25, - alpha=0.8, edgecolor = sColor, - facecolor = 'none', - transform= ccrs.Geodetic() ) - - ax.add_patch(polygon) - - if aExtent_in is None: - marginx = (dLon_max - dLon_min) / 50 - marginy = (dLat_max - dLat_min) / 50 - aExtent = [dLon_min - marginx , dLon_max + marginx , dLat_min -marginy , dLat_max + marginy] - else: - aExtent = aExtent_in - - ax.set_extent( aExtent ) - ax.coastlines(color='black', linewidth=1) - ax.set_title(sTitle) - if aLegend_in is not None: - nlegend = len(aLegend_in) - dLocation0 = 0.96 - for i in range(nlegend): - sText = aLegend_in[i] - #dLocation = 0.06 + i * 0.04 - dLocation = dLocation0 - i * 0.06 - ax.text(0.03, dLocation, sText, - verticalalignment='top', horizontalalignment='left', - transform=ax.transAxes, - color='black', fontsize=iFont_size) - - pass - - if iFlag_colorbar ==1: - ax_cb= fig.add_axes([0.75, 0.15, 0.02, 0.6]) - - if iFlag_scientific_notation_colorbar==1: - formatter = OOMFormatter(fformat= "%1.1e") - cb = mpl.colorbar.ColorbarBase(ax_cb, orientation='vertical', - cmap=cmap, - norm=mpl.colors.Normalize(dValue_min, dValue_max), # vmax and vmin - extend=sExtend, format=formatter) - else: - formatter = OOMFormatter(fformat= "%1.2f") - cb = mpl.colorbar.ColorbarBase(ax_cb, orientation='vertical', - cmap=cmap, - norm=mpl.colors.Normalize(dValue_min, dValue_max), # vmax and vmin - extend=sExtend, format=formatter) - - cb.ax.get_yaxis().set_ticks_position('right') - cb.ax.get_yaxis().labelpad = 5 - cb.ax.set_ylabel(sUnit, rotation=90) - cb.ax.get_yaxis().set_label_position('left') - cb.ax.tick_params(labelsize=6) - - gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, - linewidth=1, color='gray', alpha=0.5, linestyle='--') - - gl.xformatter = LONGITUDE_FORMATTER - gl.yformatter = LATITUDE_FORMATTER - - gl.xlabel_style = {'size': 10, 'color': 'k', 'rotation':0, 'ha':'right'} - gl.ylabel_style = {'size': 10, 'color': 'k', 'rotation':90,'weight': 'normal'} - - - if iFlag_title==1: - ax.set_title( sTitle ) - else: - pass - - pDataset = pLayer = pFeature = None - if sFilename_output_in is None: - plt.show() - else: - sDirname = os.path.dirname(sFilename_output_in) - sFilename = os.path.basename(sFilename_output_in) - sFilename_out = os.path.join(sDirname, sFilename) - sExtension = os.path.splitext(sFilename)[1] - if sExtension == '.png': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - if sExtension == '.pdf': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - plt.savefig(sFilename_out, bbox_inches='tight', format ='ps') - - #clean cache - plt.close('all') - plt.clf() diff --git a/pyflowline/external/pyearth/visual/map/map_vector_polyline_data.py b/pyflowline/external/pyearth/visual/map/map_vector_polyline_data.py deleted file mode 100644 index 596eb21..0000000 --- a/pyflowline/external/pyearth/visual/map/map_vector_polyline_data.py +++ /dev/null @@ -1,317 +0,0 @@ -import os -import numpy as np -from osgeo import osr, gdal, ogr -#from shapely.wkt import loads -import matplotlib.pyplot as plt -import matplotlib.cm as cm -import matplotlib as mpl -import matplotlib.ticker as mticker -import matplotlib.path as mpath -import cartopy.crs as ccrs -from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER -from pyflowline.external.pyearth.toolbox.math.stat.remap import remap -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords -class OOMFormatter(mpl.ticker.ScalarFormatter): - def __init__(self, order=0, fformat="%1.1e", offset=True, mathText=True): - self.oom = order - self.fformat = fformat - mpl.ticker.ScalarFormatter.__init__(self,useOffset=offset,useMathText=mathText) - def _set_order_of_magnitude(self): - self.orderOfMagnitude = self.oom - def _set_format(self, vmin=None, vmax=None): - self.format = self.fformat - if self._useMathText: - self.format = r'$ mathdefault{%s}$' % self.format - -def map_vector_polyline_data(sFilename_in, - sFilename_output_in= None, - iFlag_color_in = None, - iFlag_label_in = None, - iFlag_thickness_in =None, - iFont_size_in = None, - sField_thickness_in=None, - sField_color_in=None, - iFlag_scientific_notation_colorbar_in=None, - sColormap_in = None, - sTitle_in = None, - iDPI_in = None, - dMissing_value_in=None, - dData_max_in = None, - dData_min_in = None, - sFont_in = None, - sExtend_in =None, - sUnit_in=None, - aLegend_in = None, - aExtent_in = None, - pProjection_map_in = None): - """ - Map a vector polyline data - - Args: - iFiletype_in (int): _description_ - sFilename_in (_type_): _description_ - sFilename_output_in (_type_): _description_ - iFlag_thickness_in (_type_, optional): _description_. Defaults to None. - sField_thickness_in (_type_, optional): _description_. Defaults to None. - iFlag_scientific_notation_colorbar_in (_type_, optional): _description_. Defaults to None. - sColormap_in (_type_, optional): _description_. Defaults to None. - sTitle_in (_type_, optional): _description_. Defaults to None. - iDPI_in (_type_, optional): _description_. Defaults to None. - dMissing_value_in (_type_, optional): _description_. Defaults to None. - dData_max_in (_type_, optional): _description_. Defaults to None. - dData_min_in (_type_, optional): _description_. Defaults to None. - sFont_in (_type_, optional): _description_. Defaults to None. - sExtend_in (_type_, optional): _description_. Defaults to None. - sUnit_in (_type_, optional): _description_. Defaults to None. - aLegend_in (_type_, optional): _description_. Defaults to None. - aExtent_in (_type_, optional): _description_. Defaults to None. - pProjection_map_in (_type_, optional): _description_. Defaults to None. - """ - - if os.path.isfile(sFilename_in): - pass - else: - print('The file does not exist: ', sFilename_in) - return - - sFilename_out= sFilename_output_in - if iDPI_in is not None: - iDPI = iDPI_in - else: - iDPI = 300 - - if iFlag_scientific_notation_colorbar_in is not None: - iFlag_scientific_notation_colorbar = iFlag_scientific_notation_colorbar_in - else: - iFlag_scientific_notation_colorbar = 0 - - if iFlag_color_in is not None: - iFlag_color = iFlag_color_in - else: - iFlag_color = 0 - - if iFlag_thickness_in is not None: - iFlag_thickness = iFlag_thickness_in - else: - iFlag_thickness = 0 - - if iFont_size_in is not None: - iFont_size = iFont_size_in - else: - iFont_size = 12 - - if dData_min_in is not None: - iFlag_data_min = 1 - dData_min = dData_min_in - else: - iFlag_data_min = 0 - pass - - if dData_max_in is not None: - iFlag_data_max = 1 - dData_max = dData_max_in - else: - iFlag_data_max = 0 - pass - - if sField_thickness_in is not None: - sField_thickness = sField_thickness_in - else: - sField_thickness = '' - - pDriver = ogr.GetDriverByName('GeoJSON') - - pDataset = pDriver.Open(sFilename_in, gdal.GA_ReadOnly) - pLayer = pDataset.GetLayer(0) - - - if sColormap_in is not None: - sColormap = sColormap_in - else: - sColormap = 'Spectral' - - if sTitle_in is not None: - sTitle = sTitle_in - iFlag_title =1 - else: - iFlag_title=0 - sTitle = '' - - if sExtend_in is not None: - sExtend = sExtend_in - else: - sExtend = 'max' - - if sUnit_in is not None: - sUnit = sUnit_in - else: - sUnit = '' - - if sFont_in is not None: - sFont = sFont_in - else: - sFont = "Times New Roman" - - plt.rcParams["font.family"] = sFont - - cmap = cm.get_cmap(sColormap) - - pSrs = osr.SpatialReference() - pSrs.ImportFromEPSG(4326) # WGS84 lat/lon - - lID = 0 - dLat_min = 90 - dLat_max = -90 - dLon_min = 180 - dLon_max = -180 - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - - if sGeometry_type =='LINESTRING': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - aCoords_gcs = aCoords_gcs[:,0:2] - - dLon_max = np.max( [dLon_max, np.max(aCoords_gcs[:,0])] ) - dLon_min = np.min( [dLon_min, np.min(aCoords_gcs[:,0])] ) - dLat_max = np.max( [dLat_max, np.max(aCoords_gcs[:,1])] ) - dLat_min = np.min( [dLat_min, np.min(aCoords_gcs[:,1])] ) - - if pProjection_map_in is not None: - pProjection_map = pProjection_map_in - else: - pProjection_map = ccrs.Orthographic(central_longitude = 0.50*(dLon_max+dLon_min), - central_latitude = 0.50*(dLat_max+dLat_min), - globe=None) - - - fig = plt.figure( dpi = iDPI ) - iSize_x= 8 - iSize_y= 8 - fig.set_figwidth( iSize_x ) - fig.set_figheight( iSize_y ) - ax = fig.add_axes([0.1, 0.15, 0.75, 0.8] , projection=pProjection_map ) #request.crs - ax.set_global() - - nColor = pLayer.GetFeatureCount() - aColor = cm.rainbow(np.linspace(0, 1, nColor)) - - if iFlag_thickness ==1: - aValue =list() - for pFeature in pLayer: - dValue = pFeature.GetField(sField_thickness) - aValue.append(dValue) - pass - - aValue = np.array(aValue) - dValue_max = np.max(aValue) - dValue_min = np.min(aValue) - iThickness_max = 2.0 - iThickness_min = 0.3 - - for pFeature in pLayer: - pGeometry_in = pFeature.GetGeometryRef() - sGeometry_type = pGeometry_in.GetGeometryName() - if iFlag_thickness ==1: - dValue = pFeature.GetField(sField_thickness) - - if sGeometry_type =='LINESTRING': - #dummy0 = loads( pGeometry_in.ExportToWkt() ) - #aCoords_gcs = dummy0.coords - #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_in) - aCoords_gcs = aCoords_gcs[:,0:2] - nvertex = len(aCoords_gcs) - if nvertex == 2 : - dLon_label = 0.5 * (aCoords_gcs[0][0] + aCoords_gcs[1][0] ) - dLat_label = 0.5 * (aCoords_gcs[0][1] + aCoords_gcs[1][1] ) - else: - lIndex_mid = int(nvertex/2) - dLon_label = aCoords_gcs[lIndex_mid][0] - dLat_label = aCoords_gcs[lIndex_mid][1] - - codes = np.full(nvertex, mpath.Path.LINETO, dtype=int ) - codes[0] = mpath.Path.MOVETO - path = mpath.Path(aCoords_gcs, codes) - x, y = zip(*path.vertices) - - if iFlag_thickness ==1: - iThickness = remap( dValue, dValue_min, dValue_max, iThickness_min, iThickness_max ) - else: - iThickness = 1.0 - - if iFlag_color ==1: - if nColor < 10: - rgba = aColor[lID] - else: - iColor_index = (dValue-dValue_min ) /(dValue_max - dValue_min ) - rgba = cmap(iColor_index) - - else: - rgba='black' - - line, = ax.plot(x, y, color=rgba, linewidth=iThickness, transform=ccrs.Geodetic()) - lID = lID + 1 - - if aExtent_in is None: - marginx = (dLon_max - dLon_min) / 50 - marginy = (dLat_max - dLat_min) / 50 - aExtent = [dLon_min - marginx , dLon_max + marginx , dLat_min - marginy , dLat_max + marginy] - else: - aExtent = aExtent_in - - ax.set_extent(aExtent) - ax.coastlines(color='black', linewidth=1) - - if aLegend_in is not None: - nlegend = len(aLegend_in) - dLocation0 = 0.96 - for i in range(nlegend): - sText = aLegend_in[i] - dLocation = dLocation0 - i * 0.06 - ax.text(0.03, dLocation, sText, - verticalalignment='top', horizontalalignment='left', - transform=ax.transAxes, - color='black', - fontsize=iFont_size ) - - pass - - gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, - linewidth=1, color='gray', alpha=0.5, linestyle='--') - - gl.xformatter = LONGITUDE_FORMATTER - gl.yformatter = LATITUDE_FORMATTER - gl.xlocator = mticker.MaxNLocator(5) - gl.ylocator = mticker.MaxNLocator(5) - gl.xlabel_style = {'size': 8, 'color': 'k', 'rotation':0, 'ha':'right'} - gl.ylabel_style = {'size': 8, 'color': 'k', 'rotation':90,'weight': 'normal'} - - - if iFlag_title==1: - ax.set_title( sTitle ) - else: - pass - - - pDataset = pLayer = pFeature = None - if sFilename_output_in is None: - plt.show() - else: - sDirname = os.path.dirname(sFilename_output_in) - sFilename = os.path.basename(sFilename_output_in) - sFilename_out = os.path.join(sDirname, sFilename) - sExtension = os.path.splitext(sFilename)[1] - if sExtension == '.png': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - if sExtension == '.pdf': - plt.savefig(sFilename_out, bbox_inches='tight') - else: - plt.savefig(sFilename_out, bbox_inches='tight', format ='ps') - #clean - plt.close('all') - plt.clf() diff --git a/pyflowline/formats/convert_coordinates.py b/pyflowline/formats/convert_coordinates.py index 278ae7f..56d5ea6 100644 --- a/pyflowline/formats/convert_coordinates.py +++ b/pyflowline/formats/convert_coordinates.py @@ -10,14 +10,14 @@ from pyflowline.classes.tin import pytin from pyflowline.classes.dggrid import pydggrid -from pyflowline.external.pyearth.gis.gdal.gdal_functions import reproject_coordinates +from pyearth.gis.spatialref.reproject_coodinates import reproject_coordinates iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import calculate_angle_betwen_vertex from pyflowline.algorithms.cython.kernel import calculate_distance_to_plane -else: - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_angle_betwen_vertex - from pyflowline.external.pyearth.gis.gdal.gdal_functions import calculate_distance_to_plane +else: + from pyearth.gis.geometry.calculate_angle_betwen_vertex import calculate_angle_betwen_vertex + from pyearth.gis.geometry.calculate_distance_to_plane import calculate_distance_to_plane def convert_gcs_coordinates_to_cell(iMesh_type_in, dLongitude_center_in, diff --git a/pyflowline/formats/read_mesh.py b/pyflowline/formats/read_mesh.py index 8dbaafa..c77271c 100644 --- a/pyflowline/formats/read_mesh.py +++ b/pyflowline/formats/read_mesh.py @@ -3,7 +3,7 @@ from osgeo import ogr, gdal #from shapely.wkt import loads from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords +from pyearth.gis.location.get_geometry_coordinates import get_geometry_coordinates def read_mesh_json(iMesh_type_in, sFilename_mesh_in): """ convert a shpefile to json format. diff --git a/pyflowline/mesh/dggrid/create_dggrid_mesh.py b/pyflowline/mesh/dggrid/create_dggrid_mesh.py index 3cc816c..6d82bb7 100644 --- a/pyflowline/mesh/dggrid/create_dggrid_mesh.py +++ b/pyflowline/mesh/dggrid/create_dggrid_mesh.py @@ -9,9 +9,9 @@ #from shapely.wkt import loads from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell -from pyflowline.external.pyearth.system.define_global_variables import * +from pyearth.system.define_global_variables import * from pyflowline.formats.convert_attributes import convert_gcs_attributes_to_cell -from pyflowline.external.pyearth.gis.gdal.gdal_functions import get_geometry_coords +from pyearth.gis.location.get_geometry_coordinates import get_geometry_coordinates pDate = datetime.datetime.today() sDate_default = "{:04d}".format(pDate.year) + "{:02d}".format(pDate.month) + "{:02d}".format(pDate.day) diff --git a/pyflowline/mesh/hexagon/create_hexagon_mesh.py b/pyflowline/mesh/hexagon/create_hexagon_mesh.py index 8f561d3..0d42bca 100644 --- a/pyflowline/mesh/hexagon/create_hexagon_mesh.py +++ b/pyflowline/mesh/hexagon/create_hexagon_mesh.py @@ -8,7 +8,7 @@ from osgeo import ogr, osr from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell from pyflowline.algorithms.auxiliary.find_index_in_list import check_if_duplicates -from pyflowline.external.pyearth.gis.gdal.gdal_functions import reproject_coordinates_batch +from pyearth.gis.spatialref.reproject_coodinates import reproject_coordinates_batch def index_to_row_col(index, num_columns): index -= 1 # Adjust for 1-based indexing diff --git a/pyflowline/mesh/mpas/create_mpas_mesh.py b/pyflowline/mesh/mpas/create_mpas_mesh.py index 0269d95..70522ab 100644 --- a/pyflowline/mesh/mpas/create_mpas_mesh.py +++ b/pyflowline/mesh/mpas/create_mpas_mesh.py @@ -9,7 +9,7 @@ if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import convert_360_to_180 else: - from pyflowline.external.pyearth.gis.gdal.gdal_functions import convert_360_to_180 + from pyearth.gis.geometry.convert_longitude_range import convert_360_to_180 def create_mpas_mesh(iFlag_global_in, iFlag_use_mesh_dem, diff --git a/pyflowline/mesh/square/create_square_mesh.py b/pyflowline/mesh/square/create_square_mesh.py index cb0c05f..00e16d2 100644 --- a/pyflowline/mesh/square/create_square_mesh.py +++ b/pyflowline/mesh/square/create_square_mesh.py @@ -7,7 +7,7 @@ from osgeo import ogr, osr import numpy as np from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell -from pyflowline.external.pyearth.gis.gdal.gdal_functions import reproject_coordinates_batch +from pyearth.gis.spatialref.reproject_coodinates import reproject_coordinates_batch def index_to_row_col(index, num_columns): index -= 1 # Adjust for 1-based indexing diff --git a/pyflowline/mesh/tin/create_tin_mesh.py b/pyflowline/mesh/tin/create_tin_mesh.py index 6567b6e..69735e6 100644 --- a/pyflowline/mesh/tin/create_tin_mesh.py +++ b/pyflowline/mesh/tin/create_tin_mesh.py @@ -2,7 +2,7 @@ import numpy as np from osgeo import ogr, osr from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell -from pyflowline.external.pyearth.gis.gdal.gdal_functions import reproject_coordinates_batch +from pyearth.gis.spatialref.reproject_coodinates import reproject_coordinates_batch def create_tin_mesh(dX_left_in, dY_bot_in, dResolution_meter_in, From 4e26ebf9137b7fcbe3fb70919fefa02b29ddabc0 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Sat, 9 Dec 2023 11:31:02 -0800 Subject: [PATCH 03/15] fix minor issue with dggrid --- pyflowline/classes/_hpc.py | 105 +++--- pyflowline/classes/pycase.py | 299 +++++++++--------- pyflowline/mesh/dggrid/create_dggrid_mesh.py | 7 +- ...yflowline_read_model_configuration_file.py | 105 +++--- 4 files changed, 274 insertions(+), 242 deletions(-) diff --git a/pyflowline/classes/_hpc.py b/pyflowline/classes/_hpc.py index cc4eda3..79ef6a5 100644 --- a/pyflowline/classes/_hpc.py +++ b/pyflowline/classes/_hpc.py @@ -1,55 +1,62 @@ -import os, stat +import os +import stat from pathlib import Path + + def _pyflowline_create_hpc_job(self, sSlurm_in=None): """create a HPC job for this simulation """ os.chdir(self.sWorkspace_output) - - #part 1 python script - - sFilename_pyflowline = os.path.join(str(Path(self.sWorkspace_output)) , "run_pyflowline.py" ) + + # part 1 python script + + sFilename_pyflowline = os.path.join( + str(Path(self.sWorkspace_output)), "run_pyflowline.py") ofs_pyflowline = open(sFilename_pyflowline, 'w') - - sLine = '#!/qfs/people/liao313/.conda/envs/pyflowline/bin/' + 'python3' + '\n' - ofs_pyflowline.write(sLine) + + sLine = '#!/qfs/people/liao313/.conda/envs/pyflowline/bin/' + 'python3' + '\n' + ofs_pyflowline.write(sLine) sLine = 'from pyflowline.pyflowline_read_model_configuration_file import pyflowline_read_model_configuration_file' + '\n' - ofs_pyflowline.write(sLine) - sLine = 'sFilename_configuration_in = ' + '"' + self.sFilename_model_configuration + '"\n' ofs_pyflowline.write(sLine) - sLine = 'oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in,' \ - + 'iCase_index_in='+ str(self.iCase_index) + ',' \ - + 'dResolution_meter_in=' + "{:0f}".format(self.dResolution_meter)+ ',' \ - + 'sDate_in="'+ str(self.sDate) + '",' \ - + 'sMesh_type_in="'+ str(self.sMesh_type) +'"' \ - + ')' + '\n' + sLine = 'sFilename_configuration_in = ' + '"' + \ + self.sFilename_model_configuration + '"\n' + ofs_pyflowline.write(sLine) + sLine = 'oPyflowline = pyflowline_read_model_configuration_file(sFilename_configuration_in,'\ + + 'iCase_index_in=' + str(self.iCase_index) + ','\ + + 'iResolution_index_in=' + str(self.iResolution_index) + ','\ + + 'dResolution_meter_in=' + "{:0f}".format(self.dResolution_meter) + ','\ + + 'sDggrid_type_in="'+ str(self.sDggrid_type) + '",' \ + + 'sDate_in="' + str(self.sDate) + '",'\ + + 'sMesh_type_in="' + str(self.sMesh_type) + '"' + ')' + '\n' ofs_pyflowline.write(sLine) - - sLine = 'oPyflowline.setup()' + '\n' + + sLine = 'oPyflowline.pyflowline_setup()' + '\n' ofs_pyflowline.write(sLine) - - if self.iFlag_flowline ==1: - sLine = 'oPyflowline.flowline_simplification()' + '\n' - ofs_pyflowline.write(sLine) + + if self.iFlag_flowline == 1: + sLine = 'oPyflowline.pyflowline_flowline_simplification()' + '\n' + ofs_pyflowline.write(sLine) else: - pass - sLine = 'oPyflowline.mesh_generation()' + '\n' - ofs_pyflowline.write(sLine) - sLine = 'oPyflowline.reconstruct_topological_relationship()' + '\n' - ofs_pyflowline.write(sLine) + pass + sLine = 'oPyflowline.pyflowline_mesh_generation()' + '\n' + ofs_pyflowline.write(sLine) + sLine = 'oPyflowline.pyflowline_reconstruct_topological_relationship()' + '\n' + ofs_pyflowline.write(sLine) + + sLine = 'oPyflowline.pyflowline_analyze()' + '\n' + ofs_pyflowline.write(sLine) + + # sLine = 'oPyflowline.pyflowline_evaluate()' + '\n' + # ofs_pyflowline.write(sLine) - sLine = 'oPyflowline.analyze()' + '\n' - ofs_pyflowline.write(sLine) - - #sLine = 'oPyflowline.evaluate()' + '\n' - #ofs_pyflowline.write(sLine) - - sLine = 'oPyflowline.export()' + '\n' + sLine = 'oPyflowline.pyflowline_export()' + '\n' ofs_pyflowline.write(sLine) ofs_pyflowline.close() - os.chmod(sFilename_pyflowline, stat.S_IREAD | stat.S_IWRITE | stat.S_IXUSR) - - #part 2 bash script - sFilename_job = os.path.join(str(Path(self.sWorkspace_output) ) , "submit.job" ) + os.chmod(sFilename_pyflowline, stat.S_IREAD | stat.S_IWRITE | stat.S_IXUSR) + + # part 2 bash script + sFilename_job = os.path.join( + str(Path(self.sWorkspace_output)), "submit.job") ofs = open(sFilename_job, 'w') sLine = '#!/bin/bash\n' ofs.write(sLine) @@ -67,36 +74,36 @@ def _pyflowline_create_hpc_job(self, sSlurm_in=None): sSlurm = sSlurm_in else: sSlurm = 'slurm' - sLine = '#SBATCH --partition='+ sSlurm + '\n' + sLine = '#SBATCH --partition=' + sSlurm + '\n' ofs.write(sLine) sLine = '#SBATCH -o stdout.out\n' ofs.write(sLine) sLine = '#SBATCH -e stderr.err\n' - ofs.write(sLine) + ofs.write(sLine) sLine = 'module purge\n' ofs.write(sLine) sLine = 'module load gcc/8.1.0' + '\n' ofs.write(sLine) - - if self.iFlag_dggrid ==1: + + if self.iFlag_dggrid == 1: sLine = 'module load gdal/2.3.1' + '\n' ofs.write(sLine) - sLine = 'module load anaconda3/2019.03' + '\n' + sLine = 'module load python/miniconda4.12.0 ' + '\n' + ofs.write(sLine) + sLine = 'source /share/apps/python/miniconda4.12.0/etc/profile.d/conda.sh' + '\n' ofs.write(sLine) - sLine = 'source /share/apps/anaconda3/2019.03/etc/profile.d/conda.sh' + '\n' - ofs.write(sLine) sLine = 'conda activate hexwatershed' + '\n' ofs.write(sLine) sLine = 'cd $SLURM_SUBMIT_DIR\n' ofs.write(sLine) - sLine = 'JOB_DIRECTORY='+ self.sWorkspace_output + '\n' + sLine = 'JOB_DIRECTORY=' + self.sWorkspace_output + '\n' ofs.write(sLine) - sLine = 'cd $JOB_DIRECTORY' + '\n' + sLine = 'cd $JOB_DIRECTORY' + '\n' ofs.write(sLine) - sLine = 'python3 run_pyflowline.py' + '\n' + sLine = 'python3 run_pyflowline.py' + '\n' ofs.write(sLine) sLine = 'conda deactivate' + '\n' ofs.write(sLine) ofs.close() - return \ No newline at end of file + return diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 4cba971..0b20c1b 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -29,6 +29,7 @@ from pyearth.gis.gdal.read.raster.gdal_read_geotiff_file import gdal_read_geotiff_file from pyearth.gis.gdal.read.vector.gdal_read_geojson_boundary import gdal_read_geojson_boundary from pyearth.gis.spatialref.get_utm_spatial_reference import get_utm_spatial_reference +from pyearth.toolbox.data.geoparquet.convert_geojson_to_geoparquet import convert_geojson_to_geoparquet iFlag_kml = importlib.util.find_spec("simplekml") @@ -422,7 +423,7 @@ def __init__(self, aConfig_in, else: if not os.path.isfile(self.sFilename_dem ): #why DEM is required? print("The DEM file does not exist!") - exit() + #exit() self.aBasin = list() @@ -510,158 +511,162 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): sFilename_spatial_reference = self.sFilename_spatial_reference sFilename_mesh = self.sFilename_mesh - if iFlag_mesh_boundary ==1: - #create a polygon based on real boundary - pBoundary_wkt, aExtent = gdal_read_geojson_boundary(self.sFilename_mesh_boundary) - - if iMesh_type != 4: #not mpas - spatial_reference_target = osr.SpatialReference() - spatial_reference_target.ImportFromEPSG(4326) - - #check whether DEM exists - if os.path.isfile(sFilename_dem): - #dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, pSpatialRef_dem, pProjection, pGeotransform\ - # = retrieve_geotiff_metadata(sFilename_dem) - dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) - dPixelWidth = dummy['pixelWidth'] - pPixelHeight = dummy['pixelHeight'] - dOriginX = dummy['originX'] - dOriginY = dummy['originY'] - nrow = dummy['nrow'] - ncolumn = dummy['ncolumn'] - pSpatialRef_dem = dummy['spatialReference'] - pProjection= dummy['projection'] - pGeotransform = dummy['geotransform'] - - #lower left - dX_lowerleft = dOriginX - dY_lowerleft = dOriginY - (nrow+1) * dPixelWidth - dLongitude_left0, dLatitude_bot0= reproject_coordinates(dX_lowerleft, dY_lowerleft,pSpatialRef_dem, spatial_reference_target) - - #upper right - dX_upperright = dOriginX + (ncolumn +1) * dPixelWidth - dY_upperright = dOriginY - dLongitude_right0, dLatitude_top0= reproject_coordinates(dX_upperright, dY_upperright,pSpatialRef_dem, spatial_reference_target) - - #lower right - dX_lowerright = dOriginX + (ncolumn +1) * dPixelWidth - dY_lowerright = dOriginY - (nrow+1) * dPixelWidth - - dLongitude_right1, dLatitude_bot1= reproject_coordinates(dX_lowerright, dY_lowerright,pSpatialRef_dem, spatial_reference_target) - - #uppler left - dX_upperleft = dOriginX - dY_upperleft = dOriginY - dLongitude_left1, dLatitude_top1= reproject_coordinates(dX_upperleft, dY_upperleft, pSpatialRef_dem, spatial_reference_target) - - dLatitude_top = np.max([dLatitude_top0, dLatitude_top1]) - dLatitude_bot = np.min([dLatitude_bot0, dLatitude_bot1]) - - dLongitude_left = np.min([dLongitude_left0, dLongitude_left1]) - dLongitude_right = np.max([dLongitude_right0, dLongitude_right1]) - - dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) - #pass - - if dResolution_meter is None: - #not used - pass - else: - dResolution_degree = meter_to_degree(dResolution_meter, dLatitude_mean) - - dX_lowerleft = dOriginX - dY_upperleft = dOriginY - else: #use the spatial extent and utm zone to obatin the mesh boundary - dLongitude_left, dLongitude_right,dLatitude_bot, dLatitude_top = aExtent - dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) - dLongitude_mean = 0.5 * (dLongitude_left + dLongitude_right) + if iFlag_global ==1: #a global mesh does not require boundary + pass + else: - if iMesh_type == 3: #latlon + if iFlag_mesh_boundary ==1: + #create a polygon based on real boundary + pBoundary_wkt, aExtent = gdal_read_geojson_boundary(self.sFilename_mesh_boundary) + + if iMesh_type != 4: #not mpas + spatial_reference_target = osr.SpatialReference() + spatial_reference_target.ImportFromEPSG(4326) + + #check whether DEM exists + if os.path.isfile(sFilename_dem): + #dPixelWidth, pPixelHeight, dOriginX, dOriginY, nrow, ncolumn, pSpatialRef_dem, pProjection, pGeotransform\ + # = retrieve_geotiff_metadata(sFilename_dem) + dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) + dPixelWidth = dummy['pixelWidth'] + pPixelHeight = dummy['pixelHeight'] + dOriginX = dummy['originX'] + dOriginY = dummy['originY'] + nrow = dummy['nrow'] + ncolumn = dummy['ncolumn'] + pSpatialRef_dem = dummy['spatialReference'] + #pProjection= dummy['projection'] + #pGeotransform = dummy['geotransform'] + + #lower left + dX_lowerleft = dOriginX + dY_lowerleft = dOriginY + (nrow+1) * pPixelHeight + dLongitude_left0, dLatitude_bot0= reproject_coordinates(dX_lowerleft, dY_lowerleft,pSpatialRef_dem, spatial_reference_target) + + #upper right + dX_upperright = dOriginX + (ncolumn +1) * dPixelWidth + dY_upperright = dOriginY + dLongitude_right0, dLatitude_top0= reproject_coordinates(dX_upperright, dY_upperright,pSpatialRef_dem, spatial_reference_target) + + #lower right + dX_lowerright = dOriginX + (ncolumn +1) * dPixelWidth + dY_lowerright = dOriginY - (nrow+1) * dPixelWidth + + dLongitude_right1, dLatitude_bot1= reproject_coordinates(dX_lowerright, dY_lowerright,pSpatialRef_dem, spatial_reference_target) + + #uppler left + dX_upperleft = dOriginX + dY_upperleft = dOriginY + dLongitude_left1, dLatitude_top1= reproject_coordinates(dX_upperleft, dY_upperleft, pSpatialRef_dem, spatial_reference_target) + + dLatitude_top = np.max([dLatitude_top0, dLatitude_top1]) + dLatitude_bot = np.min([dLatitude_bot0, dLatitude_bot1]) + + dLongitude_left = np.min([dLongitude_left0, dLongitude_left1]) + dLongitude_right = np.max([dLongitude_right0, dLongitude_right1]) + + dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) + #pass - pass - else: if dResolution_meter is None: #not used pass else: dResolution_degree = meter_to_degree(dResolution_meter, dLatitude_mean) - pass - pUTM = get_utm_spatial_reference(dLongitude_mean) - - #calculate the lower left and upper right in utm projection - dX_lowerleft, dY_lowerleft = reproject_coordinates(dLongitude_left, dLatitude_bot, spatial_reference_target, pUTM) - - dX_lowerright, dY_lowerright = reproject_coordinates(dLongitude_right, dLatitude_bot, spatial_reference_target, pUTM) + dX_lowerleft = dOriginX + dY_upperleft = dOriginY + else: #use the spatial extent and utm zone to obatin the mesh boundary + dLongitude_left, dLongitude_right,dLatitude_bot, dLatitude_top = aExtent + dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) + dLongitude_mean = 0.5 * (dLongitude_left + dLongitude_right) - dX_upperright, dY_upperright = reproject_coordinates(dLongitude_right, dLatitude_top, spatial_reference_target, pUTM) + if iMesh_type == 3: #latlon - dX_upperleft, dY_upperright = reproject_coordinates(dLongitude_left, dLatitude_top, spatial_reference_target, pUTM) - - else: + pass + else: + if dResolution_meter is None: + #not used + pass + else: + dResolution_degree = meter_to_degree(dResolution_meter, dLatitude_mean) + pass - pass - else: - #if the boundary is not specified, a DEM file is required - if iMesh_type != 4: #mpas - spatial_reference_target = osr.SpatialReference() - spatial_reference_target.ImportFromEPSG(4326) - - #check whether DEM exists - if os.path.isfile(sFilename_dem): - dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) - dPixelWidth = dummy['pixelWidth'] - pPixelHeight = dummy['pixelHeight'] - dOriginX = dummy['originX'] - dOriginY = dummy['originY'] - nrow = dummy['nrow'] - ncolumn = dummy['ncolumn'] - pSpatialRef_dem = dummy['spatialReference'] - pProjection= dummy['projection'] - pGeotransform = dummy['geotransform'] - - #lower left - dX_lowerleft = dOriginX - dY_lowerleft = dOriginY - (nrow+1) * dPixelWidth - dLongitude_left0, dLatitude_bot0= reproject_coordinates(dX_lowerleft, dY_lowerleft,pSpatialRef_dem, spatial_reference_target) - - #upper right - dX_upperright = dOriginX + (ncolumn +1) * dPixelWidth - dY_upperright = dOriginY - dLongitude_right0, dLatitude_top0= reproject_coordinates(dX_upperright, dY_upperright,pSpatialRef_dem, spatial_reference_target) - - #lower right - dX_lowerright = dOriginX + (ncolumn +1) * dPixelWidth - dY_lowerright = dOriginY - (nrow+1) * dPixelWidth - - dLongitude_right1, dLatitude_bot1= reproject_coordinates(dX_lowerright, dY_lowerright,pSpatialRef_dem, spatial_reference_target) - - #uppler left - dX_upperleft = dOriginX - dY_upperleft = dOriginY - dLongitude_left1, dLatitude_top1= reproject_coordinates(dX_upperleft, dY_upperleft, pSpatialRef_dem, spatial_reference_target) - - dLatitude_top = np.max([dLatitude_top0, dLatitude_top1]) - dLatitude_bot = np.min([dLatitude_bot0, dLatitude_bot1]) - - dLongitude_left = np.min([dLongitude_left0, dLongitude_left1]) - dLongitude_right = np.max([dLongitude_right0, dLongitude_right1]) - - dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) - #pass - - if dResolution_meter < 0: - #not used - pass - else: - dResolution_degree = meter_to_degree(dResolution_meter, dLatitude_mean) + pUTM = get_utm_spatial_reference(dLongitude_mean) + + #calculate the lower left and upper right in utm projection + dX_lowerleft, dY_lowerleft = reproject_coordinates(dLongitude_left, dLatitude_bot, spatial_reference_target, pUTM) + + dX_lowerright, dY_lowerright = reproject_coordinates(dLongitude_right, dLatitude_bot, spatial_reference_target, pUTM) + + dX_upperright, dY_upperright = reproject_coordinates(dLongitude_right, dLatitude_top, spatial_reference_target, pUTM) + + dX_upperleft, dY_upperright = reproject_coordinates(dLongitude_left, dLatitude_top, spatial_reference_target, pUTM) - dX_lowerleft = dOriginX - dY_upperleft = dOriginY else: - print("Error: DEM file does not exist: " + sFilename_dem) - return - pass + + pass + else: + #if the boundary is not specified, a DEM file is required + if iMesh_type != 4: #mpas + spatial_reference_target = osr.SpatialReference() + spatial_reference_target.ImportFromEPSG(4326) + + #check whether DEM exists + if os.path.isfile(sFilename_dem): + dummy = gdal_read_geotiff_file(sFilename_dem, iFlag_metadata_only= 1) + dPixelWidth = dummy['pixelWidth'] + pPixelHeight = dummy['pixelHeight'] + dOriginX = dummy['originX'] + dOriginY = dummy['originY'] + nrow = dummy['nrow'] + ncolumn = dummy['ncolumn'] + pSpatialRef_dem = dummy['spatialReference'] + pProjection= dummy['projection'] + pGeotransform = dummy['geotransform'] + + #lower left + dX_lowerleft = dOriginX + dY_lowerleft = dOriginY - (nrow+1) * dPixelWidth + dLongitude_left0, dLatitude_bot0= reproject_coordinates(dX_lowerleft, dY_lowerleft,pSpatialRef_dem, spatial_reference_target) + + #upper right + dX_upperright = dOriginX + (ncolumn +1) * dPixelWidth + dY_upperright = dOriginY + dLongitude_right0, dLatitude_top0= reproject_coordinates(dX_upperright, dY_upperright,pSpatialRef_dem, spatial_reference_target) + + #lower right + dX_lowerright = dOriginX + (ncolumn +1) * dPixelWidth + dY_lowerright = dOriginY - (nrow+1) * dPixelWidth + + dLongitude_right1, dLatitude_bot1= reproject_coordinates(dX_lowerright, dY_lowerright,pSpatialRef_dem, spatial_reference_target) + + #uppler left + dX_upperleft = dOriginX + dY_upperleft = dOriginY + dLongitude_left1, dLatitude_top1= reproject_coordinates(dX_upperleft, dY_upperleft, pSpatialRef_dem, spatial_reference_target) + + dLatitude_top = np.max([dLatitude_top0, dLatitude_top1]) + dLatitude_bot = np.min([dLatitude_bot0, dLatitude_bot1]) + + dLongitude_left = np.min([dLongitude_left0, dLongitude_left1]) + dLongitude_right = np.max([dLongitude_right0, dLongitude_right1]) + + dLatitude_mean = 0.5 * (dLatitude_top + dLatitude_bot) + #pass + + if dResolution_meter < 0: + #not used + pass + else: + dResolution_degree = meter_to_degree(dResolution_meter, dLatitude_mean) + + dX_lowerleft = dOriginX + dY_upperleft = dOriginY + else: + print("Error: DEM file does not exist: " + sFilename_dem) + return + pass if iMesh_type ==1: #hexagon #hexagon edge @@ -699,8 +704,12 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): aHexagon = create_hexagon_mesh(iFlag_rotation, dX_lowerleft, dY_lowerleft, dResolution_meter, ncolumn, nrow, sFilename_mesh, sFilename_spatial_reference, pBoundary_wkt) + + pass + + self.aCell = aHexagon else: if iMesh_type ==2: #sqaure @@ -760,7 +769,6 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): self.aCell = aLatlon - else: if iMesh_type == 4: #mpas iFlag_use_mesh_dem = self.iFlag_use_mesh_dem @@ -822,8 +830,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): os.makedirs(sWorkspace_output) if iFlag_mesh_boundary ==1: - #create a polygon based on - + #create a polygon based on aDggrid = create_dggrid_mesh(iFlag_global, iFlag_save_mesh, @@ -839,8 +846,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): pass else: aDggrid = create_dggrid_mesh(iFlag_global, - iFlag_save_mesh, - dResolution_meter, + iFlag_save_mesh, sFilename_mesh, sWorkspace_output, iResolution_index_in= self.iResolution_index, @@ -869,6 +875,9 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): print('Unsupported mesh type?') return + + #no matter what type of mash, we will convert it to geoparquet for easy visualization + convert_geojson_to_geoparquet(sFilename_mesh, sFilename_mesh.replace('.geojson','.parquet')) else: pass diff --git a/pyflowline/mesh/dggrid/create_dggrid_mesh.py b/pyflowline/mesh/dggrid/create_dggrid_mesh.py index 6d82bb7..8c65edb 100644 --- a/pyflowline/mesh/dggrid/create_dggrid_mesh.py +++ b/pyflowline/mesh/dggrid/create_dggrid_mesh.py @@ -6,11 +6,10 @@ import datetime from shutil import copy2 from osgeo import osr, ogr, gdal -#from shapely.wkt import loads -from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell -from pyearth.system.define_global_variables import * +from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_cell from pyflowline.formats.convert_attributes import convert_gcs_attributes_to_cell +from pyearth.system.define_global_variables import * from pyearth.gis.location.get_geometry_coordinates import get_geometry_coordinates pDate = datetime.datetime.today() @@ -176,7 +175,7 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh #dummy0 = loads( pGeometry_mesh.ExportToWkt() ) #aCoords_gcs = dummy0.exterior.coords #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_mesh) + aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) dLongitude_center = np.mean(aCoords_gcs[:-1,0]) dLatitude_center = np.mean(aCoords_gcs[:-1,1]) diff --git a/pyflowline/pyflowline_read_model_configuration_file.py b/pyflowline/pyflowline_read_model_configuration_file.py index c01e74c..d9e0795 100644 --- a/pyflowline/pyflowline_read_model_configuration_file.py +++ b/pyflowline/pyflowline_read_model_configuration_file.py @@ -1,21 +1,25 @@ -import os +import os from pathlib import Path import datetime import json from pyflowline.classes.pycase import flowlinecase pDate = datetime.datetime.today() -sDate_default = "{:04d}".format(pDate.year) + "{:02d}".format(pDate.month) + "{:02d}".format(pDate.day) - -def pyflowline_read_model_configuration_file(sFilename_configuration_in, - iFlag_standalone_in= None, - iFlag_use_mesh_dem_in=None, - iCase_index_in=None, - dResolution_degree_in = None, - dResolution_meter_in = None, - sMesh_type_in = None, - sModel_in = None, - sDate_in = None, - sWorkspace_output_in = None): +sDate_default = "{:04d}".format( + pDate.year) + "{:02d}".format(pDate.month) + "{:02d}".format(pDate.day) + + +def pyflowline_read_model_configuration_file(sFilename_configuration_in, + iFlag_standalone_in=None, + iFlag_use_mesh_dem_in=None, + iCase_index_in=None, + iResolution_index_in = None, + dResolution_degree_in=None, + dResolution_meter_in=None, + sMesh_type_in=None, + sModel_in=None, + sDate_in=None, + sDggrid_type_in = None, + sWorkspace_output_in=None): """read a model configuration Args: @@ -37,24 +41,34 @@ def pyflowline_read_model_configuration_file(sFilename_configuration_in, if not os.path.isfile(sFilename_configuration_in): print(sFilename_configuration_in + ' does not exist') return - + # Opening JSON file with open(sFilename_configuration_in) as json_file: - aConfig = json.load(json_file) - - if iCase_index_in is not None: + aConfig = json.load(json_file) + + if iCase_index_in is not None: iCase_index = iCase_index_in - else: - iCase_index = int( aConfig['iCase_index']) + else: + iCase_index = int(aConfig['iCase_index']) - if iFlag_standalone_in is not None: + if iResolution_index_in is not None: + iResolution_index = iResolution_index_in + else: + if "iResolution_index" in aConfig: + iResolution_index = int( aConfig['iResolution_index']) + else: + iResolution_index = 10 + + pass + + if iFlag_standalone_in is not None: iFlag_standalone = iFlag_standalone_in - else: - iFlag_standalone = int( aConfig['iFlag_standalone']) + else: + iFlag_standalone = int(aConfig['iFlag_standalone']) - if iFlag_use_mesh_dem_in is not None: + if iFlag_use_mesh_dem_in is not None: iFlag_use_mesh_dem = iFlag_use_mesh_dem_in - else: + else: iFlag_use_mesh_dem = int(aConfig['iFlag_use_mesh_dem']) if sMesh_type_in is not None: @@ -62,7 +76,15 @@ def pyflowline_read_model_configuration_file(sFilename_configuration_in, else: sMesh_type = aConfig['sMesh_type'] pass - + + if sDggrid_type_in is not None: + sDggrid_type = sDggrid_type_in + else: + if "sDggrid_type" in aConfig: + sDggrid_type = aConfig["sDggrid_type"] + else: + sDggrid_type = 'ISEA3H' + if sModel_in is not None: sModel = sModel_in else: @@ -91,43 +113,38 @@ def pyflowline_read_model_configuration_file(sFilename_configuration_in, sWorkspace_output = sWorkspace_output_in else: sWorkspace_output = aConfig['sWorkspace_output'] - #try to create this output folder first using - + # try to create this output folder first using + try: print(sWorkspace_output) Path(sWorkspace_output).mkdir(parents=True, exist_ok=True) except ValueError: print("The specified output workspace cannot be created!") exit - - aConfig['iCase_index'] = iCase_index aConfig['iFlag_standalone'] = iFlag_standalone aConfig['iFlag_use_mesh_dem'] = iFlag_use_mesh_dem + aConfig["iResolution_index"] = iResolution_index aConfig['dResolution_degree'] = dResolution_degree aConfig['dResolution_meter'] = dResolution_meter aConfig['sDate'] = sDate aConfig['sModel'] = sModel aConfig['sMesh_type'] = sMesh_type + aConfig["sDggrid_type"] = sDggrid_type aConfig['sWorkspace_output'] = sWorkspace_output aConfig["sFilename_model_configuration"] = sFilename_configuration_in - - - #based on global variable, a few variables are calculate once - #calculate the modflow simulation period - #https://docs.python.org/3/library/datetime.html#datetime-objects - - - - #aConfig - - #simulation - + # based on global variable, a few variables are calculate once + # calculate the modflow simulation period + # https://docs.python.org/3/library/datetime.html#datetime-objects + + # aConfig + + # simulation + oPyflowline = flowlinecase(aConfig) - - - return oPyflowline \ No newline at end of file + + return oPyflowline From 230436c22edcee69699a525b70741543c0966c49 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Wed, 21 Feb 2024 22:22:23 -0800 Subject: [PATCH 04/15] relax vertex eq operator --- .../auxiliary/calculate_area_of_difference.py | 1 - .../temp.linux-x86_64-cpython-312/kernel.o | Bin 0 -> 184416 bytes pyflowline/algorithms/cython/kernel.cpp | 14639 ++++++++++------ .../intersect_flowline_with_flowline.py | 5 +- .../remove_returning_flowline.py | 46 +- pyflowline/classes/_visual_basin.py | 8 +- pyflowline/classes/basin.py | 7 +- pyflowline/classes/pycase.py | 8 +- pyflowline/classes/vertex.py | 23 +- .../tinyr/tinyr.o | Bin 0 -> 434232 bytes pyflowline/external/tinyr/tinyr/tinyr.c | 1836 +- pyflowline/formats/convert_coordinates.py | 7 +- pyflowline/formats/read_flowline.py | 26 +- pyflowline/formats/read_mesh.py | 4 +- 14 files changed, 10601 insertions(+), 6009 deletions(-) create mode 100644 pyflowline/algorithms/cython/build/temp.linux-x86_64-cpython-312/kernel.o create mode 100644 pyflowline/external/tinyr/build/temp.linux-x86_64-cpython-312/tinyr/tinyr.o diff --git a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py index f9b0b82..7fbdcb6 100644 --- a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py +++ b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py @@ -5,7 +5,6 @@ from pyflowline.algorithms.auxiliary.find_index_in_list import find_list_in_list -from pyearth.gis.geometry.calculate_angle_betwen_vertex_normal import calculate_angle_betwen_vertex_normal from pyearth.gis.geometry.calculate_polygon_area import calculate_polygon_area iFlag_cython = importlib.util.find_spec("cython") diff --git a/pyflowline/algorithms/cython/build/temp.linux-x86_64-cpython-312/kernel.o b/pyflowline/algorithms/cython/build/temp.linux-x86_64-cpython-312/kernel.o new file mode 100644 index 0000000000000000000000000000000000000000..5db51e035f1b99af0e6be36a743fc70eef1c4ca5 GIT binary patch literal 184416 zcmd?S33wIN`9Gep#&v?A#=6BCZE#H#H7ROyHNm-h(?&(Xf*1=T)(z{uilT_ky~;2K zQ>(4DwPI^4ty-;h1qoqa+<>~Hf{Jp-$Rbw2HNVg2J?G5Ky_o>o_WSht|9Ld`%$fIW z?|ILA-tC;Zp)N6~TVY{=`BzwQVnOg^atjJdXLa)*Y9v)tP*+eZu>0VdW%kp*rTX_^ z{adbo57EDe>E9#tZ-xFnO8*YfzsKs|D*gL?{d+uq%|F{crNJ$3np2qU<`jQ2w*}9Q zxz9Zb8p^WvuPGRPgtdQKssQ{LJJXi5@*r$i%C%>${c8(y;d9!HIUmQGyuxvp$44%9 zHrTV@=}|q{D!OiHU1srwVRe;l?R`c|4HJ&9ZLTS-t6p?{|5|5JZT~iB_H1we!bQur z)E2hcBNwrxo3M(imt6l+%$W_q>t3zgRK29ex@SS*hEL|2{(dr7)#v`G2$jFpVmEzM zV!Jm#g28YYyZXbho930wwVmtAin1K2ytG|B+KxcCzl`#4=<=u3Y`w6Q%e2|fDK)7# z+TUpj;ScS{tC!l&((4D?&AUib&Aam_vnk>9D2qF736p({ytV3<*iBmsHG*vgoUm$_ z*v{v+TUFVn`pfQH`xn^GB3*6!{hYZoF=4jte8K+iB`IoNT974V&8% zJ1aIg?)>X4+j;p+7Hj&bh@c5~Op#kt+_cJS+S1)hx1whgMm25ekvy(xOOchi3D0(B zak7u?ylASlGJ<5czSwU1tkBA=CybjaX&=OXb%y@Aya#k0G zmr&KIb8KfFCafsotVuZ8Vdut%$Ik6oCG{#gw3`+3%m@Kn*{0xtB~U0!qY_lWTvTE^ zOIU~Po?Pq~28M*HbI=@Av<=vHXBz8K6M%t&$~KQbVfx8*B>UQK z?@Zgco$aPp4?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chPNG!^iXA2>&H86#sHbW&O*2-+2BD$a^}RERwj@03lb(~)72vrZ{>Q_i`uAMr1@$nE5{MWS5|BC_t>2dt`jN@NEt9JjsmH)~X`j^kxZ;{_Osj{~s)#|4l9Qe_ga}@ zTF2%u-w%nm|M#}g|GxtMBfoQRxTf>WW$yJL_ptuYb`yU*|4l9Q-^KNhSO3m&{L50# z`j_uj#Pff+h5pk5{!`=lPmAMUzAqvE<=8l;%@*oDHaiA-TS5L^cOM%4jaeiG{Vmsi z%72Fbes3vt@t}W+xwzN*sik}$BVPT7A^&uAko}+T9@<~Wg~VfhI~1w8-ACHgN46r7 qAG^m8hirdYp1Kge)t0UF{ddWvPtDU9ko4m9U%1vsb+38T_WwVp2Rowx literal 0 HcmV?d00001 diff --git a/pyflowline/algorithms/cython/kernel.cpp b/pyflowline/algorithms/cython/kernel.cpp index c3f4f26..6971629 100644 --- a/pyflowline/algorithms/cython/kernel.cpp +++ b/pyflowline/algorithms/cython/kernel.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 3.0.8 */ /* BEGIN: Cython Metadata { @@ -17,20 +17,37 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.6+ or Python 3.3+. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 -#define CYTHON_FUTURE_DIVISION 0 +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif @@ -49,9 +66,7 @@ END: Cython Metadata */ #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG - #if PY_VERSION_HEX >= 0x02070000 - #define HAVE_LONG_LONG - #endif + #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG @@ -59,13 +74,19 @@ END: Cython Metadata */ #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_PYSTON 0 +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 @@ -90,10 +111,19 @@ END: Cython Metadata */ #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS @@ -101,46 +131,123 @@ END: Cython Metadata */ #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PYSTON_VERSION) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 1 +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -148,10 +255,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 @@ -195,16 +303,17 @@ END: Cython Metadata */ #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif - #if PY_VERSION_HEX < 0x02070000 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 @@ -213,10 +322,7 @@ END: Cython Metadata */ #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif - #if PY_VERSION_HEX < 0x02070000 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -240,29 +346,47 @@ END: Cython Metadata */ #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif - #if PY_VERSION_HEX >= 0x030B00A4 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) + #define CYTHON_FAST_PYCALL 1 #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 #endif - #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif - #if PY_VERSION_HEX >= 0x030B00A4 + #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) - #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 @@ -271,6 +395,10 @@ END: Cython Metadata */ #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" @@ -299,6 +427,17 @@ END: Cython Metadata */ #define CYTHON_RESTRICT #endif #endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) @@ -312,13 +451,16 @@ END: Cython Metadata */ # define CYTHON_UNUSED # endif #endif -#ifndef CYTHON_MAYBE_UNUSED_VAR +#ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) - template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } + template void CYTHON_UNUSED_VAR( const T& ) { } # else -# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED @@ -326,28 +468,59 @@ END: Cython Metadata */ # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned int uint32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int32 uint32_t; + typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else - #include + #include + typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) && __cplusplus >= 201103L - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #elif __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif #endif #endif #ifndef CYTHON_FALLTHROUGH @@ -357,13 +530,26 @@ END: Cython Metadata */ #define CYTHON_FALLTHROUGH #endif #endif - #if defined(__clang__ ) && defined(__apple_build_version__) + #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." @@ -387,91 +573,153 @@ class __Pyx_FakeReference { T *operator->() { return ptr; } T *operator&() { return ptr; } operator T&() { return *ptr; } - template bool operator ==(U other) { return *ptr == other; } - template bool operator !=(U other) { return *ptr != other; } + template bool operator ==(const U& other) const { return *ptr == other; } + template bool operator !=(const U& other) const { return *ptr != other; } + template bool operator==(const __Pyx_FakeReference& other) const { return *ptr == *other.ptr; } + template bool operator!=(const __Pyx_FakeReference& other) const { return *ptr != *other.ptr; } private: T *ptr; }; -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type -#if PY_VERSION_HEX >= 0x030B00A1 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { - PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; - PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; - const char *fn_cstr=NULL; - const char *name_cstr=NULL; - PyCodeObject* co=NULL; + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); - if (!(kwds=PyDict_New())) goto end; - if (!(argcount=PyLong_FromLong(a))) goto end; - if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; - if (!(posonlyargcount=PyLong_FromLong(0))) goto end; - if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; - if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; - if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; - if (!(nlocals=PyLong_FromLong(l))) goto end; - if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; - if (!(stacksize=PyLong_FromLong(s))) goto end; - if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; - if (!(flags=PyLong_FromLong(f))) goto end; - if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; - if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; - if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; - if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; - if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; - if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; - if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here - if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; - Py_XDECREF((PyObject*)co); - co = (PyCodeObject*)call_result; - call_result = NULL; - if (0) { - cleanup_code_too: - Py_XDECREF((PyObject*)co); - co = NULL; - } - end: - Py_XDECREF(kwds); - Py_XDECREF(argcount); - Py_XDECREF(posonlyargcount); - Py_XDECREF(kwonlyargcount); - Py_XDECREF(nlocals); - Py_XDECREF(stacksize); - Py_XDECREF(replace); - Py_XDECREF(call_result); - Py_XDECREF(empty); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } - return co; + return result; } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif - #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 @@ -485,6 +733,12 @@ class __Pyx_FakeReference { #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -499,31 +753,81 @@ class __Pyx_FakeReference { #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif -#if CYTHON_FAST_PYCCALL -#define __Pyx_PyFastCFunction_Check(func)\ - ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else -#define __Pyx_PyFastCFunction_Check(func) 0 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 - #define PyMem_RawMalloc(n) PyMem_Malloc(n) - #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) - #define PyMem_RawFree(p) PyMem_Free(p) -#endif -#if CYTHON_COMPILING_IN_PYSTON - #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif -#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 @@ -531,6 +835,22 @@ class __Pyx_FakeReference { #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 @@ -561,7 +881,29 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() @@ -573,34 +915,91 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} #else -#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) +#if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #else #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -610,11 +1009,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY @@ -625,14 +1024,20 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) @@ -661,8 +1066,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif #ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) @@ -672,15 +1083,42 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong @@ -692,6 +1130,9 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject @@ -709,11 +1150,6 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods @@ -758,12 +1194,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #define __PYX_EXTERN_C extern "C++" #endif #define __PYX_HAVE__kernel @@ -823,9 +1264,10 @@ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize @@ -843,9 +1285,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) @@ -853,11 +1295,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) +{ + const wchar_t *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#else +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } +#endif +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode @@ -883,8 +1336,54 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -905,7 +1404,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { - ascii_chars[c] = c; + ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); @@ -935,6 +1434,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -970,23 +1470,29 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime = NULL; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; +#endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; +static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; +/* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "kernel.pyx", - "stringsource", + "", }; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_opt_args_6kernel_find_vertex_in_list; @@ -1030,6 +1536,7 @@ struct __pyx_ctuple_double__and_double__and_double { double f1; double f2; }; +/* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ @@ -1038,11 +1545,11 @@ struct __pyx_ctuple_double__and_double__and_double { #endif #if CYTHON_REFNANNY typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; @@ -1052,28 +1559,40 @@ struct __pyx_ctuple_double__and_double__and_double { #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } -#else + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) @@ -1084,6 +1603,10 @@ struct __pyx_ctuple_double__and_double__and_double { #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ @@ -1095,6 +1618,57 @@ struct __pyx_ctuple_double__and_double__and_double { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); @@ -1102,9 +1676,76 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); @@ -1113,8 +1754,9 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* PyDictVersioning.proto */ @@ -1145,18 +1787,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -1195,63 +1837,61 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -#if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); -#else -#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif -#if CYTHON_FAST_PYCALL - static size_t __pyx_pyframe_localsplus_offset = 0; +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif // CYTHON_FAST_PYCALL #endif - -/* PyCFunctionFastCall.proto */ -#if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); -#else -#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif - -/* PyObjectCall2Args.proto */ -static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); +#endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); @@ -1268,7 +1908,15 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyIntCompare.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* MoveIfSupported.proto */ +#if CYTHON_USE_CPP_STD_MOVE + #include + #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x) +#else + #define __PYX_STD_MOVE_IF_SUPPORTED(x) x +#endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -1277,7 +1925,11 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -1289,87 +1941,183 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { /* PyFloatBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); -#else -#define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ - ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) - #endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif +static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check); #else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* py_abs.proto */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); #define __Pyx_PyNumber_Absolute(x)\ ((likely(PyLong_CheckExact(x))) ?\ - (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ + (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ PyNumber_Absolute(x)) #else #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) #endif -/* ListCompAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) @@ -1378,6 +2126,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; @@ -1391,13 +2140,14 @@ static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif @@ -1452,8 +2202,18 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); -/* CIntFromPy.proto */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); @@ -1464,30 +2224,36 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* #### Code section: module_declarations ### */ -/* Module declarations from 'cython' */ +/* Module declarations from "cython" */ -/* Module declarations from 'libcpp.vector' */ +/* Module declarations from "libcpp.vector" */ -/* Module declarations from 'libc.math' */ +/* Module declarations from "libc.math" */ -/* Module declarations from 'kernel' */ +/* Module declarations from "kernel" */ static double __pyx_v_6kernel_pi; static double __pyx_v_6kernel_dRadius; static PyObject *__pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(double, double, double, double, int __pyx_skip_dispatch); /*proto*/ @@ -1499,15 +2265,22 @@ static PyObject *__pyx_f_6kernel_angle_between_vectors_coordinates(double, doubl static __pyx_ctuple_double__and_double__and_double __pyx_f_6kernel_longlat_to_3d(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_6kernel_calculate_angle_betwen_vertex(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_6kernel_calculate_distance_to_plane(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ -static PyObject *__pyx_convert_vector_to_py_double(const std::vector &); /*proto*/ -static PyObject *__pyx_convert_vector_to_py_int(const std::vector &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_double(std::vector const &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_int(std::vector const &); /*proto*/ static std::vector __pyx_convert_vector_from_py_int(PyObject *); /*proto*/ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "kernel" extern int __pyx_module_is_main_kernel; int __pyx_module_is_main_kernel = 0; -/* Implementation of 'kernel' */ +/* Implementation of "kernel" */ +/* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_MemoryError; +/* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "*"; +static const char __pyx_k__2[] = "."; static const char __pyx_k_np[] = "np"; static const char __pyx_k_x1[] = "x1"; static const char __pyx_k_x2[] = "x2"; @@ -1515,10 +2288,12 @@ static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; static const char __pyx_k_z1[] = "z1"; static const char __pyx_k_z2[] = "z2"; +static const char __pyx_k__21[] = "?"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_RTree[] = "RTree"; static const char __pyx_k_array[] = "array"; @@ -1526,21 +2301,34 @@ static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_insert[] = "insert"; +static const char __pyx_k_kernel[] = "kernel"; static const char __pyx_k_search[] = "search"; static const char __pyx_k_argsort[] = "argsort"; static const char __pyx_k_max_cap[] = "max_cap"; static const char __pyx_k_min_cap[] = "min_cap"; static const char __pyx_k_pEdge_in[] = "pEdge_in"; static const char __pyx_k_aVertex_in[] = "aVertex_in"; +static const char __pyx_k_kernel_pyx[] = "kernel.pyx"; static const char __pyx_k_pVertex_in[] = "pVertex_in"; +static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_pVertex_end[] = "pVertex_end"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_dLongitude_in[] = "dLongitude_in"; static const char __pyx_k_dThreshold_in[] = "dThreshold_in"; +static const char __pyx_k_longlat_to_3d[] = "longlat_to_3d"; static const char __pyx_k_pVertex_start[] = "pVertex_start"; static const char __pyx_k_dLatitude_degree[] = "dLatitude_degree"; +static const char __pyx_k_add_unique_vertex[] = "add_unique_vertex"; static const char __pyx_k_dLongitude_degree[] = "dLongitude_degree"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_calculate_distance[] = "calculate_distance"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_convert_360_to_180[] = "convert_360_to_180"; static const char __pyx_k_dLatitude_degree_in[] = "dLatitude_degree_in"; +static const char __pyx_k_find_vertex_in_list[] = "find_vertex_in_list"; +static const char __pyx_k_find_vertex_on_edge[] = "find_vertex_on_edge"; static const char __pyx_k_check_vertex_on_edge[] = "check_vertex_on_edge"; static const char __pyx_k_dLatitude_degree1_in[] = "dLatitude_degree1_in"; static const char __pyx_k_dLatitude_degree2_in[] = "dLatitude_degree2_in"; @@ -1549,49 +2337,12 @@ static const char __pyx_k_dLongitude_degree_in[] = "dLongitude_degree_in"; static const char __pyx_k_dLongitude_degree1_in[] = "dLongitude_degree1_in"; static const char __pyx_k_dLongitude_degree2_in[] = "dLongitude_degree2_in"; static const char __pyx_k_dLongitude_degree3_in[] = "dLongitude_degree3_in"; +static const char __pyx_k_calculate_distance_to_plane[] = "calculate_distance_to_plane"; +static const char __pyx_k_calculate_angle_betwen_vertex[] = "calculate_angle_betwen_vertex"; static const char __pyx_k_pyflowline_external_tinyr_tinyr[] = "pyflowline.external.tinyr.tinyr.tinyr"; -static PyObject *__pyx_n_s_RTree; -static PyObject *__pyx_n_s_aVertex_in; -static PyObject *__pyx_n_s_argsort; -static PyObject *__pyx_n_s_array; -static PyObject *__pyx_n_s_calculate_distance; -static PyObject *__pyx_n_s_check_vertex_on_edge; -static PyObject *__pyx_n_s_cline_in_traceback; -static PyObject *__pyx_n_s_dLatitude_degree; -static PyObject *__pyx_n_s_dLatitude_degree1_in; -static PyObject *__pyx_n_s_dLatitude_degree2_in; -static PyObject *__pyx_n_s_dLatitude_degree3_in; -static PyObject *__pyx_n_s_dLatitude_degree_in; -static PyObject *__pyx_n_s_dLongitude_degree; -static PyObject *__pyx_n_s_dLongitude_degree1_in; -static PyObject *__pyx_n_s_dLongitude_degree2_in; -static PyObject *__pyx_n_s_dLongitude_degree3_in; -static PyObject *__pyx_n_s_dLongitude_degree_in; -static PyObject *__pyx_n_s_dThreshold_in; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_insert; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_max; -static PyObject *__pyx_n_s_max_cap; -static PyObject *__pyx_n_s_min; -static PyObject *__pyx_n_s_min_cap; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_pEdge_in; -static PyObject *__pyx_n_s_pVertex_end; -static PyObject *__pyx_n_s_pVertex_in; -static PyObject *__pyx_n_s_pVertex_start; -static PyObject *__pyx_n_s_pyflowline_external_tinyr_tinyr; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_search; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_x1; -static PyObject *__pyx_n_s_x2; -static PyObject *__pyx_n_s_y1; -static PyObject *__pyx_n_s_y2; -static PyObject *__pyx_n_s_z1; -static PyObject *__pyx_n_s_z2; +static const char __pyx_k_angle_between_vectors_coordinate[] = "angle_between_vectors_coordinates"; +static const char __pyx_k_calculate_distance_based_on_long[] = "calculate_distance_based_on_longitude_latitude"; +/* #### Code section: decls ### */ static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in); /* proto */ static PyObject *__pyx_pf_6kernel_2convert_360_to_180(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_in); /* proto */ static PyObject *__pyx_pf_6kernel_4find_vertex_in_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, double __pyx_v_dThreshold_in); /* proto */ @@ -1601,1102 +2352,1418 @@ static PyObject *__pyx_pf_6kernel_10angle_between_vectors_coordinates(CYTHON_UNU static PyObject *__pyx_pf_6kernel_12longlat_to_3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree_in, PyObject *__pyx_v_dLatitude_degree_in); /* proto */ static PyObject *__pyx_pf_6kernel_14calculate_angle_betwen_vertex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in); /* proto */ static PyObject *__pyx_pf_6kernel_16calculate_distance_to_plane(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in); /* proto */ -static PyObject *__pyx_float_1_0; -static PyObject *__pyx_float_180_0; -static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_5; -/* Late includes */ +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + PyObject *__pyx_n_s_; + PyObject *__pyx_n_s_MemoryError; + PyObject *__pyx_n_s_RTree; + PyObject *__pyx_kp_u__2; + PyObject *__pyx_n_s__21; + PyObject *__pyx_n_s_aVertex_in; + PyObject *__pyx_n_s_add_unique_vertex; + PyObject *__pyx_n_s_angle_between_vectors_coordinate; + PyObject *__pyx_n_s_argsort; + PyObject *__pyx_n_s_array; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_calculate_angle_betwen_vertex; + PyObject *__pyx_n_s_calculate_distance; + PyObject *__pyx_n_s_calculate_distance_based_on_long; + PyObject *__pyx_n_s_calculate_distance_to_plane; + PyObject *__pyx_n_s_check_vertex_on_edge; + PyObject *__pyx_n_s_class_getitem; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_convert_360_to_180; + PyObject *__pyx_n_s_dLatitude_degree; + PyObject *__pyx_n_s_dLatitude_degree1_in; + PyObject *__pyx_n_s_dLatitude_degree2_in; + PyObject *__pyx_n_s_dLatitude_degree3_in; + PyObject *__pyx_n_s_dLatitude_degree_in; + PyObject *__pyx_n_s_dLongitude_degree; + PyObject *__pyx_n_s_dLongitude_degree1_in; + PyObject *__pyx_n_s_dLongitude_degree2_in; + PyObject *__pyx_n_s_dLongitude_degree3_in; + PyObject *__pyx_n_s_dLongitude_degree_in; + PyObject *__pyx_n_s_dLongitude_in; + PyObject *__pyx_n_s_dThreshold_in; + PyObject *__pyx_n_s_find_vertex_in_list; + PyObject *__pyx_n_s_find_vertex_on_edge; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_insert; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_n_s_kernel; + PyObject *__pyx_kp_s_kernel_pyx; + PyObject *__pyx_n_s_longlat_to_3d; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_max; + PyObject *__pyx_n_s_max_cap; + PyObject *__pyx_n_s_min; + PyObject *__pyx_n_s_min_cap; + PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_np; + PyObject *__pyx_n_s_numpy; + PyObject *__pyx_n_s_pEdge_in; + PyObject *__pyx_n_s_pVertex_end; + PyObject *__pyx_n_s_pVertex_in; + PyObject *__pyx_n_s_pVertex_start; + PyObject *__pyx_n_s_pyflowline_external_tinyr_tinyr; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_search; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_x1; + PyObject *__pyx_n_s_x2; + PyObject *__pyx_n_s_y1; + PyObject *__pyx_n_s_y2; + PyObject *__pyx_n_s_z1; + PyObject *__pyx_n_s_z2; + PyObject *__pyx_float_1_0; + PyObject *__pyx_float_180_0; + PyObject *__pyx_float_1_0Eneg_6; + PyObject *__pyx_int_1; + PyObject *__pyx_int_2; + PyObject *__pyx_int_5; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__7; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__10; + PyObject *__pyx_tuple__13; + PyObject *__pyx_tuple__14; + PyObject *__pyx_tuple__16; + PyObject *__pyx_tuple__18; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_codeobj__6; + PyObject *__pyx_codeobj__8; + PyObject *__pyx_codeobj__11; + PyObject *__pyx_codeobj__12; + PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__19; + PyObject *__pyx_codeobj__20; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif -/* "kernel.pyx":17 +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_n_s_); + Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); + Py_CLEAR(clear_module_state->__pyx_n_s_RTree); + Py_CLEAR(clear_module_state->__pyx_kp_u__2); + Py_CLEAR(clear_module_state->__pyx_n_s__21); + Py_CLEAR(clear_module_state->__pyx_n_s_aVertex_in); + Py_CLEAR(clear_module_state->__pyx_n_s_add_unique_vertex); + Py_CLEAR(clear_module_state->__pyx_n_s_angle_between_vectors_coordinate); + Py_CLEAR(clear_module_state->__pyx_n_s_argsort); + Py_CLEAR(clear_module_state->__pyx_n_s_array); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_calculate_angle_betwen_vertex); + Py_CLEAR(clear_module_state->__pyx_n_s_calculate_distance); + Py_CLEAR(clear_module_state->__pyx_n_s_calculate_distance_based_on_long); + Py_CLEAR(clear_module_state->__pyx_n_s_calculate_distance_to_plane); + Py_CLEAR(clear_module_state->__pyx_n_s_check_vertex_on_edge); + Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_convert_360_to_180); + Py_CLEAR(clear_module_state->__pyx_n_s_dLatitude_degree); + Py_CLEAR(clear_module_state->__pyx_n_s_dLatitude_degree1_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLatitude_degree2_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLatitude_degree3_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLatitude_degree_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_degree); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_degree1_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_degree2_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_degree3_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_degree_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dLongitude_in); + Py_CLEAR(clear_module_state->__pyx_n_s_dThreshold_in); + Py_CLEAR(clear_module_state->__pyx_n_s_find_vertex_in_list); + Py_CLEAR(clear_module_state->__pyx_n_s_find_vertex_on_edge); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_insert); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_n_s_kernel); + Py_CLEAR(clear_module_state->__pyx_kp_s_kernel_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_longlat_to_3d); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_max); + Py_CLEAR(clear_module_state->__pyx_n_s_max_cap); + Py_CLEAR(clear_module_state->__pyx_n_s_min); + Py_CLEAR(clear_module_state->__pyx_n_s_min_cap); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_np); + Py_CLEAR(clear_module_state->__pyx_n_s_numpy); + Py_CLEAR(clear_module_state->__pyx_n_s_pEdge_in); + Py_CLEAR(clear_module_state->__pyx_n_s_pVertex_end); + Py_CLEAR(clear_module_state->__pyx_n_s_pVertex_in); + Py_CLEAR(clear_module_state->__pyx_n_s_pVertex_start); + Py_CLEAR(clear_module_state->__pyx_n_s_pyflowline_external_tinyr_tinyr); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_search); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_x1); + Py_CLEAR(clear_module_state->__pyx_n_s_x2); + Py_CLEAR(clear_module_state->__pyx_n_s_y1); + Py_CLEAR(clear_module_state->__pyx_n_s_y2); + Py_CLEAR(clear_module_state->__pyx_n_s_z1); + Py_CLEAR(clear_module_state->__pyx_n_s_z2); + Py_CLEAR(clear_module_state->__pyx_float_1_0); + Py_CLEAR(clear_module_state->__pyx_float_180_0); + Py_CLEAR(clear_module_state->__pyx_float_1_0Eneg_6); + Py_CLEAR(clear_module_state->__pyx_int_1); + Py_CLEAR(clear_module_state->__pyx_int_2); + Py_CLEAR(clear_module_state->__pyx_int_5); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__10); + Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_tuple__14); + Py_CLEAR(clear_module_state->__pyx_tuple__16); + Py_CLEAR(clear_module_state->__pyx_tuple__18); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_codeobj__6); + Py_CLEAR(clear_module_state->__pyx_codeobj__8); + Py_CLEAR(clear_module_state->__pyx_codeobj__11); + Py_CLEAR(clear_module_state->__pyx_codeobj__12); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__19); + Py_CLEAR(clear_module_state->__pyx_codeobj__20); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_n_s_); + Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); + Py_VISIT(traverse_module_state->__pyx_n_s_RTree); + Py_VISIT(traverse_module_state->__pyx_kp_u__2); + Py_VISIT(traverse_module_state->__pyx_n_s__21); + Py_VISIT(traverse_module_state->__pyx_n_s_aVertex_in); + Py_VISIT(traverse_module_state->__pyx_n_s_add_unique_vertex); + Py_VISIT(traverse_module_state->__pyx_n_s_angle_between_vectors_coordinate); + Py_VISIT(traverse_module_state->__pyx_n_s_argsort); + Py_VISIT(traverse_module_state->__pyx_n_s_array); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_calculate_angle_betwen_vertex); + Py_VISIT(traverse_module_state->__pyx_n_s_calculate_distance); + Py_VISIT(traverse_module_state->__pyx_n_s_calculate_distance_based_on_long); + Py_VISIT(traverse_module_state->__pyx_n_s_calculate_distance_to_plane); + Py_VISIT(traverse_module_state->__pyx_n_s_check_vertex_on_edge); + Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_convert_360_to_180); + Py_VISIT(traverse_module_state->__pyx_n_s_dLatitude_degree); + Py_VISIT(traverse_module_state->__pyx_n_s_dLatitude_degree1_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLatitude_degree2_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLatitude_degree3_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLatitude_degree_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_degree); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_degree1_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_degree2_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_degree3_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_degree_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dLongitude_in); + Py_VISIT(traverse_module_state->__pyx_n_s_dThreshold_in); + Py_VISIT(traverse_module_state->__pyx_n_s_find_vertex_in_list); + Py_VISIT(traverse_module_state->__pyx_n_s_find_vertex_on_edge); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_insert); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_n_s_kernel); + Py_VISIT(traverse_module_state->__pyx_kp_s_kernel_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_longlat_to_3d); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_max); + Py_VISIT(traverse_module_state->__pyx_n_s_max_cap); + Py_VISIT(traverse_module_state->__pyx_n_s_min); + Py_VISIT(traverse_module_state->__pyx_n_s_min_cap); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_np); + Py_VISIT(traverse_module_state->__pyx_n_s_numpy); + Py_VISIT(traverse_module_state->__pyx_n_s_pEdge_in); + Py_VISIT(traverse_module_state->__pyx_n_s_pVertex_end); + Py_VISIT(traverse_module_state->__pyx_n_s_pVertex_in); + Py_VISIT(traverse_module_state->__pyx_n_s_pVertex_start); + Py_VISIT(traverse_module_state->__pyx_n_s_pyflowline_external_tinyr_tinyr); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_search); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_x1); + Py_VISIT(traverse_module_state->__pyx_n_s_x2); + Py_VISIT(traverse_module_state->__pyx_n_s_y1); + Py_VISIT(traverse_module_state->__pyx_n_s_y2); + Py_VISIT(traverse_module_state->__pyx_n_s_z1); + Py_VISIT(traverse_module_state->__pyx_n_s_z2); + Py_VISIT(traverse_module_state->__pyx_float_1_0); + Py_VISIT(traverse_module_state->__pyx_float_180_0); + Py_VISIT(traverse_module_state->__pyx_float_1_0Eneg_6); + Py_VISIT(traverse_module_state->__pyx_int_1); + Py_VISIT(traverse_module_state->__pyx_int_2); + Py_VISIT(traverse_module_state->__pyx_int_5); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__10); + Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_tuple__14); + Py_VISIT(traverse_module_state->__pyx_tuple__16); + Py_VISIT(traverse_module_state->__pyx_tuple__18); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_codeobj__6); + Py_VISIT(traverse_module_state->__pyx_codeobj__8); + Py_VISIT(traverse_module_state->__pyx_codeobj__11); + Py_VISIT(traverse_module_state->__pyx_codeobj__12); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__19); + Py_VISIT(traverse_module_state->__pyx_codeobj__20); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_ +#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError +#define __pyx_n_s_RTree __pyx_mstate_global->__pyx_n_s_RTree +#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 +#define __pyx_n_s__21 __pyx_mstate_global->__pyx_n_s__21 +#define __pyx_n_s_aVertex_in __pyx_mstate_global->__pyx_n_s_aVertex_in +#define __pyx_n_s_add_unique_vertex __pyx_mstate_global->__pyx_n_s_add_unique_vertex +#define __pyx_n_s_angle_between_vectors_coordinate __pyx_mstate_global->__pyx_n_s_angle_between_vectors_coordinate +#define __pyx_n_s_argsort __pyx_mstate_global->__pyx_n_s_argsort +#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_calculate_angle_betwen_vertex __pyx_mstate_global->__pyx_n_s_calculate_angle_betwen_vertex +#define __pyx_n_s_calculate_distance __pyx_mstate_global->__pyx_n_s_calculate_distance +#define __pyx_n_s_calculate_distance_based_on_long __pyx_mstate_global->__pyx_n_s_calculate_distance_based_on_long +#define __pyx_n_s_calculate_distance_to_plane __pyx_mstate_global->__pyx_n_s_calculate_distance_to_plane +#define __pyx_n_s_check_vertex_on_edge __pyx_mstate_global->__pyx_n_s_check_vertex_on_edge +#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_convert_360_to_180 __pyx_mstate_global->__pyx_n_s_convert_360_to_180 +#define __pyx_n_s_dLatitude_degree __pyx_mstate_global->__pyx_n_s_dLatitude_degree +#define __pyx_n_s_dLatitude_degree1_in __pyx_mstate_global->__pyx_n_s_dLatitude_degree1_in +#define __pyx_n_s_dLatitude_degree2_in __pyx_mstate_global->__pyx_n_s_dLatitude_degree2_in +#define __pyx_n_s_dLatitude_degree3_in __pyx_mstate_global->__pyx_n_s_dLatitude_degree3_in +#define __pyx_n_s_dLatitude_degree_in __pyx_mstate_global->__pyx_n_s_dLatitude_degree_in +#define __pyx_n_s_dLongitude_degree __pyx_mstate_global->__pyx_n_s_dLongitude_degree +#define __pyx_n_s_dLongitude_degree1_in __pyx_mstate_global->__pyx_n_s_dLongitude_degree1_in +#define __pyx_n_s_dLongitude_degree2_in __pyx_mstate_global->__pyx_n_s_dLongitude_degree2_in +#define __pyx_n_s_dLongitude_degree3_in __pyx_mstate_global->__pyx_n_s_dLongitude_degree3_in +#define __pyx_n_s_dLongitude_degree_in __pyx_mstate_global->__pyx_n_s_dLongitude_degree_in +#define __pyx_n_s_dLongitude_in __pyx_mstate_global->__pyx_n_s_dLongitude_in +#define __pyx_n_s_dThreshold_in __pyx_mstate_global->__pyx_n_s_dThreshold_in +#define __pyx_n_s_find_vertex_in_list __pyx_mstate_global->__pyx_n_s_find_vertex_in_list +#define __pyx_n_s_find_vertex_on_edge __pyx_mstate_global->__pyx_n_s_find_vertex_on_edge +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_insert __pyx_mstate_global->__pyx_n_s_insert +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_n_s_kernel __pyx_mstate_global->__pyx_n_s_kernel +#define __pyx_kp_s_kernel_pyx __pyx_mstate_global->__pyx_kp_s_kernel_pyx +#define __pyx_n_s_longlat_to_3d __pyx_mstate_global->__pyx_n_s_longlat_to_3d +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max +#define __pyx_n_s_max_cap __pyx_mstate_global->__pyx_n_s_max_cap +#define __pyx_n_s_min __pyx_mstate_global->__pyx_n_s_min +#define __pyx_n_s_min_cap __pyx_mstate_global->__pyx_n_s_min_cap +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np +#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy +#define __pyx_n_s_pEdge_in __pyx_mstate_global->__pyx_n_s_pEdge_in +#define __pyx_n_s_pVertex_end __pyx_mstate_global->__pyx_n_s_pVertex_end +#define __pyx_n_s_pVertex_in __pyx_mstate_global->__pyx_n_s_pVertex_in +#define __pyx_n_s_pVertex_start __pyx_mstate_global->__pyx_n_s_pVertex_start +#define __pyx_n_s_pyflowline_external_tinyr_tinyr __pyx_mstate_global->__pyx_n_s_pyflowline_external_tinyr_tinyr +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_search __pyx_mstate_global->__pyx_n_s_search +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1 +#define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2 +#define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 +#define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2 +#define __pyx_n_s_z1 __pyx_mstate_global->__pyx_n_s_z1 +#define __pyx_n_s_z2 __pyx_mstate_global->__pyx_n_s_z2 +#define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0 +#define __pyx_float_180_0 __pyx_mstate_global->__pyx_float_180_0 +#define __pyx_float_1_0Eneg_6 __pyx_mstate_global->__pyx_float_1_0Eneg_6 +#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 +#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 +#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 +#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 +#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 +#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 +#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 +#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 +#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 +/* #### Code section: module_code ### */ + +/* "vector.to_py":66 * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< - * """ - * Calculate the great circle distance between two points + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(const vector[X]& v): # <<<<<<<<<<<<<< + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() */ -static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in, CYTHON_UNUSED int __pyx_skip_dispatch) { - double __pyx_v_dLongitude_radian1_in; - double __pyx_v_dLatitude_radian1_in; - double __pyx_v_dLongitude_radian2_in; - double __pyx_v_dLatitude_radian2_in; - double __pyx_v_dLongtitude_diff; - double __pyx_v_dLatitude_diff; - double __pyx_v_a; - double __pyx_v_b; - double __pyx_v_c; +static PyObject *__pyx_convert_vector_to_py_double(std::vector const &__pyx_v_v) { + Py_ssize_t __pyx_v_v_size_signed; + PyObject *__pyx_v_o = NULL; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude", 0); + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 1); - /* "kernel.pyx":30 - * # Radius of earth in kilometers. Use 3956 for miles + /* "vector.to_py":67 + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: # <<<<<<<<<<<<<< + * raise MemoryError() + * v_size_signed = v.size() + */ + __pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX)); + if (unlikely(__pyx_t_1)) { + + /* "vector.to_py":68 + * cdef object __pyx_convert_vector_to_py_double(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() # <<<<<<<<<<<<<< + * v_size_signed = v.size() * - * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi # <<<<<<<<<<<<<< - * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi - * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi */ - __pyx_v_dLongitude_radian1_in = ((__pyx_v_dLongitude_degree1_in / 180.0) * __pyx_v_6kernel_pi); + PyErr_NoMemory(); __PYX_ERR(1, 68, __pyx_L1_error) - /* "kernel.pyx":31 + /* "vector.to_py":67 + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: # <<<<<<<<<<<<<< + * raise MemoryError() + * v_size_signed = v.size() + */ + } + + /* "vector.to_py":69 + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() + * v_size_signed = v.size() # <<<<<<<<<<<<<< * - * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi - * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi # <<<<<<<<<<<<<< - * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi - * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi + * o = PyList_New(v_size_signed) */ - __pyx_v_dLatitude_radian1_in = ((__pyx_v_dLatitude_degree1_in / 180.0) * __pyx_v_6kernel_pi); + __pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size()); - /* "kernel.pyx":32 - * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi - * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi - * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi # <<<<<<<<<<<<<< - * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi + /* "vector.to_py":71 + * v_size_signed = v.size() + * + * o = PyList_New(v_size_signed) # <<<<<<<<<<<<<< * + * cdef Py_ssize_t i */ - __pyx_v_dLongitude_radian2_in = ((__pyx_v_dLongitude_degree2_in / 180.0) * __pyx_v_6kernel_pi); + __pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_o = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "kernel.pyx":33 - * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi - * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi - * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi # <<<<<<<<<<<<<< + /* "vector.to_py":76 + * cdef object item * - * # haversine formula + * for i in range(v_size_signed): # <<<<<<<<<<<<<< + * item = v[i] + * Py_INCREF(item) */ - __pyx_v_dLatitude_radian2_in = ((__pyx_v_dLatitude_degree2_in / 180.0) * __pyx_v_6kernel_pi); + __pyx_t_3 = __pyx_v_v_size_signed; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "kernel.pyx":36 + /* "vector.to_py":77 + * + * for i in range(v_size_signed): + * item = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(item) + * PyList_SET_ITEM(o, i, item) + */ + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); + __pyx_t_2 = 0; + + /* "vector.to_py":78 + * for i in range(v_size_signed): + * item = v[i] + * Py_INCREF(item) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(o, i, item) * - * # haversine formula - * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in # <<<<<<<<<<<<<< - * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in - * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) */ - __pyx_v_dLongtitude_diff = (__pyx_v_dLongitude_radian2_in - __pyx_v_dLongitude_radian1_in); + Py_INCREF(__pyx_v_item); - /* "kernel.pyx":37 - * # haversine formula - * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in - * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in # <<<<<<<<<<<<<< - * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) - * b = 2 * asin(sqrt(a)) - */ - __pyx_v_dLatitude_diff = (__pyx_v_dLatitude_radian2_in - __pyx_v_dLatitude_radian1_in); - - /* "kernel.pyx":38 - * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in - * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in - * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) # <<<<<<<<<<<<<< - * b = 2 * asin(sqrt(a)) - * c = b * dRadius - */ - __pyx_v_a = ((sin((__pyx_v_dLatitude_diff / 2.0)) * sin((__pyx_v_dLatitude_diff / 2.0))) + (((cos(__pyx_v_dLatitude_radian1_in) * cos(__pyx_v_dLatitude_radian2_in)) * sin((__pyx_v_dLongtitude_diff / 2.0))) * sin((__pyx_v_dLongtitude_diff / 2.0)))); - - /* "kernel.pyx":39 - * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in - * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) - * b = 2 * asin(sqrt(a)) # <<<<<<<<<<<<<< - * c = b * dRadius - * return c - */ - __pyx_v_b = (2.0 * asin(sqrt(__pyx_v_a))); - - /* "kernel.pyx":40 - * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) - * b = 2 * asin(sqrt(a)) - * c = b * dRadius # <<<<<<<<<<<<<< - * return c + /* "vector.to_py":79 + * item = v[i] + * Py_INCREF(item) + * PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<< * + * return o */ - __pyx_v_c = (__pyx_v_b * __pyx_v_6kernel_dRadius); + PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); + } - /* "kernel.pyx":41 - * b = 2 * asin(sqrt(a)) - * c = b * dRadius - * return c # <<<<<<<<<<<<<< + /* "vector.to_py":81 + * PyList_SET_ITEM(o, i, item) + * + * return o # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) # deactivate bnds checking */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_o); + __pyx_r = __pyx_v_o; goto __pyx_L0; - /* "kernel.pyx":17 + /* "vector.to_py":66 * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< - * """ - * Calculate the great circle distance between two points + * @cname("__pyx_convert_vector_to_py_double") + * cdef object __pyx_convert_vector_to_py_double(const vector[X]& v): # <<<<<<<<<<<<<< + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6kernel_calculate_distance_based_on_longitude_latitude[] = "\n Calculate the great circle distance between two points \n on the earth (specified in decimal degrees)\n "; -static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - double __pyx_v_dLongitude_degree1_in; - double __pyx_v_dLatitude_degree1_in; - double __pyx_v_dLongitude_degree2_in; - double __pyx_v_dLatitude_degree2_in; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,0}; - PyObject* values[4] = {0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree1_in)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree1_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 1); __PYX_ERR(0, 17, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree2_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 2); __PYX_ERR(0, 17, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree2_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 3); __PYX_ERR(0, 17, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_distance_based_on_longitude_latitude") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - } - __pyx_v_dLongitude_degree1_in = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_dLongitude_degree1_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_dLatitude_degree1_in = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_dLatitude_degree1_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_dLongitude_degree2_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dLongitude_degree2_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_v_dLatitude_degree2_in = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dLatitude_degree2_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in) { +static PyObject *__pyx_convert_vector_to_py_int(std::vector const &__pyx_v_v) { + Py_ssize_t __pyx_v_v_size_signed; + PyObject *__pyx_v_o = NULL; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 1); - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "vector.to_py":67 + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: # <<<<<<<<<<<<<< + * raise MemoryError() + * v_size_signed = v.size() + */ + __pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX)); + if (unlikely(__pyx_t_1)) { + + /* "vector.to_py":68 + * cdef object __pyx_convert_vector_to_py_int(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() # <<<<<<<<<<<<<< + * v_size_signed = v.size() + * + */ + PyErr_NoMemory(); __PYX_ERR(1, 68, __pyx_L1_error) -/* "kernel.pyx":44 + /* "vector.to_py":67 + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(const vector[X]& v): + * if v.size() > PY_SSIZE_T_MAX: # <<<<<<<<<<<<<< + * raise MemoryError() + * v_size_signed = v.size() + */ + } + + /* "vector.to_py":69 + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() + * v_size_signed = v.size() # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< - * """[This function is modified from - * http://www.idlcoyote.com/map_tips/lonconvert.html] + * o = PyList_New(v_size_signed) */ + __pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size()); -static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, PyObject *__pyx_arg_dLongitude_in); /*proto*/ -static PyObject *__pyx_f_6kernel_convert_360_to_180(double __pyx_v_dLongitude_in, CYTHON_UNUSED int __pyx_skip_dispatch) { - int __pyx_v_a; - double __pyx_v_dLongitude_out; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("convert_360_to_180", 0); + /* "vector.to_py":71 + * v_size_signed = v.size() + * + * o = PyList_New(v_size_signed) # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t i + */ + __pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_o = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "kernel.pyx":56 - * cdef int a - * cdef double dLongitude_out - * a = int(dLongitude_in /180.0) # <<<<<<<<<<<<<< - * dLongitude_out = dLongitude_in - a * 360.0 - * return dLongitude_out + /* "vector.to_py":76 + * cdef object item + * + * for i in range(v_size_signed): # <<<<<<<<<<<<<< + * item = v[i] + * Py_INCREF(item) */ - __pyx_v_a = ((int)(__pyx_v_dLongitude_in / 180.0)); + __pyx_t_3 = __pyx_v_v_size_signed; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; - /* "kernel.pyx":57 - * cdef double dLongitude_out - * a = int(dLongitude_in /180.0) - * dLongitude_out = dLongitude_in - a * 360.0 # <<<<<<<<<<<<<< - * return dLongitude_out + /* "vector.to_py":77 + * + * for i in range(v_size_signed): + * item = v[i] # <<<<<<<<<<<<<< + * Py_INCREF(item) + * PyList_SET_ITEM(o, i, item) + */ + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); + __pyx_t_2 = 0; + + /* "vector.to_py":78 + * for i in range(v_size_signed): + * item = v[i] + * Py_INCREF(item) # <<<<<<<<<<<<<< + * PyList_SET_ITEM(o, i, item) * */ - __pyx_v_dLongitude_out = (__pyx_v_dLongitude_in - (__pyx_v_a * 360.0)); + Py_INCREF(__pyx_v_item); - /* "kernel.pyx":58 - * a = int(dLongitude_in /180.0) - * dLongitude_out = dLongitude_in - a * 360.0 - * return dLongitude_out # <<<<<<<<<<<<<< + /* "vector.to_py":79 + * item = v[i] + * Py_INCREF(item) + * PyList_SET_ITEM(o, i, item) # <<<<<<<<<<<<<< + * + * return o + */ + PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); + } + + /* "vector.to_py":81 + * PyList_SET_ITEM(o, i, item) + * + * return o # <<<<<<<<<<<<<< * - * @cython.boundscheck(False) # deactivate bnds checking */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dLongitude_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_o); + __pyx_r = __pyx_v_o; goto __pyx_L0; - /* "kernel.pyx":44 + /* "vector.to_py":66 * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< - * """[This function is modified from - * http://www.idlcoyote.com/map_tips/lonconvert.html] + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(const vector[X]& v): # <<<<<<<<<<<<<< + * if v.size() > PY_SSIZE_T_MAX: + * raise MemoryError() */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, PyObject *__pyx_arg_dLongitude_in); /*proto*/ -static char __pyx_doc_6kernel_2convert_360_to_180[] = "[This function is modified from\n http://www.idlcoyote.com/map_tips/lonconvert.html]\n\n Args:\n dLongitude_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "; -static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, PyObject *__pyx_arg_dLongitude_in) { - double __pyx_v_dLongitude_in; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("convert_360_to_180 (wrapper)", 0); - assert(__pyx_arg_dLongitude_in); { - __pyx_v_dLongitude_in = __pyx_PyFloat_AsDouble(__pyx_arg_dLongitude_in); if (unlikely((__pyx_v_dLongitude_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_2convert_360_to_180(__pyx_self, ((double)__pyx_v_dLongitude_in)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} +/* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_int") + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ -static PyObject *__pyx_pf_6kernel_2convert_360_to_180(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_in) { - PyObject *__pyx_r = NULL; +static std::vector __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) { + std::vector __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("convert_360_to_180", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_convert_360_to_180(__pyx_v_dLongitude_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int", 1); -/* "kernel.pyx":61 - * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< - * """[find the index of a vertex in a list] + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 47, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 47, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v * */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_item); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + try { + __pyx_v_v.push_back(((int)__pyx_t_5)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(1, 48, __pyx_L1_error) + } -static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_find_vertex_in_list(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6kernel_find_vertex_in_list *__pyx_optional_args) { - double __pyx_v_dThreshold_in = ((double)1.0E-6); - int __pyx_v_i; - int __pyx_v_iFlag_exist; - int __pyx_v_lIndex; - int __pyx_v_nVertex; - double __pyx_v_dDistance; - double __pyx_v_x; - double __pyx_v_y; - double __pyx_v_left; - double __pyx_v_right; - double __pyx_v_bottom; - double __pyx_v_top; - PyObject *__pyx_v_index_vertex = NULL; - PyObject *__pyx_v_pBound = NULL; - PyObject *__pyx_v_aIntersect = NULL; - PyObject *__pyx_v_k = NULL; - PyObject *__pyx_v_pVertex = NULL; + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py_int") + * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "kernel.pyx":17 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< + * """ + * Calculate the great circle distance between two points + */ + +static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in, CYTHON_UNUSED int __pyx_skip_dispatch) { + double __pyx_v_dLongitude_radian1_in; + double __pyx_v_dLatitude_radian1_in; + double __pyx_v_dLongitude_radian2_in; + double __pyx_v_dLatitude_radian2_in; + double __pyx_v_dLongtitude_diff; + double __pyx_v_dLatitude_diff; + double __pyx_v_a; + double __pyx_v_b; + double __pyx_v_c; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - double __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_vertex_in_list", 0); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_dThreshold_in = __pyx_optional_args->dThreshold_in; - } - } + __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude", 1); - /* "kernel.pyx":72 - * """ - * cdef int i - * cdef int iFlag_exist = 0 # <<<<<<<<<<<<<< - * cdef int lIndex= -1 - * cdef int nVertex + /* "kernel.pyx":30 + * # Radius of earth in kilometers. Use 3956 for miles + * + * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi # <<<<<<<<<<<<<< + * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi + * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi */ - __pyx_v_iFlag_exist = 0; + __pyx_v_dLongitude_radian1_in = ((__pyx_v_dLongitude_degree1_in / 180.0) * __pyx_v_6kernel_pi); - /* "kernel.pyx":73 - * cdef int i - * cdef int iFlag_exist = 0 - * cdef int lIndex= -1 # <<<<<<<<<<<<<< - * cdef int nVertex - * cdef double dDistance + /* "kernel.pyx":31 + * + * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi + * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi # <<<<<<<<<<<<<< + * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi + * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi */ - __pyx_v_lIndex = -1; + __pyx_v_dLatitude_radian1_in = ((__pyx_v_dLatitude_degree1_in / 180.0) * __pyx_v_6kernel_pi); - /* "kernel.pyx":77 - * cdef double dDistance - * cdef double x, y, left, right, bottom, top - * nVertex= len(aVertex_in) # <<<<<<<<<<<<<< + /* "kernel.pyx":32 + * dLongitude_radian1_in = dLongitude_degree1_in /180.0 * pi + * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi + * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi # <<<<<<<<<<<<<< + * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi * - * if nVertex > 0 : */ - if (unlikely(__pyx_v_aVertex_in == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 77, __pyx_L1_error) - } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_v_nVertex = __pyx_t_1; + __pyx_v_dLongitude_radian2_in = ((__pyx_v_dLongitude_degree2_in / 180.0) * __pyx_v_6kernel_pi); - /* "kernel.pyx":79 - * nVertex= len(aVertex_in) + /* "kernel.pyx":33 + * dLatitude_radian1_in = dLatitude_degree1_in /180.0 * pi + * dLongitude_radian2_in = dLongitude_degree2_in /180.0 * pi + * dLatitude_radian2_in = dLatitude_degree2_in /180.0 * pi # <<<<<<<<<<<<<< * - * if nVertex > 0 : # <<<<<<<<<<<<<< - * index_vertex = RTree( max_cap=5, min_cap=2) - * for i in range(nVertex): + * # haversine formula */ - __pyx_t_2 = ((__pyx_v_nVertex > 0) != 0); - if (__pyx_t_2) { + __pyx_v_dLatitude_radian2_in = ((__pyx_v_dLatitude_degree2_in / 180.0) * __pyx_v_6kernel_pi); - /* "kernel.pyx":80 + /* "kernel.pyx":36 * - * if nVertex > 0 : - * index_vertex = RTree( max_cap=5, min_cap=2) # <<<<<<<<<<<<<< - * for i in range(nVertex): - * x = aVertex_in[i].dLongitude_degree + * # haversine formula + * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in # <<<<<<<<<<<<<< + * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in + * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RTree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_cap, __pyx_int_5) < 0) __PYX_ERR(0, 80, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_cap, __pyx_int_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_index_vertex = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_dLongtitude_diff = (__pyx_v_dLongitude_radian2_in - __pyx_v_dLongitude_radian1_in); - /* "kernel.pyx":81 - * if nVertex > 0 : - * index_vertex = RTree( max_cap=5, min_cap=2) - * for i in range(nVertex): # <<<<<<<<<<<<<< - * x = aVertex_in[i].dLongitude_degree - * y = aVertex_in[i].dLatitude_degree + /* "kernel.pyx":37 + * # haversine formula + * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in + * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in # <<<<<<<<<<<<<< + * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) + * b = 2 * asin(sqrt(a)) */ - __pyx_t_6 = __pyx_v_nVertex; - __pyx_t_7 = __pyx_t_6; - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { - __pyx_v_i = __pyx_t_8; + __pyx_v_dLatitude_diff = (__pyx_v_dLatitude_radian2_in - __pyx_v_dLatitude_radian1_in); - /* "kernel.pyx":82 - * index_vertex = RTree( max_cap=5, min_cap=2) - * for i in range(nVertex): - * x = aVertex_in[i].dLongitude_degree # <<<<<<<<<<<<<< - * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 - */ - if (unlikely(__pyx_v_aVertex_in == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 82, __pyx_L1_error) - } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_x = __pyx_t_9; - - /* "kernel.pyx":83 - * for i in range(nVertex): - * x = aVertex_in[i].dLongitude_degree - * y = aVertex_in[i].dLatitude_degree # <<<<<<<<<<<<<< - * left = x - 1E-5 - * right = x + 1E-5 - */ - if (unlikely(__pyx_v_aVertex_in == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 83, __pyx_L1_error) - } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_y = __pyx_t_9; - - /* "kernel.pyx":84 - * x = aVertex_in[i].dLongitude_degree - * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 # <<<<<<<<<<<<<< - * right = x + 1E-5 - * bottom = y - 1E-5 - */ - __pyx_v_left = (__pyx_v_x - 1E-5); - - /* "kernel.pyx":85 - * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 - * right = x + 1E-5 # <<<<<<<<<<<<<< - * bottom = y - 1E-5 - * top = y + 1E-5 + /* "kernel.pyx":38 + * dLongtitude_diff = dLongitude_radian2_in - dLongitude_radian1_in + * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in + * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) # <<<<<<<<<<<<<< + * b = 2 * asin(sqrt(a)) + * c = b * dRadius */ - __pyx_v_right = (__pyx_v_x + 1E-5); + __pyx_v_a = ((sin((__pyx_v_dLatitude_diff / 2.0)) * sin((__pyx_v_dLatitude_diff / 2.0))) + (((cos(__pyx_v_dLatitude_radian1_in) * cos(__pyx_v_dLatitude_radian2_in)) * sin((__pyx_v_dLongtitude_diff / 2.0))) * sin((__pyx_v_dLongtitude_diff / 2.0)))); - /* "kernel.pyx":86 - * left = x - 1E-5 - * right = x + 1E-5 - * bottom = y - 1E-5 # <<<<<<<<<<<<<< - * top = y + 1E-5 - * pBound= (left, bottom, right, top) + /* "kernel.pyx":39 + * dLatitude_diff = dLatitude_radian2_in - dLatitude_radian1_in + * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) + * b = 2 * asin(sqrt(a)) # <<<<<<<<<<<<<< + * c = b * dRadius + * return c */ - __pyx_v_bottom = (__pyx_v_y - 1E-5); + __pyx_v_b = (2.0 * asin(sqrt(__pyx_v_a))); - /* "kernel.pyx":87 - * right = x + 1E-5 - * bottom = y - 1E-5 - * top = y + 1E-5 # <<<<<<<<<<<<<< - * pBound= (left, bottom, right, top) - * index_vertex.insert(i, pBound) + /* "kernel.pyx":40 + * a = sin(dLatitude_diff/2)*sin(dLatitude_diff/2) + cos(dLatitude_radian1_in) * cos(dLatitude_radian2_in) * sin(dLongtitude_diff/2)*sin(dLongtitude_diff/2) + * b = 2 * asin(sqrt(a)) + * c = b * dRadius # <<<<<<<<<<<<<< + * return c + * */ - __pyx_v_top = (__pyx_v_y + 1E-5); + __pyx_v_c = (__pyx_v_b * __pyx_v_6kernel_dRadius); - /* "kernel.pyx":88 - * bottom = y - 1E-5 - * top = y + 1E-5 - * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< - * index_vertex.insert(i, pBound) + /* "kernel.pyx":41 + * b = 2 * asin(sqrt(a)) + * c = b * dRadius + * return c # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) # deactivate bnds checking */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); - __pyx_t_5 = 0; - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_10 = 0; - __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_11); - __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "kernel.pyx":89 - * top = y + 1E-5 - * pBound= (left, bottom, right, top) - * index_vertex.insert(i, pBound) # <<<<<<<<<<<<<< + /* "kernel.pyx":17 * - * #now the new vertex + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< + * """ + * Calculate the great circle distance between two points */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_insert); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_calculate_distance_based_on_longitude_latitude, "\n Calculate the great circle distance between two points \n on the earth (specified in decimal degrees)\n "); +static PyMethodDef __pyx_mdef_6kernel_1calculate_distance_based_on_longitude_latitude = {"calculate_distance_based_on_longitude_latitude", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_calculate_distance_based_on_longitude_latitude}; +static PyObject *__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + double __pyx_v_dLongitude_degree1_in; + double __pyx_v_dLatitude_degree1_in; + double __pyx_v_dLongitude_degree2_in; + double __pyx_v_dLatitude_degree2_in; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 1); __PYX_ERR(0, 17, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 2); __PYX_ERR(0, 17, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, 3); __PYX_ERR(0, 17, __pyx_L3_error) } } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_12, __pyx_t_3); - __Pyx_INCREF(__pyx_v_pBound); - __Pyx_GIVEREF(__pyx_v_pBound); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_12, __pyx_v_pBound); - __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate_distance_based_on_longitude_latitude") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_dLongitude_degree1_in = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_dLongitude_degree1_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_dLatitude_degree1_in = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_dLatitude_degree1_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_dLongitude_degree2_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dLongitude_degree2_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_v_dLatitude_degree2_in = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_dLatitude_degree2_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("calculate_distance_based_on_longitude_latitude", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } + } + __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in); - /* "kernel.pyx":92 - * - * #now the new vertex - * x=pVertex_in.dLongitude_degree # <<<<<<<<<<<<<< - * y=pVertex_in.dLatitude_degree - * left = x - 1E-5 - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_in, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_x = __pyx_t_9; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "kernel.pyx":93 - * #now the new vertex - * x=pVertex_in.dLongitude_degree - * y=pVertex_in.dLatitude_degree # <<<<<<<<<<<<<< - * left = x - 1E-5 - * right = x + 1E-5 - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_in, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_y = __pyx_t_9; +static PyObject *__pyx_pf_6kernel_calculate_distance_based_on_longitude_latitude(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_degree1_in, double __pyx_v_dLatitude_degree1_in, double __pyx_v_dLongitude_degree2_in, double __pyx_v_dLatitude_degree2_in) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("calculate_distance_based_on_longitude_latitude", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6kernel_calculate_distance_based_on_longitude_latitude(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "kernel.pyx":94 - * x=pVertex_in.dLongitude_degree - * y=pVertex_in.dLatitude_degree - * left = x - 1E-5 # <<<<<<<<<<<<<< - * right = x + 1E-5 - * bottom = y - 1E-5 - */ - __pyx_v_left = (__pyx_v_x - 1E-5); + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("kernel.calculate_distance_based_on_longitude_latitude", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "kernel.pyx":95 - * y=pVertex_in.dLatitude_degree - * left = x - 1E-5 - * right = x + 1E-5 # <<<<<<<<<<<<<< - * bottom = y - 1E-5 - * top = y + 1E-5 +/* "kernel.pyx":44 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< + * """[This function is modified from + * http://www.idlcoyote.com/map_tips/lonconvert.html] */ - __pyx_v_right = (__pyx_v_x + 1E-5); - /* "kernel.pyx":96 - * left = x - 1E-5 - * right = x + 1E-5 - * bottom = y - 1E-5 # <<<<<<<<<<<<<< - * top = y + 1E-5 - * pBound= (left, bottom, right, top) - */ - __pyx_v_bottom = (__pyx_v_y - 1E-5); +static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_convert_360_to_180(double __pyx_v_dLongitude_in, CYTHON_UNUSED int __pyx_skip_dispatch) { + int __pyx_v_a; + double __pyx_v_dLongitude_out; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("convert_360_to_180", 1); - /* "kernel.pyx":97 - * right = x + 1E-5 - * bottom = y - 1E-5 - * top = y + 1E-5 # <<<<<<<<<<<<<< - * pBound= (left, bottom, right, top) - * aIntersect = list(index_vertex.search(pBound)) + /* "kernel.pyx":56 + * cdef int a + * cdef double dLongitude_out + * a = int(dLongitude_in /180.0) # <<<<<<<<<<<<<< + * dLongitude_out = dLongitude_in - a * 360.0 + * return dLongitude_out */ - __pyx_v_top = (__pyx_v_y + 1E-5); + __pyx_v_a = ((int)(__pyx_v_dLongitude_in / 180.0)); - /* "kernel.pyx":98 - * bottom = y - 1E-5 - * top = y + 1E-5 - * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< - * aIntersect = list(index_vertex.search(pBound)) + /* "kernel.pyx":57 + * cdef double dLongitude_out + * a = int(dLongitude_in /180.0) + * dLongitude_out = dLongitude_in - a * 360.0 # <<<<<<<<<<<<<< + * return dLongitude_out * */ - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); - __pyx_t_11 = 0; - __pyx_t_10 = 0; - __pyx_t_5 = 0; - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_dLongitude_out = (__pyx_v_dLongitude_in - (__pyx_v_a * 360.0)); - /* "kernel.pyx":99 - * top = y + 1E-5 - * pBound= (left, bottom, right, top) - * aIntersect = list(index_vertex.search(pBound)) # <<<<<<<<<<<<<< + /* "kernel.pyx":58 + * a = int(dLongitude_in /180.0) + * dLongitude_out = dLongitude_in - a * 360.0 + * return dLongitude_out # <<<<<<<<<<<<<< * - * for k in aIntersect: + * @cython.boundscheck(False) # deactivate bnds checking */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - } - } - __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_pBound) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pBound); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_aIntersect = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dLongitude_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "kernel.pyx":101 - * aIntersect = list(index_vertex.search(pBound)) + /* "kernel.pyx":44 * - * for k in aIntersect: # <<<<<<<<<<<<<< - * pVertex = aVertex_in[k] - * dDistance = pVertex.calculate_distance(pVertex_in) + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< + * """[This function is modified from + * http://www.idlcoyote.com/map_tips/lonconvert.html] */ - __pyx_t_3 = __pyx_v_aIntersect; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; - for (;;) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 101, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); - __pyx_t_4 = 0; - /* "kernel.pyx":102 - * - * for k in aIntersect: - * pVertex = aVertex_in[k] # <<<<<<<<<<<<<< - * dDistance = pVertex.calculate_distance(pVertex_in) - * #if pVertex == pVertex_in: - */ - if (unlikely(__pyx_v_aVertex_in == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 102, __pyx_L1_error) - } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_aVertex_in, __pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_pVertex, __pyx_t_4); - __pyx_t_4 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "kernel.pyx":103 - * for k in aIntersect: - * pVertex = aVertex_in[k] - * dDistance = pVertex.calculate_distance(pVertex_in) # <<<<<<<<<<<<<< - * #if pVertex == pVertex_in: - * if dDistance < dThreshold_in: - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex, __pyx_n_s_calculate_distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); +/* Python wrapper */ +static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_2convert_360_to_180, "[This function is modified from\n http://www.idlcoyote.com/map_tips/lonconvert.html]\n\n Args:\n dLongitude_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "); +static PyMethodDef __pyx_mdef_6kernel_3convert_360_to_180 = {"convert_360_to_180", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_3convert_360_to_180, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_2convert_360_to_180}; +static PyObject *__pyx_pw_6kernel_3convert_360_to_180(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + double __pyx_v_dLongitude_in; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("convert_360_to_180 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_in,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_v_pVertex_in) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_pVertex_in); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_dDistance = __pyx_t_9; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "convert_360_to_180") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_dLongitude_in = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_dLongitude_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("convert_360_to_180", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6kernel_2convert_360_to_180(__pyx_self, __pyx_v_dLongitude_in); - /* "kernel.pyx":105 - * dDistance = pVertex.calculate_distance(pVertex_in) - * #if pVertex == pVertex_in: - * if dDistance < dThreshold_in: # <<<<<<<<<<<<<< - * iFlag_exist = 1 - * lIndex = k - */ - __pyx_t_2 = ((__pyx_v_dDistance < __pyx_v_dThreshold_in) != 0); - if (__pyx_t_2) { + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "kernel.pyx":106 - * #if pVertex == pVertex_in: - * if dDistance < dThreshold_in: - * iFlag_exist = 1 # <<<<<<<<<<<<<< - * lIndex = k - * break - */ - __pyx_v_iFlag_exist = 1; - - /* "kernel.pyx":107 - * if dDistance < dThreshold_in: - * iFlag_exist = 1 - * lIndex = k # <<<<<<<<<<<<<< - * break - * else: - */ - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error) - __pyx_v_lIndex = __pyx_t_6; - - /* "kernel.pyx":108 - * iFlag_exist = 1 - * lIndex = k - * break # <<<<<<<<<<<<<< - * else: - * pass - */ - goto __pyx_L7_break; - - /* "kernel.pyx":105 - * dDistance = pVertex.calculate_distance(pVertex_in) - * #if pVertex == pVertex_in: - * if dDistance < dThreshold_in: # <<<<<<<<<<<<<< - * iFlag_exist = 1 - * lIndex = k - */ - } - - /* "kernel.pyx":110 - * break - * else: - * pass # <<<<<<<<<<<<<< - * pass - * - */ - /*else*/ { - } - - /* "kernel.pyx":101 - * aIntersect = list(index_vertex.search(pBound)) - * - * for k in aIntersect: # <<<<<<<<<<<<<< - * pVertex = aVertex_in[k] - * dDistance = pVertex.calculate_distance(pVertex_in) - */ - } - __pyx_L7_break:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "kernel.pyx":79 - * nVertex= len(aVertex_in) - * - * if nVertex > 0 : # <<<<<<<<<<<<<< - * index_vertex = RTree( max_cap=5, min_cap=2) - * for i in range(nVertex): - */ - } - - /* "kernel.pyx":129 - * # pass - * - * return iFlag_exist, lIndex # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) # deactivate bnds checking - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_lIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "kernel.pyx":61 - * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< - * """[find the index of a vertex in a list] - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_index_vertex); - __Pyx_XDECREF(__pyx_v_pBound); - __Pyx_XDECREF(__pyx_v_aIntersect); - __Pyx_XDECREF(__pyx_v_k); - __Pyx_XDECREF(__pyx_v_pVertex); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6kernel_4find_vertex_in_list[] = "[find the index of a vertex in a list]\n\n Args:\n aVertex_in ([type]): [description]\n pVertex_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "; -static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_aVertex_in = 0; - PyObject *__pyx_v_pVertex_in = 0; - double __pyx_v_dThreshold_in; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("find_vertex_in_list (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pVertex_in,&__pyx_n_s_dThreshold_in,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aVertex_in)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pVertex_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("find_vertex_in_list", 0, 2, 3, 1); __PYX_ERR(0, 61, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dThreshold_in); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_vertex_in_list") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_aVertex_in = ((PyObject*)values[0]); - __pyx_v_pVertex_in = values[1]; - if (values[2]) { - __pyx_v_dThreshold_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dThreshold_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) - } else { - __pyx_v_dThreshold_in = ((double)1.0E-6); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_vertex_in_list", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 61, __pyx_L1_error) - __pyx_r = __pyx_pf_6kernel_4find_vertex_in_list(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pVertex_in, __pyx_v_dThreshold_in); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_6kernel_4find_vertex_in_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, double __pyx_v_dThreshold_in) { +static PyObject *__pyx_pf_6kernel_2convert_360_to_180(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_dLongitude_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - struct __pyx_opt_args_6kernel_find_vertex_in_list __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_vertex_in_list", 0); + __Pyx_RefNannySetupContext("convert_360_to_180", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.dThreshold_in = __pyx_v_dThreshold_in; - __pyx_t_1 = __pyx_f_6kernel_find_vertex_in_list(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6kernel_convert_360_to_180(__pyx_v_dLongitude_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2705,7 +3772,7 @@ static PyObject *__pyx_pf_6kernel_4find_vertex_in_list(CYTHON_UNUSED PyObject *_ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.convert_360_to_180", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2713,22 +3780,28 @@ static PyObject *__pyx_pf_6kernel_4find_vertex_in_list(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "kernel.pyx":132 +/* "kernel.pyx":61 * * @cython.boundscheck(False) # deactivate bnds checking - * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< - * # - * cdef int iFlag_exist = 0 + * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[find the index of a vertex in a list] + * */ -static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pEdge_in, CYTHON_UNUSED int __pyx_skip_dispatch) { +static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_find_vertex_in_list(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6kernel_find_vertex_in_list *__pyx_optional_args) { + double __pyx_v_dThreshold_in = ((double)1.0E-6); + int __pyx_v_i; int __pyx_v_iFlag_exist; + int __pyx_v_lIndex; int __pyx_v_nVertex; - int __pyx_v_npoint; - std::vector __pyx_v_aIndex; - std::vector __pyx_v_aIndex_order; - std::vector __pyx_v_aDistance; + double __pyx_v_dDistance; double __pyx_v_x; double __pyx_v_y; double __pyx_v_left; @@ -2736,24 +3809,10 @@ static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_i double __pyx_v_bottom; double __pyx_v_top; PyObject *__pyx_v_index_vertex = NULL; - int __pyx_v_i; - int __pyx_v_lID; PyObject *__pyx_v_pBound = NULL; - PyObject *__pyx_v_pVertex_start = NULL; - PyObject *__pyx_v_pVertex_end = NULL; - PyObject *__pyx_v_x1 = NULL; - PyObject *__pyx_v_y1 = NULL; - PyObject *__pyx_v_x2 = NULL; - PyObject *__pyx_v_y2 = NULL; PyObject *__pyx_v_aIntersect = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_pVertex = NULL; - PyObject *__pyx_v_iFlag_overlap = NULL; - PyObject *__pyx_v_dDistance = NULL; - PyObject *__pyx_v_diff = NULL; - PyObject *__pyx_v_b = NULL; - PyObject *__pyx_v_c = NULL; - PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -2768,198 +3827,191 @@ static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_i PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; - PyObject *__pyx_t_13 = NULL; - PyObject *(*__pyx_t_14)(PyObject *); - std::vector __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_vertex_on_edge", 0); + __Pyx_RefNannySetupContext("find_vertex_in_list", 1); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_dThreshold_in = __pyx_optional_args->dThreshold_in; + } + } - /* "kernel.pyx":134 - * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): - * # + /* "kernel.pyx":72 + * """ + * cdef int i * cdef int iFlag_exist = 0 # <<<<<<<<<<<<<< - * cdef int nVertex, npoint - * cdef vector[int] aIndex ,aIndex_order + * cdef int lIndex= -1 + * cdef int nVertex */ __pyx_v_iFlag_exist = 0; - /* "kernel.pyx":140 + /* "kernel.pyx":73 + * cdef int i + * cdef int iFlag_exist = 0 + * cdef int lIndex= -1 # <<<<<<<<<<<<<< + * cdef int nVertex + * cdef double dDistance + */ + __pyx_v_lIndex = -1; + + /* "kernel.pyx":77 + * cdef double dDistance * cdef double x, y, left, right, bottom, top - * * nVertex= len(aVertex_in) # <<<<<<<<<<<<<< - * npoint = 0 + * * if nVertex > 0 : */ if (unlikely(__pyx_v_aVertex_in == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 77, __pyx_L1_error) } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_v_nVertex = __pyx_t_1; - /* "kernel.pyx":141 - * + /* "kernel.pyx":79 * nVertex= len(aVertex_in) - * npoint = 0 # <<<<<<<<<<<<<< - * if nVertex > 0 : - * index_vertex = RTree(max_cap=5, min_cap=2) - */ - __pyx_v_npoint = 0; - - /* "kernel.pyx":142 - * nVertex= len(aVertex_in) - * npoint = 0 + * * if nVertex > 0 : # <<<<<<<<<<<<<< - * index_vertex = RTree(max_cap=5, min_cap=2) + * index_vertex = RTree( max_cap=5, min_cap=2) * for i in range(nVertex): */ - __pyx_t_2 = ((__pyx_v_nVertex > 0) != 0); + __pyx_t_2 = (__pyx_v_nVertex > 0); if (__pyx_t_2) { - /* "kernel.pyx":143 - * npoint = 0 + /* "kernel.pyx":80 + * * if nVertex > 0 : - * index_vertex = RTree(max_cap=5, min_cap=2) # <<<<<<<<<<<<<< + * index_vertex = RTree( max_cap=5, min_cap=2) # <<<<<<<<<<<<<< * for i in range(nVertex): - * lID = i + * x = aVertex_in[i].dLongitude_degree */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RTree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RTree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_cap, __pyx_int_5) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_cap, __pyx_int_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_cap, __pyx_int_5) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_cap, __pyx_int_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_index_vertex = __pyx_t_5; __pyx_t_5 = 0; - /* "kernel.pyx":144 + /* "kernel.pyx":81 * if nVertex > 0 : - * index_vertex = RTree(max_cap=5, min_cap=2) + * index_vertex = RTree( max_cap=5, min_cap=2) * for i in range(nVertex): # <<<<<<<<<<<<<< - * lID = i * x = aVertex_in[i].dLongitude_degree + * y = aVertex_in[i].dLatitude_degree */ __pyx_t_6 = __pyx_v_nVertex; __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "kernel.pyx":145 - * index_vertex = RTree(max_cap=5, min_cap=2) - * for i in range(nVertex): - * lID = i # <<<<<<<<<<<<<< - * x = aVertex_in[i].dLongitude_degree - * y = aVertex_in[i].dLatitude_degree - */ - __pyx_v_lID = __pyx_v_i; - - /* "kernel.pyx":146 + /* "kernel.pyx":82 + * index_vertex = RTree( max_cap=5, min_cap=2) * for i in range(nVertex): - * lID = i * x = aVertex_in[i].dLongitude_degree # <<<<<<<<<<<<<< * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 + * left = x - 1E-5 */ if (unlikely(__pyx_v_aVertex_in == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 146, __pyx_L1_error) + __PYX_ERR(0, 82, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_x = __pyx_t_9; - /* "kernel.pyx":147 - * lID = i + /* "kernel.pyx":83 + * for i in range(nVertex): * x = aVertex_in[i].dLongitude_degree * y = aVertex_in[i].dLatitude_degree # <<<<<<<<<<<<<< - * left = x - 1E-5 - * right= x + 1E-5 + * left = x - 1E-5 + * right = x + 1E-5 */ if (unlikely(__pyx_v_aVertex_in == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 83, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_y = __pyx_t_9; - /* "kernel.pyx":148 + /* "kernel.pyx":84 * x = aVertex_in[i].dLongitude_degree * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 # <<<<<<<<<<<<<< - * right= x + 1E-5 - * bottom= y -1E-5 + * left = x - 1E-5 # <<<<<<<<<<<<<< + * right = x + 1E-5 + * bottom = y - 1E-5 */ __pyx_v_left = (__pyx_v_x - 1E-5); - /* "kernel.pyx":149 + /* "kernel.pyx":85 * y = aVertex_in[i].dLatitude_degree - * left = x - 1E-5 - * right= x + 1E-5 # <<<<<<<<<<<<<< - * bottom= y -1E-5 - * top= y + 1E-5 + * left = x - 1E-5 + * right = x + 1E-5 # <<<<<<<<<<<<<< + * bottom = y - 1E-5 + * top = y + 1E-5 */ __pyx_v_right = (__pyx_v_x + 1E-5); - /* "kernel.pyx":150 - * left = x - 1E-5 - * right= x + 1E-5 - * bottom= y -1E-5 # <<<<<<<<<<<<<< - * top= y + 1E-5 + /* "kernel.pyx":86 + * left = x - 1E-5 + * right = x + 1E-5 + * bottom = y - 1E-5 # <<<<<<<<<<<<<< + * top = y + 1E-5 * pBound= (left, bottom, right, top) */ __pyx_v_bottom = (__pyx_v_y - 1E-5); - /* "kernel.pyx":151 - * right= x + 1E-5 - * bottom= y -1E-5 - * top= y + 1E-5 # <<<<<<<<<<<<<< + /* "kernel.pyx":87 + * right = x + 1E-5 + * bottom = y - 1E-5 + * top = y + 1E-5 # <<<<<<<<<<<<<< * pBound= (left, bottom, right, top) - * index_vertex.insert(lID, pBound) # + * index_vertex.insert(i, pBound) */ __pyx_v_top = (__pyx_v_y + 1E-5); - /* "kernel.pyx":152 - * bottom= y -1E-5 - * top= y + 1E-5 + /* "kernel.pyx":88 + * bottom = y - 1E-5 + * top = y + 1E-5 * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< - * index_vertex.insert(lID, pBound) # - * pass + * index_vertex.insert(i, pBound) + * */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; @@ -2967,20 +4019,21 @@ static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_i __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_11); __pyx_t_11 = 0; - /* "kernel.pyx":153 - * top= y + 1E-5 + /* "kernel.pyx":89 + * top = y + 1E-5 * pBound= (left, bottom, right, top) - * index_vertex.insert(lID, pBound) # # <<<<<<<<<<<<<< - * pass + * index_vertex.insert(i, pBound) # <<<<<<<<<<<<<< + * * #now the new vertex */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_insert); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_insert); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_lID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_12 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); @@ -2990,788 +4043,338 @@ static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_i __pyx_t_12 = 1; } } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - #endif - { - __pyx_t_5 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - } - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_12, __pyx_t_3); - __Pyx_INCREF(__pyx_v_pBound); - __Pyx_GIVEREF(__pyx_v_pBound); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_12, __pyx_v_pBound); - __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - /* "kernel.pyx":156 - * pass + /* "kernel.pyx":92 + * * #now the new vertex - * pVertex_start = pEdge_in.pVertex_start # <<<<<<<<<<<<<< - * pVertex_end = pEdge_in.pVertex_end - * x1=pVertex_start.dLongitude_degree + * x=pVertex_in.dLongitude_degree # <<<<<<<<<<<<<< + * y=pVertex_in.dLatitude_degree + * left = x - 1E-5 */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_pVertex_start); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_in, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_v_pVertex_start = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_x = __pyx_t_9; - /* "kernel.pyx":157 + /* "kernel.pyx":93 * #now the new vertex - * pVertex_start = pEdge_in.pVertex_start - * pVertex_end = pEdge_in.pVertex_end # <<<<<<<<<<<<<< - * x1=pVertex_start.dLongitude_degree - * y1=pVertex_start.dLatitude_degree + * x=pVertex_in.dLongitude_degree + * y=pVertex_in.dLatitude_degree # <<<<<<<<<<<<<< + * left = x - 1E-5 + * right = x + 1E-5 */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_pVertex_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_in, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_v_pVertex_end = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_y = __pyx_t_9; - /* "kernel.pyx":158 - * pVertex_start = pEdge_in.pVertex_start - * pVertex_end = pEdge_in.pVertex_end - * x1=pVertex_start.dLongitude_degree # <<<<<<<<<<<<<< - * y1=pVertex_start.dLatitude_degree - * x2=pVertex_end.dLongitude_degree + /* "kernel.pyx":94 + * x=pVertex_in.dLongitude_degree + * y=pVertex_in.dLatitude_degree + * left = x - 1E-5 # <<<<<<<<<<<<<< + * right = x + 1E-5 + * bottom = y - 1E-5 */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_start, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_v_x1 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_v_left = (__pyx_v_x - 1E-5); - /* "kernel.pyx":159 - * pVertex_end = pEdge_in.pVertex_end - * x1=pVertex_start.dLongitude_degree - * y1=pVertex_start.dLatitude_degree # <<<<<<<<<<<<<< - * x2=pVertex_end.dLongitude_degree - * y2=pVertex_end.dLatitude_degree + /* "kernel.pyx":95 + * y=pVertex_in.dLatitude_degree + * left = x - 1E-5 + * right = x + 1E-5 # <<<<<<<<<<<<<< + * bottom = y - 1E-5 + * top = y + 1E-5 */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_start, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_v_y1 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_v_right = (__pyx_v_x + 1E-5); - /* "kernel.pyx":160 - * x1=pVertex_start.dLongitude_degree - * y1=pVertex_start.dLatitude_degree - * x2=pVertex_end.dLongitude_degree # <<<<<<<<<<<<<< - * y2=pVertex_end.dLatitude_degree - * left = np.min([x1, x2]) + /* "kernel.pyx":96 + * left = x - 1E-5 + * right = x + 1E-5 + * bottom = y - 1E-5 # <<<<<<<<<<<<<< + * top = y + 1E-5 + * pBound= (left, bottom, right, top) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_end, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_v_x2 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_v_bottom = (__pyx_v_y - 1E-5); - /* "kernel.pyx":161 - * y1=pVertex_start.dLatitude_degree - * x2=pVertex_end.dLongitude_degree - * y2=pVertex_end.dLatitude_degree # <<<<<<<<<<<<<< - * left = np.min([x1, x2]) - * right = np.max([x1, x2]) + /* "kernel.pyx":97 + * right = x + 1E-5 + * bottom = y - 1E-5 + * top = y + 1E-5 # <<<<<<<<<<<<<< + * pBound= (left, bottom, right, top) + * aIntersect = list(index_vertex.search(pBound)) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_end, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_v_y2 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_v_top = (__pyx_v_y + 1E-5); - /* "kernel.pyx":162 - * x2=pVertex_end.dLongitude_degree - * y2=pVertex_end.dLatitude_degree - * left = np.min([x1, x2]) # <<<<<<<<<<<<<< - * right = np.max([x1, x2]) - * bottom = np.min([y1, y2]) - */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_v_x1); - __Pyx_GIVEREF(__pyx_v_x1); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_x1); - __Pyx_INCREF(__pyx_v_x2); - __Pyx_GIVEREF(__pyx_v_x2); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_x2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_left = __pyx_t_9; - - /* "kernel.pyx":163 - * y2=pVertex_end.dLatitude_degree - * left = np.min([x1, x2]) - * right = np.max([x1, x2]) # <<<<<<<<<<<<<< - * bottom = np.min([y1, y2]) - * top = np.max([y1, y2]) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_x1); - __Pyx_GIVEREF(__pyx_v_x1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_x1); - __Pyx_INCREF(__pyx_v_x2); - __Pyx_GIVEREF(__pyx_v_x2); - PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_x2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_right = __pyx_t_9; - - /* "kernel.pyx":164 - * left = np.min([x1, x2]) - * right = np.max([x1, x2]) - * bottom = np.min([y1, y2]) # <<<<<<<<<<<<<< - * top = np.max([y1, y2]) - * pBound= (left, bottom, right, top) - */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_v_y1); - __Pyx_GIVEREF(__pyx_v_y1); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_y1); - __Pyx_INCREF(__pyx_v_y2); - __Pyx_GIVEREF(__pyx_v_y2); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_y2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - } - } - __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_bottom = __pyx_t_9; - - /* "kernel.pyx":165 - * right = np.max([x1, x2]) - * bottom = np.min([y1, y2]) - * top = np.max([y1, y2]) # <<<<<<<<<<<<<< - * pBound= (left, bottom, right, top) - * aIntersect = list(index_vertex.search(pBound)) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_y1); - __Pyx_GIVEREF(__pyx_v_y1); - PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_y1); - __Pyx_INCREF(__pyx_v_y2); - __Pyx_GIVEREF(__pyx_v_y2); - PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_y2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_top = __pyx_t_9; - - /* "kernel.pyx":166 - * bottom = np.min([y1, y2]) - * top = np.max([y1, y2]) + /* "kernel.pyx":98 + * bottom = y - 1E-5 + * top = y + 1E-5 * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< * aIntersect = list(index_vertex.search(pBound)) - * for k in aIntersect: + * */ - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error); __pyx_t_11 = 0; __pyx_t_10 = 0; - __pyx_t_5 = 0; __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_5); + __pyx_t_5 = 0; - /* "kernel.pyx":167 - * top = np.max([y1, y2]) + /* "kernel.pyx":99 + * top = y + 1E-5 * pBound= (left, bottom, right, top) * aIntersect = list(index_vertex.search(pBound)) # <<<<<<<<<<<<<< + * * for k in aIntersect: - * pVertex = aVertex_in[k] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_search); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; } } - __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_pBound) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pBound); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_pBound}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_aIntersect = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_aIntersect = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "kernel.pyx":168 - * pBound= (left, bottom, right, top) + /* "kernel.pyx":101 * aIntersect = list(index_vertex.search(pBound)) + * * for k in aIntersect: # <<<<<<<<<<<<<< * pVertex = aVertex_in[k] - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + * dDistance = pVertex.calculate_distance(pVertex_in) */ - __pyx_t_3 = __pyx_v_aIntersect; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_v_aIntersect; __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = 0; for (;;) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 101, __pyx_L1_error) + #endif + if (__pyx_t_1 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); + __pyx_t_5 = 0; - /* "kernel.pyx":169 - * aIntersect = list(index_vertex.search(pBound)) + /* "kernel.pyx":102 + * * for k in aIntersect: * pVertex = aVertex_in[k] # <<<<<<<<<<<<<< - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) - * if iFlag_overlap == 1: + * dDistance = pVertex.calculate_distance(pVertex_in) + * #if pVertex == pVertex_in: */ if (unlikely(__pyx_v_aVertex_in == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 169, __pyx_L1_error) + __PYX_ERR(0, 102, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_aVertex_in, __pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_pVertex, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_aVertex_in, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pVertex, __pyx_t_5); + __pyx_t_5 = 0; - /* "kernel.pyx":170 + /* "kernel.pyx":103 * for k in aIntersect: * pVertex = aVertex_in[k] - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) # <<<<<<<<<<<<<< - * if iFlag_overlap == 1: - * iFlag_exist = 1 + * dDistance = pVertex.calculate_distance(pVertex_in) # <<<<<<<<<<<<<< + * #if pVertex == pVertex_in: + * if dDistance < dThreshold_in: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_check_vertex_on_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex, __pyx_n_s_calculate_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; } } - __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_v_pVertex) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_pVertex); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 170, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_10 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_pVertex_in}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 170, __pyx_L1_error) - __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_14 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 170, __pyx_L1_error) - __pyx_L9_unpacking_done:; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_XDECREF_SET(__pyx_v_iFlag_overlap, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_dDistance, __pyx_t_10); - __pyx_t_10 = 0; - __Pyx_XDECREF_SET(__pyx_v_diff, __pyx_t_11); - __pyx_t_11 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_dDistance = __pyx_t_9; - /* "kernel.pyx":171 - * pVertex = aVertex_in[k] - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) - * if iFlag_overlap == 1: # <<<<<<<<<<<<<< - * iFlag_exist = 1 - * aDistance.push_back(dDistance) + /* "kernel.pyx":105 + * dDistance = pVertex.calculate_distance(pVertex_in) + * #if pVertex == pVertex_in: + * if dDistance < dThreshold_in: # <<<<<<<<<<<<<< + * iFlag_exist = 1 + * lIndex = k */ - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_iFlag_overlap, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 171, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = (__pyx_v_dDistance < __pyx_v_dThreshold_in); if (__pyx_t_2) { - /* "kernel.pyx":172 - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) - * if iFlag_overlap == 1: + /* "kernel.pyx":106 + * #if pVertex == pVertex_in: + * if dDistance < dThreshold_in: * iFlag_exist = 1 # <<<<<<<<<<<<<< - * aDistance.push_back(dDistance) - * aIndex.push_back(i) + * lIndex = k + * break */ __pyx_v_iFlag_exist = 1; - /* "kernel.pyx":173 - * if iFlag_overlap == 1: - * iFlag_exist = 1 - * aDistance.push_back(dDistance) # <<<<<<<<<<<<<< - * aIndex.push_back(i) - * npoint = npoint + 1 - */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_dDistance); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) - try { - __pyx_v_aDistance.push_back(__pyx_t_9); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 173, __pyx_L1_error) - } - - /* "kernel.pyx":174 + /* "kernel.pyx":107 + * if dDistance < dThreshold_in: * iFlag_exist = 1 - * aDistance.push_back(dDistance) - * aIndex.push_back(i) # <<<<<<<<<<<<<< - * npoint = npoint + 1 + * lIndex = k # <<<<<<<<<<<<<< + * break * else: */ - try { - __pyx_v_aIndex.push_back(__pyx_v_i); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 174, __pyx_L1_error) - } + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_v_lIndex = __pyx_t_6; - /* "kernel.pyx":175 - * aDistance.push_back(dDistance) - * aIndex.push_back(i) - * npoint = npoint + 1 # <<<<<<<<<<<<<< + /* "kernel.pyx":108 + * iFlag_exist = 1 + * lIndex = k + * break # <<<<<<<<<<<<<< * else: - * if diff < 1.0: + * pass */ - __pyx_v_npoint = (__pyx_v_npoint + 1); + goto __pyx_L7_break; - /* "kernel.pyx":171 - * pVertex = aVertex_in[k] - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) - * if iFlag_overlap == 1: # <<<<<<<<<<<<<< + /* "kernel.pyx":105 + * dDistance = pVertex.calculate_distance(pVertex_in) + * #if pVertex == pVertex_in: + * if dDistance < dThreshold_in: # <<<<<<<<<<<<<< * iFlag_exist = 1 - * aDistance.push_back(dDistance) + * lIndex = k */ - goto __pyx_L10; } - /* "kernel.pyx":177 - * npoint = npoint + 1 - * else: - * if diff < 1.0: # <<<<<<<<<<<<<< - * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) - * pass - */ - /*else*/ { - __pyx_t_4 = PyObject_RichCompare(__pyx_v_diff, __pyx_float_1_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 177, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_2) { - - /* "kernel.pyx":178 + /* "kernel.pyx":110 + * break * else: - * if diff < 1.0: - * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) # <<<<<<<<<<<<<< - * pass + * pass # <<<<<<<<<<<<<< + * pass * */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_check_vertex_on_edge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_v_pVertex) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_pVertex); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF_SET(__pyx_v_iFlag_overlap, __pyx_t_4); - __pyx_t_4 = 0; - - /* "kernel.pyx":177 - * npoint = npoint + 1 - * else: - * if diff < 1.0: # <<<<<<<<<<<<<< - * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) - * pass - */ - } + /*else*/ { } - __pyx_L10:; - /* "kernel.pyx":168 - * pBound= (left, bottom, right, top) + /* "kernel.pyx":101 * aIntersect = list(index_vertex.search(pBound)) + * * for k in aIntersect: # <<<<<<<<<<<<<< * pVertex = aVertex_in[k] - * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) - */ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "kernel.pyx":196 - * # - * #re-order - * if iFlag_exist == 1 : # <<<<<<<<<<<<<< - * x = np.array(aDistance) - * b = np.argsort(x) - */ - __pyx_t_2 = ((__pyx_v_iFlag_exist == 1) != 0); - if (__pyx_t_2) { - - /* "kernel.pyx":197 - * #re-order - * if iFlag_exist == 1 : - * x = np.array(aDistance) # <<<<<<<<<<<<<< - * b = np.argsort(x) - * c = np.array(aIndex) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_vector_to_py_double(__pyx_v_aDistance); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_x = __pyx_t_9; - - /* "kernel.pyx":198 - * if iFlag_exist == 1 : - * x = np.array(aDistance) - * b = np.argsort(x) # <<<<<<<<<<<<<< - * c = np.array(aIndex) - * d= c[b] - */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argsort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_b = __pyx_t_3; - __pyx_t_3 = 0; - - /* "kernel.pyx":199 - * x = np.array(aDistance) - * b = np.argsort(x) - * c = np.array(aIndex) # <<<<<<<<<<<<<< - * d= c[b] - * aIndex_order = list(d) - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_convert_vector_to_py_int(__pyx_v_aIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - } - } - __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_c = __pyx_t_3; - __pyx_t_3 = 0; - - /* "kernel.pyx":200 - * b = np.argsort(x) - * c = np.array(aIndex) - * d= c[b] # <<<<<<<<<<<<<< - * aIndex_order = list(d) - * - */ - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_c, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_d = __pyx_t_3; - __pyx_t_3 = 0; - - /* "kernel.pyx":201 - * c = np.array(aIndex) - * d= c[b] - * aIndex_order = list(d) # <<<<<<<<<<<<<< - * - * else: - */ - __pyx_t_3 = PySequence_List(__pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __pyx_convert_vector_from_py_int(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_aIndex_order = __pyx_t_15; - - /* "kernel.pyx":196 - * # - * #re-order - * if iFlag_exist == 1 : # <<<<<<<<<<<<<< - * x = np.array(aDistance) - * b = np.argsort(x) + * dDistance = pVertex.calculate_distance(pVertex_in) */ } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9_for_end; + __pyx_L7_break:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L9_for_end; + __pyx_L9_for_end:; - /* "kernel.pyx":142 + /* "kernel.pyx":79 * nVertex= len(aVertex_in) - * npoint = 0 + * * if nVertex > 0 : # <<<<<<<<<<<<<< - * index_vertex = RTree(max_cap=5, min_cap=2) + * index_vertex = RTree( max_cap=5, min_cap=2) * for i in range(nVertex): */ - goto __pyx_L3; } - /* "kernel.pyx":204 + /* "kernel.pyx":129 + * # pass * - * else: - * pass # <<<<<<<<<<<<<< + * return iFlag_exist, lIndex # <<<<<<<<<<<<<< * - * return iFlag_exist, npoint, aIndex_order - */ - /*else*/ { - } - __pyx_L3:; - - /* "kernel.pyx":206 - * pass - * - * return iFlag_exist, npoint, aIndex_order # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) # deactivate bnds checking + * @cython.boundscheck(False) # deactivate bnds checking */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_npoint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __pyx_convert_vector_to_py_int(__pyx_v_aIndex_order); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_lIndex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_11 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "kernel.pyx":132 + /* "kernel.pyx":61 * * @cython.boundscheck(False) # deactivate bnds checking - * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< - * # - * cdef int iFlag_exist = 0 + * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[find the index of a vertex in a list] + * */ /* function exit code */ @@ -3781,111 +4384,168 @@ static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_i __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_index_vertex); __Pyx_XDECREF(__pyx_v_pBound); - __Pyx_XDECREF(__pyx_v_pVertex_start); - __Pyx_XDECREF(__pyx_v_pVertex_end); - __Pyx_XDECREF(__pyx_v_x1); - __Pyx_XDECREF(__pyx_v_y1); - __Pyx_XDECREF(__pyx_v_x2); - __Pyx_XDECREF(__pyx_v_y2); __Pyx_XDECREF(__pyx_v_aIntersect); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_pVertex); - __Pyx_XDECREF(__pyx_v_iFlag_overlap); - __Pyx_XDECREF(__pyx_v_dDistance); - __Pyx_XDECREF(__pyx_v_diff); - __Pyx_XDECREF(__pyx_v_b); - __Pyx_XDECREF(__pyx_v_c); - __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_4find_vertex_in_list, "[find the index of a vertex in a list]\n\n Args:\n aVertex_in ([type]): [description]\n pVertex_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "); +static PyMethodDef __pyx_mdef_6kernel_5find_vertex_in_list = {"find_vertex_in_list", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_5find_vertex_in_list, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_4find_vertex_in_list}; +static PyObject *__pyx_pw_6kernel_5find_vertex_in_list(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { PyObject *__pyx_v_aVertex_in = 0; - PyObject *__pyx_v_pEdge_in = 0; + PyObject *__pyx_v_pVertex_in = 0; + double __pyx_v_dThreshold_in; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("find_vertex_on_edge (wrapper)", 0); + __Pyx_RefNannySetupContext("find_vertex_in_list (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pEdge_in,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pVertex_in,&__pyx_n_s_dThreshold_in,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aVertex_in)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aVertex_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pEdge_in)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pVertex_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("find_vertex_on_edge", 1, 2, 2, 1); __PYX_ERR(0, 132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_vertex_in_list", 0, 2, 3, 1); __PYX_ERR(0, 61, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dThreshold_in); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_vertex_on_edge") < 0)) __PYX_ERR(0, 132, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_vertex_in_list") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } __pyx_v_aVertex_in = ((PyObject*)values[0]); - __pyx_v_pEdge_in = values[1]; + __pyx_v_pVertex_in = values[1]; + if (values[2]) { + __pyx_v_dThreshold_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dThreshold_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + } else { + __pyx_v_dThreshold_in = ((double)1.0E-6); + } } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_vertex_on_edge", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_vertex_in_list", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 132, __pyx_L1_error) - __pyx_r = __pyx_pf_6kernel_6find_vertex_on_edge(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pEdge_in); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_r = __pyx_pf_6kernel_4find_vertex_in_list(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pVertex_in, __pyx_v_dThreshold_in); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6kernel_6find_vertex_on_edge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pEdge_in) { +static PyObject *__pyx_pf_6kernel_4find_vertex_in_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, double __pyx_v_dThreshold_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6kernel_find_vertex_in_list __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_vertex_on_edge", 0); + __Pyx_RefNannySetupContext("find_vertex_in_list", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_find_vertex_on_edge(__pyx_v_aVertex_in, __pyx_v_pEdge_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.dThreshold_in = __pyx_v_dThreshold_in; + __pyx_t_1 = __pyx_f_6kernel_find_vertex_in_list(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3894,7 +4554,7 @@ static PyObject *__pyx_pf_6kernel_6find_vertex_on_edge(CYTHON_UNUSED PyObject *_ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.find_vertex_in_list", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3902,838 +4562,1282 @@ static PyObject *__pyx_pf_6kernel_6find_vertex_on_edge(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "kernel.pyx":209 +/* "kernel.pyx":132 * * @cython.boundscheck(False) # deactivate bnds checking - * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< - * """[add a vertex to a list if it is not already included] - * + * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< + * # + * cdef int iFlag_exist = 0 */ -static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_add_unique_vertex(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6kernel_add_unique_vertex *__pyx_optional_args) { - double __pyx_v_dThreshold_in = ((double)1.0E-6); +static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_find_vertex_on_edge(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pEdge_in, CYTHON_UNUSED int __pyx_skip_dispatch) { int __pyx_v_iFlag_exist; - CYTHON_UNUSED int __pyx_v_nVertex; - CYTHON_UNUSED int __pyx_v_dummy; + int __pyx_v_nVertex; + int __pyx_v_npoint; + std::vector __pyx_v_aIndex; + std::vector __pyx_v_aIndex_order; + std::vector __pyx_v_aDistance; + double __pyx_v_x; + double __pyx_v_y; + double __pyx_v_left; + double __pyx_v_right; + double __pyx_v_bottom; + double __pyx_v_top; + PyObject *__pyx_v_index_vertex = NULL; + int __pyx_v_i; + int __pyx_v_lID; + PyObject *__pyx_v_pBound = NULL; + PyObject *__pyx_v_pVertex_start = NULL; + PyObject *__pyx_v_pVertex_end = NULL; + PyObject *__pyx_v_x1 = NULL; + PyObject *__pyx_v_y1 = NULL; + PyObject *__pyx_v_x2 = NULL; + PyObject *__pyx_v_y2 = NULL; + PyObject *__pyx_v_aIntersect = NULL; + PyObject *__pyx_v_k = NULL; + PyObject *__pyx_v_pVertex = NULL; + PyObject *__pyx_v_iFlag_overlap = NULL; + PyObject *__pyx_v_dDistance = NULL; + PyObject *__pyx_v_diff = NULL; + PyObject *__pyx_v_b = NULL; + PyObject *__pyx_v_c = NULL; + PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - struct __pyx_opt_args_6kernel_find_vertex_in_list __pyx_t_3; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_6; + int __pyx_t_7; int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; + double __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *(*__pyx_t_14)(PyObject *); + std::vector __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("add_unique_vertex", 0); - if (__pyx_optional_args) { - if (__pyx_optional_args->__pyx_n > 0) { - __pyx_v_dThreshold_in = __pyx_optional_args->dThreshold_in; - } - } + __Pyx_RefNannySetupContext("find_vertex_on_edge", 1); - /* "kernel.pyx":222 - * cdef int nVertex - * cdef int dummy - * iFlag_exist = 0 # <<<<<<<<<<<<<< - * nVertex = len(aVertex_in) - * + /* "kernel.pyx":134 + * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): + * # + * cdef int iFlag_exist = 0 # <<<<<<<<<<<<<< + * cdef int nVertex, npoint + * cdef vector[int] aIndex ,aIndex_order */ __pyx_v_iFlag_exist = 0; - /* "kernel.pyx":223 - * cdef int dummy - * iFlag_exist = 0 - * nVertex = len(aVertex_in) # <<<<<<<<<<<<<< + /* "kernel.pyx":140 + * cdef double x, y, left, right, bottom, top * - * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) + * nVertex= len(aVertex_in) # <<<<<<<<<<<<<< + * npoint = 0 + * if nVertex > 0 : */ if (unlikely(__pyx_v_aVertex_in == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 223, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_v_nVertex = __pyx_t_1; - /* "kernel.pyx":225 - * nVertex = len(aVertex_in) - * - * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) # <<<<<<<<<<<<<< + /* "kernel.pyx":141 * - * if iFlag_exist == 1: + * nVertex= len(aVertex_in) + * npoint = 0 # <<<<<<<<<<<<<< + * if nVertex > 0 : + * index_vertex = RTree(max_cap=5, min_cap=2) */ - __pyx_t_3.__pyx_n = 1; - __pyx_t_3.dThreshold_in = __pyx_v_dThreshold_in; - __pyx_t_2 = __pyx_f_6kernel_find_vertex_in_list(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 225, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_v_npoint = 0; + + /* "kernel.pyx":142 + * nVertex= len(aVertex_in) + * npoint = 0 + * if nVertex > 0 : # <<<<<<<<<<<<<< + * index_vertex = RTree(max_cap=5, min_cap=2) + * for i in range(nVertex): + */ + __pyx_t_2 = (__pyx_v_nVertex > 0); + if (__pyx_t_2) { + + /* "kernel.pyx":143 + * npoint = 0 + * if nVertex > 0 : + * index_vertex = RTree(max_cap=5, min_cap=2) # <<<<<<<<<<<<<< + * for i in range(nVertex): + * lID = i + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RTree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_cap, __pyx_int_5) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_min_cap, __pyx_int_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 225, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 225, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_iFlag_exist = __pyx_t_8; - __pyx_v_dummy = __pyx_t_9; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_index_vertex = __pyx_t_5; + __pyx_t_5 = 0; - /* "kernel.pyx":227 - * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) - * - * if iFlag_exist == 1: # <<<<<<<<<<<<<< - * pass - * else: + /* "kernel.pyx":144 + * if nVertex > 0 : + * index_vertex = RTree(max_cap=5, min_cap=2) + * for i in range(nVertex): # <<<<<<<<<<<<<< + * lID = i + * x = aVertex_in[i].dLongitude_degree */ - __pyx_t_10 = ((__pyx_v_iFlag_exist == 1) != 0); - if (__pyx_t_10) { - goto __pyx_L5; - } + __pyx_t_6 = __pyx_v_nVertex; + __pyx_t_7 = __pyx_t_6; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; - /* "kernel.pyx":230 - * pass - * else: - * aVertex_in.append(pVertex_in) # <<<<<<<<<<<<<< - * pass - * + /* "kernel.pyx":145 + * index_vertex = RTree(max_cap=5, min_cap=2) + * for i in range(nVertex): + * lID = i # <<<<<<<<<<<<<< + * x = aVertex_in[i].dLongitude_degree + * y = aVertex_in[i].dLatitude_degree */ - /*else*/ { - if (unlikely(__pyx_v_aVertex_in == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 230, __pyx_L1_error) - } - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_aVertex_in, __pyx_v_pVertex_in); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) - } - __pyx_L5:; + __pyx_v_lID = __pyx_v_i; - /* "kernel.pyx":233 - * pass - * - * return aVertex_in, iFlag_exist # <<<<<<<<<<<<<< - * - * + /* "kernel.pyx":146 + * for i in range(nVertex): + * lID = i + * x = aVertex_in[i].dLongitude_degree # <<<<<<<<<<<<<< + * y = aVertex_in[i].dLatitude_degree + * left = x - 1E-5 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_aVertex_in); - __Pyx_GIVEREF(__pyx_v_aVertex_in); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_aVertex_in); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + if (unlikely(__pyx_v_aVertex_in == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 146, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_x = __pyx_t_9; - /* "kernel.pyx":209 - * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< - * """[add a vertex to a list if it is not already included] - * + /* "kernel.pyx":147 + * lID = i + * x = aVertex_in[i].dLongitude_degree + * y = aVertex_in[i].dLatitude_degree # <<<<<<<<<<<<<< + * left = x - 1E-5 + * right= x + 1E-5 */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6kernel_8add_unique_vertex[] = "[add a vertex to a list if it is not already included]\n\n Args:\n aVertex_in ([type]): [description]\n pVertex_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "; -static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_aVertex_in = 0; - PyObject *__pyx_v_pVertex_in = 0; - double __pyx_v_dThreshold_in; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("add_unique_vertex (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pVertex_in,&__pyx_n_s_dThreshold_in,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_aVertex_in)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pVertex_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("add_unique_vertex", 0, 2, 3, 1); __PYX_ERR(0, 209, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dThreshold_in); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_unique_vertex") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; + if (unlikely(__pyx_v_aVertex_in == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 147, __pyx_L1_error) } - } - __pyx_v_aVertex_in = ((PyObject*)values[0]); - __pyx_v_pVertex_in = values[1]; - if (values[2]) { - __pyx_v_dThreshold_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dThreshold_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) - } else { - __pyx_v_dThreshold_in = ((double)1.0E-6); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_unique_vertex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 209, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 209, __pyx_L1_error) - __pyx_r = __pyx_pf_6kernel_8add_unique_vertex(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pVertex_in, __pyx_v_dThreshold_in); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_6kernel_8add_unique_vertex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, double __pyx_v_dThreshold_in) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - struct __pyx_opt_args_6kernel_add_unique_vertex __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("add_unique_vertex", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_2.__pyx_n = 1; - __pyx_t_2.dThreshold_in = __pyx_v_dThreshold_in; - __pyx_t_1 = __pyx_f_6kernel_add_unique_vertex(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_aVertex_in, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_y = __pyx_t_9; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "kernel.pyx":148 + * x = aVertex_in[i].dLongitude_degree + * y = aVertex_in[i].dLatitude_degree + * left = x - 1E-5 # <<<<<<<<<<<<<< + * right= x + 1E-5 + * bottom= y -1E-5 + */ + __pyx_v_left = (__pyx_v_x - 1E-5); -/* "kernel.pyx":238 - * @cython.boundscheck(False) # deactivate bnds checking - * #cdef angle_between_vectors_coordinates(double *u, double *v): - * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< - * """Return the angle between two vectors in any dimension space, - * in degrees. + /* "kernel.pyx":149 + * y = aVertex_in[i].dLatitude_degree + * left = x - 1E-5 + * right= x + 1E-5 # <<<<<<<<<<<<<< + * bottom= y -1E-5 + * top= y + 1E-5 */ + __pyx_v_right = (__pyx_v_x + 1E-5); -static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_angle_between_vectors_coordinates(double __pyx_v_x1, double __pyx_v_y1, double __pyx_v_z1, double __pyx_v_x2, double __pyx_v_y2, double __pyx_v_z2, CYTHON_UNUSED int __pyx_skip_dispatch) { - double __pyx_v_a; - double __pyx_v_b; - double __pyx_v_c; - double __pyx_v_d; - double __pyx_v_e; - double __pyx_v_f; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - double __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("angle_between_vectors_coordinates", 0); - - /* "kernel.pyx":243 - * """ - * cdef double a, b, c, d, e, f - * a = x1*x2 + y1*y2 + z1*z2 # <<<<<<<<<<<<<< - * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) + /* "kernel.pyx":150 + * left = x - 1E-5 + * right= x + 1E-5 + * bottom= y -1E-5 # <<<<<<<<<<<<<< + * top= y + 1E-5 + * pBound= (left, bottom, right, top) */ - __pyx_v_a = (((__pyx_v_x1 * __pyx_v_x2) + (__pyx_v_y1 * __pyx_v_y2)) + (__pyx_v_z1 * __pyx_v_z2)); + __pyx_v_bottom = (__pyx_v_y - 1E-5); - /* "kernel.pyx":244 - * cdef double a, b, c, d, e, f - * a = x1*x2 + y1*y2 + z1*z2 - * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) # <<<<<<<<<<<<<< - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) - * d = a / (b* c) + /* "kernel.pyx":151 + * right= x + 1E-5 + * bottom= y -1E-5 + * top= y + 1E-5 # <<<<<<<<<<<<<< + * pBound= (left, bottom, right, top) + * index_vertex.insert(lID, pBound) # */ - __pyx_v_b = sqrt((((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y1 * __pyx_v_y1)) + (__pyx_v_z1 * __pyx_v_z1))); + __pyx_v_top = (__pyx_v_y + 1E-5); - /* "kernel.pyx":245 - * a = x1*x2 + y1*y2 + z1*z2 - * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) # <<<<<<<<<<<<<< - * d = a / (b* c) - * if d > 1: + /* "kernel.pyx":152 + * bottom= y -1E-5 + * top= y + 1E-5 + * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< + * index_vertex.insert(lID, pBound) # + * pass */ - __pyx_v_c = sqrt((((__pyx_v_x2 * __pyx_v_x2) + (__pyx_v_y2 * __pyx_v_y2)) + (__pyx_v_z2 * __pyx_v_z2))); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_11); + __pyx_t_11 = 0; - /* "kernel.pyx":246 - * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) - * d = a / (b* c) # <<<<<<<<<<<<<< - * if d > 1: - * d = 1 + /* "kernel.pyx":153 + * top= y + 1E-5 + * pBound= (left, bottom, right, top) + * index_vertex.insert(lID, pBound) # # <<<<<<<<<<<<<< + * pass + * #now the new vertex */ - __pyx_t_1 = (__pyx_v_b * __pyx_v_c); - if (unlikely(__pyx_t_1 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 246, __pyx_L1_error) - } - __pyx_v_d = (__pyx_v_a / __pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_insert); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_lID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_12 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_12 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_pBound}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } - /* "kernel.pyx":247 - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) - * d = a / (b* c) - * if d > 1: # <<<<<<<<<<<<<< - * d = 1 - * if d < -1: + /* "kernel.pyx":156 + * pass + * #now the new vertex + * pVertex_start = pEdge_in.pVertex_start # <<<<<<<<<<<<<< + * pVertex_end = pEdge_in.pVertex_end + * x1=pVertex_start.dLongitude_degree */ - __pyx_t_2 = ((__pyx_v_d > 1.0) != 0); - if (__pyx_t_2) { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_pVertex_start); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_pVertex_start = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":248 - * d = a / (b* c) - * if d > 1: - * d = 1 # <<<<<<<<<<<<<< - * if d < -1: - * d = -1 + /* "kernel.pyx":157 + * #now the new vertex + * pVertex_start = pEdge_in.pVertex_start + * pVertex_end = pEdge_in.pVertex_end # <<<<<<<<<<<<<< + * x1=pVertex_start.dLongitude_degree + * y1=pVertex_start.dLatitude_degree */ - __pyx_v_d = 1.0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_pVertex_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_pVertex_end = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":247 - * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) - * d = a / (b* c) - * if d > 1: # <<<<<<<<<<<<<< - * d = 1 - * if d < -1: + /* "kernel.pyx":158 + * pVertex_start = pEdge_in.pVertex_start + * pVertex_end = pEdge_in.pVertex_end + * x1=pVertex_start.dLongitude_degree # <<<<<<<<<<<<<< + * y1=pVertex_start.dLatitude_degree + * x2=pVertex_end.dLongitude_degree */ - } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_start, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_x1 = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":249 - * if d > 1: - * d = 1 - * if d < -1: # <<<<<<<<<<<<<< - * d = -1 - * e = acos(d) + /* "kernel.pyx":159 + * pVertex_end = pEdge_in.pVertex_end + * x1=pVertex_start.dLongitude_degree + * y1=pVertex_start.dLatitude_degree # <<<<<<<<<<<<<< + * x2=pVertex_end.dLongitude_degree + * y2=pVertex_end.dLatitude_degree */ - __pyx_t_2 = ((__pyx_v_d < -1.0) != 0); - if (__pyx_t_2) { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_start, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_y1 = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":250 - * d = 1 - * if d < -1: - * d = -1 # <<<<<<<<<<<<<< - * e = acos(d) - * f = e / pi * 180.0 + /* "kernel.pyx":160 + * x1=pVertex_start.dLongitude_degree + * y1=pVertex_start.dLatitude_degree + * x2=pVertex_end.dLongitude_degree # <<<<<<<<<<<<<< + * y2=pVertex_end.dLatitude_degree + * left = np.min([x1, x2]) */ - __pyx_v_d = -1.0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_end, __pyx_n_s_dLongitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_x2 = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":249 - * if d > 1: - * d = 1 - * if d < -1: # <<<<<<<<<<<<<< - * d = -1 - * e = acos(d) + /* "kernel.pyx":161 + * y1=pVertex_start.dLatitude_degree + * x2=pVertex_end.dLongitude_degree + * y2=pVertex_end.dLatitude_degree # <<<<<<<<<<<<<< + * left = np.min([x1, x2]) + * right = np.max([x1, x2]) */ - } + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pVertex_end, __pyx_n_s_dLatitude_degree); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_y2 = __pyx_t_11; + __pyx_t_11 = 0; - /* "kernel.pyx":251 - * if d < -1: - * d = -1 - * e = acos(d) # <<<<<<<<<<<<<< - * f = e / pi * 180.0 - * return f + /* "kernel.pyx":162 + * x2=pVertex_end.dLongitude_degree + * y2=pVertex_end.dLatitude_degree + * left = np.min([x1, x2]) # <<<<<<<<<<<<<< + * right = np.max([x1, x2]) + * bottom = np.min([y1, y2]) */ - __pyx_v_e = acos(__pyx_v_d); + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_x1); + __Pyx_GIVEREF(__pyx_v_x1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_x1)) __PYX_ERR(0, 162, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_x2); + __Pyx_GIVEREF(__pyx_v_x2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_x2)) __PYX_ERR(0, 162, __pyx_L1_error); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_left = __pyx_t_9; - /* "kernel.pyx":252 - * d = -1 - * e = acos(d) - * f = e / pi * 180.0 # <<<<<<<<<<<<<< - * return f - * + /* "kernel.pyx":163 + * y2=pVertex_end.dLatitude_degree + * left = np.min([x1, x2]) + * right = np.max([x1, x2]) # <<<<<<<<<<<<<< + * bottom = np.min([y1, y2]) + * top = np.max([y1, y2]) */ - if (unlikely(__pyx_v_6kernel_pi == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 252, __pyx_L1_error) - } - __pyx_v_f = ((__pyx_v_e / __pyx_v_6kernel_pi) * 180.0); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_x1); + __Pyx_GIVEREF(__pyx_v_x1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_x1)) __PYX_ERR(0, 163, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_x2); + __Pyx_GIVEREF(__pyx_v_x2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_x2)) __PYX_ERR(0, 163, __pyx_L1_error); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_right = __pyx_t_9; - /* "kernel.pyx":253 - * e = acos(d) - * f = e / pi * 180.0 - * return f # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) # deactivate bnds checking + /* "kernel.pyx":164 + * left = np.min([x1, x2]) + * right = np.max([x1, x2]) + * bottom = np.min([y1, y2]) # <<<<<<<<<<<<<< + * top = np.max([y1, y2]) + * pBound= (left, bottom, right, top) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_y1); + __Pyx_GIVEREF(__pyx_v_y1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_y1)) __PYX_ERR(0, 164, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_y2); + __Pyx_GIVEREF(__pyx_v_y2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_v_y2)) __PYX_ERR(0, 164, __pyx_L1_error); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_bottom = __pyx_t_9; - /* "kernel.pyx":238 - * @cython.boundscheck(False) # deactivate bnds checking - * #cdef angle_between_vectors_coordinates(double *u, double *v): - * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< - * """Return the angle between two vectors in any dimension space, - * in degrees. + /* "kernel.pyx":165 + * right = np.max([x1, x2]) + * bottom = np.min([y1, y2]) + * top = np.max([y1, y2]) # <<<<<<<<<<<<<< + * pBound= (left, bottom, right, top) + * aIntersect = list(index_vertex.search(pBound)) */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_max); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_y1); + __Pyx_GIVEREF(__pyx_v_y1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_y1)) __PYX_ERR(0, 165, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_y2); + __Pyx_GIVEREF(__pyx_v_y2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_y2)) __PYX_ERR(0, 165, __pyx_L1_error); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_top = __pyx_t_9; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "kernel.pyx":166 + * bottom = np.min([y1, y2]) + * top = np.max([y1, y2]) + * pBound= (left, bottom, right, top) # <<<<<<<<<<<<<< + * aIntersect = list(index_vertex.search(pBound)) + * for k in aIntersect: + */ + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_left); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_bottom); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_top); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11)) __PYX_ERR(0, 166, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error); + __pyx_t_11 = 0; + __pyx_t_10 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_pBound, __pyx_t_5); + __pyx_t_5 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6kernel_10angle_between_vectors_coordinates[] = "Return the angle between two vectors in any dimension space,\n in degrees.\n "; -static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - double __pyx_v_x1; - double __pyx_v_y1; - double __pyx_v_z1; - double __pyx_v_x2; - double __pyx_v_y2; - double __pyx_v_z2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("angle_between_vectors_coordinates (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_z1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_z2,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 1); __PYX_ERR(0, 238, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 2); __PYX_ERR(0, 238, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 3); __PYX_ERR(0, 238, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 4); __PYX_ERR(0, 238, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 5); __PYX_ERR(0, 238, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "angle_between_vectors_coordinates") < 0)) __PYX_ERR(0, 238, __pyx_L3_error) + /* "kernel.pyx":167 + * top = np.max([y1, y2]) + * pBound= (left, bottom, right, top) + * aIntersect = list(index_vertex.search(pBound)) # <<<<<<<<<<<<<< + * for k in aIntersect: + * pVertex = aVertex_in[k] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index_vertex, __pyx_n_s_search); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; } - } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } - __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_v_z1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_z1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_v_x2 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_x2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_v_y2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_y2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_v_z2 = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_10angle_between_vectors_coordinates(__pyx_self, __pyx_v_x1, __pyx_v_y1, __pyx_v_z1, __pyx_v_x2, __pyx_v_y2, __pyx_v_z2); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_pBound}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_aIntersect = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "kernel.pyx":168 + * pBound= (left, bottom, right, top) + * aIntersect = list(index_vertex.search(pBound)) + * for k in aIntersect: # <<<<<<<<<<<<<< + * pVertex = aVertex_in[k] + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + */ + __pyx_t_4 = __pyx_v_aIntersect; __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + #endif + if (__pyx_t_1 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); + __pyx_t_5 = 0; -static PyObject *__pyx_pf_6kernel_10angle_between_vectors_coordinates(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x1, double __pyx_v_y1, double __pyx_v_z1, double __pyx_v_x2, double __pyx_v_y2, double __pyx_v_z2) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("angle_between_vectors_coordinates", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_angle_between_vectors_coordinates(__pyx_v_x1, __pyx_v_y1, __pyx_v_z1, __pyx_v_x2, __pyx_v_y2, __pyx_v_z2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + /* "kernel.pyx":169 + * aIntersect = list(index_vertex.search(pBound)) + * for k in aIntersect: + * pVertex = aVertex_in[k] # <<<<<<<<<<<<<< + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + * if iFlag_overlap == 1: + */ + if (unlikely(__pyx_v_aVertex_in == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 169, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_aVertex_in, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_v_pVertex, __pyx_t_5); + __pyx_t_5 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "kernel.pyx":170 + * for k in aIntersect: + * pVertex = aVertex_in[k] + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) # <<<<<<<<<<<<<< + * if iFlag_overlap == 1: + * iFlag_exist = 1 + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_check_vertex_on_edge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_pVertex}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { + PyObject* sequence = __pyx_t_5; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 170, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + __pyx_t_11 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #endif + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 2; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_L9_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_iFlag_overlap, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_dDistance, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_diff, __pyx_t_11); + __pyx_t_11 = 0; -/* "kernel.pyx":256 - * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< - * """Convert a point given latitude and longitude in radians to - * 3-dimensional space, assuming a sphere radius of one.""" + /* "kernel.pyx":171 + * pVertex = aVertex_in[k] + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + * if iFlag_overlap == 1: # <<<<<<<<<<<<<< + * iFlag_exist = 1 + * aDistance.push_back(dDistance) */ + __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_iFlag_overlap, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) + if (__pyx_t_2) { -static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static __pyx_ctuple_double__and_double__and_double __pyx_f_6kernel_longlat_to_3d(PyObject *__pyx_v_dLongitude_degree_in, PyObject *__pyx_v_dLatitude_degree_in, CYTHON_UNUSED int __pyx_skip_dispatch) { - double __pyx_v_x; - double __pyx_v_y; - double __pyx_v_z; - PyObject *__pyx_v_dLongitude_radian = NULL; - PyObject *__pyx_v_dLatitude_radian = NULL; - __pyx_ctuple_double__and_double__and_double __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - double __pyx_t_4; - double __pyx_t_5; - __pyx_ctuple_double__and_double__and_double __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("longlat_to_3d", 0); + /* "kernel.pyx":172 + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + * if iFlag_overlap == 1: + * iFlag_exist = 1 # <<<<<<<<<<<<<< + * aDistance.push_back(dDistance) + * aIndex.push_back(i) + */ + __pyx_v_iFlag_exist = 1; - /* "kernel.pyx":264 - * cdef double dLongitude_degree, dLatitude_degree - * - * dLongitude_radian = dLongitude_degree_in / 180.0 * pi # <<<<<<<<<<<<<< - * dLatitude_radian = dLatitude_degree_in / 180.0 * pi - * + /* "kernel.pyx":173 + * if iFlag_overlap == 1: + * iFlag_exist = 1 + * aDistance.push_back(dDistance) # <<<<<<<<<<<<<< + * aIndex.push_back(i) + * npoint = npoint + 1 */ - __pyx_t_1 = __Pyx_PyFloat_DivideObjC(__pyx_v_dLongitude_degree_in, __pyx_float_180_0, 180.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6kernel_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_dLongitude_radian = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_dDistance); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error) + try { + __pyx_v_aDistance.push_back(__pyx_t_9); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 173, __pyx_L1_error) + } - /* "kernel.pyx":265 - * - * dLongitude_radian = dLongitude_degree_in / 180.0 * pi - * dLatitude_radian = dLatitude_degree_in / 180.0 * pi # <<<<<<<<<<<<<< - * - * x = cos(dLatitude_radian) * cos(dLongitude_radian) + /* "kernel.pyx":174 + * iFlag_exist = 1 + * aDistance.push_back(dDistance) + * aIndex.push_back(i) # <<<<<<<<<<<<<< + * npoint = npoint + 1 + * else: */ - __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_dLatitude_degree_in, __pyx_float_180_0, 180.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6kernel_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_dLatitude_radian = __pyx_t_1; - __pyx_t_1 = 0; + try { + __pyx_v_aIndex.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 174, __pyx_L1_error) + } - /* "kernel.pyx":267 - * dLatitude_radian = dLatitude_degree_in / 180.0 * pi - * - * x = cos(dLatitude_radian) * cos(dLongitude_radian) # <<<<<<<<<<<<<< - * y = cos(dLatitude_radian) * sin(dLongitude_radian) - * z = sin(dLatitude_radian) + /* "kernel.pyx":175 + * aDistance.push_back(dDistance) + * aIndex.push_back(i) + * npoint = npoint + 1 # <<<<<<<<<<<<<< + * else: + * if diff < 1.0: */ - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_dLongitude_radian); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) - __pyx_v_x = (cos(__pyx_t_4) * cos(__pyx_t_5)); + __pyx_v_npoint = (__pyx_v_npoint + 1); - /* "kernel.pyx":268 - * - * x = cos(dLatitude_radian) * cos(dLongitude_radian) - * y = cos(dLatitude_radian) * sin(dLongitude_radian) # <<<<<<<<<<<<<< - * z = sin(dLatitude_radian) - * + /* "kernel.pyx":171 + * pVertex = aVertex_in[k] + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + * if iFlag_overlap == 1: # <<<<<<<<<<<<<< + * iFlag_exist = 1 + * aDistance.push_back(dDistance) */ - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLongitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) - __pyx_v_y = (cos(__pyx_t_5) * sin(__pyx_t_4)); + goto __pyx_L10; + } - /* "kernel.pyx":269 - * x = cos(dLatitude_radian) * cos(dLongitude_radian) - * y = cos(dLatitude_radian) * sin(dLongitude_radian) - * z = sin(dLatitude_radian) # <<<<<<<<<<<<<< - * - * return x, y, z + /* "kernel.pyx":177 + * npoint = npoint + 1 + * else: + * if diff < 1.0: # <<<<<<<<<<<<<< + * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) + * pass */ - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error) - __pyx_v_z = sin(__pyx_t_4); + /*else*/ { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_diff, __pyx_float_1_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { - /* "kernel.pyx":271 - * z = sin(dLatitude_radian) - * - * return x, y, z # <<<<<<<<<<<<<< - * + /* "kernel.pyx":178 + * else: + * if diff < 1.0: + * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) # <<<<<<<<<<<<<< + * pass * */ - __pyx_t_6.f0 = __pyx_v_x; - __pyx_t_6.f1 = __pyx_v_y; - __pyx_t_6.f2 = __pyx_v_z; - __pyx_r = __pyx_t_6; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_pEdge_in, __pyx_n_s_check_vertex_on_edge); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_pVertex}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF_SET(__pyx_v_iFlag_overlap, __pyx_t_5); + __pyx_t_5 = 0; + + /* "kernel.pyx":177 + * npoint = npoint + 1 + * else: + * if diff < 1.0: # <<<<<<<<<<<<<< + * iFlag_overlap = pEdge_in.check_vertex_on_edge(pVertex) + * pass + */ + } + } + __pyx_L10:; + + /* "kernel.pyx":168 + * pBound= (left, bottom, right, top) + * aIntersect = list(index_vertex.search(pBound)) + * for k in aIntersect: # <<<<<<<<<<<<<< + * pVertex = aVertex_in[k] + * iFlag_overlap, dDistance, diff = pEdge_in.check_vertex_on_edge(pVertex) + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "kernel.pyx":196 + * # + * #re-order + * if iFlag_exist == 1 : # <<<<<<<<<<<<<< + * x = np.array(aDistance) + * b = np.argsort(x) + */ + __pyx_t_2 = (__pyx_v_iFlag_exist == 1); + if (__pyx_t_2) { + + /* "kernel.pyx":197 + * #re-order + * if iFlag_exist == 1 : + * x = np.array(aDistance) # <<<<<<<<<<<<<< + * b = np.argsort(x) + * c = np.array(aIndex) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_convert_vector_to_py_double(__pyx_v_aDistance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_x = __pyx_t_9; + + /* "kernel.pyx":198 + * if iFlag_exist == 1 : + * x = np.array(aDistance) + * b = np.argsort(x) # <<<<<<<<<<<<<< + * c = np.array(aIndex) + * d= c[b] + */ + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_v_b = __pyx_t_4; + __pyx_t_4 = 0; + + /* "kernel.pyx":199 + * x = np.array(aDistance) + * b = np.argsort(x) + * c = np.array(aIndex) # <<<<<<<<<<<<<< + * d= c[b] + * aIndex_order = list(d) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __pyx_convert_vector_to_py_int(__pyx_v_aIndex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_v_c = __pyx_t_4; + __pyx_t_4 = 0; + + /* "kernel.pyx":200 + * b = np.argsort(x) + * c = np.array(aIndex) + * d= c[b] # <<<<<<<<<<<<<< + * aIndex_order = list(d) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_c, __pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_d = __pyx_t_4; + __pyx_t_4 = 0; + + /* "kernel.pyx":201 + * c = np.array(aIndex) + * d= c[b] + * aIndex_order = list(d) # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_t_4 = PySequence_List(__pyx_v_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = __pyx_convert_vector_from_py_int(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_aIndex_order = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_15); + + /* "kernel.pyx":196 + * # + * #re-order + * if iFlag_exist == 1 : # <<<<<<<<<<<<<< + * x = np.array(aDistance) + * b = np.argsort(x) + */ + } + + /* "kernel.pyx":142 + * nVertex= len(aVertex_in) + * npoint = 0 + * if nVertex > 0 : # <<<<<<<<<<<<<< + * index_vertex = RTree(max_cap=5, min_cap=2) + * for i in range(nVertex): + */ + goto __pyx_L3; + } + + /* "kernel.pyx":204 + * + * else: + * pass # <<<<<<<<<<<<<< + * + * return iFlag_exist, npoint, aIndex_order + */ + /*else*/ { + } + __pyx_L3:; + + /* "kernel.pyx":206 + * pass + * + * return iFlag_exist, npoint, aIndex_order # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) # deactivate bnds checking + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_npoint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5 = __pyx_convert_vector_to_py_int(__pyx_v_aIndex_order); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11)) __PYX_ERR(0, 206, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_11 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; - /* "kernel.pyx":256 + /* "kernel.pyx":132 * * @cython.boundscheck(False) # deactivate bnds checking - * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< - * """Convert a point given latitude and longitude in radians to - * 3-dimensional space, assuming a sphere radius of one.""" + * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< + * # + * cdef int iFlag_exist = 0 */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __Pyx_pretend_to_initialize(&__pyx_r); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_dLongitude_radian); - __Pyx_XDECREF(__pyx_v_dLatitude_radian); + __Pyx_XDECREF(__pyx_v_index_vertex); + __Pyx_XDECREF(__pyx_v_pBound); + __Pyx_XDECREF(__pyx_v_pVertex_start); + __Pyx_XDECREF(__pyx_v_pVertex_end); + __Pyx_XDECREF(__pyx_v_x1); + __Pyx_XDECREF(__pyx_v_y1); + __Pyx_XDECREF(__pyx_v_x2); + __Pyx_XDECREF(__pyx_v_y2); + __Pyx_XDECREF(__pyx_v_aIntersect); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_pVertex); + __Pyx_XDECREF(__pyx_v_iFlag_overlap); + __Pyx_XDECREF(__pyx_v_dDistance); + __Pyx_XDECREF(__pyx_v_diff); + __Pyx_XDECREF(__pyx_v_b); + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6kernel_12longlat_to_3d[] = "Convert a point given latitude and longitude in radians to\n 3-dimensional space, assuming a sphere radius of one."; -static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_dLongitude_degree_in = 0; - PyObject *__pyx_v_dLatitude_degree_in = 0; +static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_6kernel_7find_vertex_on_edge = {"find_vertex_on_edge", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_7find_vertex_on_edge, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6kernel_7find_vertex_on_edge(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_aVertex_in = 0; + PyObject *__pyx_v_pEdge_in = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("longlat_to_3d (wrapper)", 0); + __Pyx_RefNannySetupContext("find_vertex_on_edge (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree_in,&__pyx_n_s_dLatitude_degree_in,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pEdge_in,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree_in)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aVertex_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree_in)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pEdge_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("longlat_to_3d", 1, 2, 2, 1); __PYX_ERR(0, 256, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_vertex_on_edge", 1, 2, 2, 1); __PYX_ERR(0, 132, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "longlat_to_3d") < 0)) __PYX_ERR(0, 256, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "find_vertex_on_edge") < 0)) __PYX_ERR(0, 132, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_dLongitude_degree_in = values[0]; - __pyx_v_dLatitude_degree_in = values[1]; + __pyx_v_aVertex_in = ((PyObject*)values[0]); + __pyx_v_pEdge_in = values[1]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("longlat_to_3d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 256, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("find_vertex_on_edge", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 132, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_12longlat_to_3d(__pyx_self, __pyx_v_dLongitude_degree_in, __pyx_v_dLatitude_degree_in); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_r = __pyx_pf_6kernel_6find_vertex_on_edge(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pEdge_in); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6kernel_12longlat_to_3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree_in, PyObject *__pyx_v_dLatitude_degree_in) { +static PyObject *__pyx_pf_6kernel_6find_vertex_on_edge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pEdge_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("longlat_to_3d", 0); + __Pyx_RefNannySetupContext("find_vertex_on_edge", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_convert__to_py___pyx_ctuple_double__and_double__and_double(__pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree_in, __pyx_v_dLatitude_degree_in, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6kernel_find_vertex_on_edge(__pyx_v_aVertex_in, __pyx_v_pEdge_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4742,7 +5846,7 @@ static PyObject *__pyx_pf_6kernel_12longlat_to_3d(CYTHON_UNUSED PyObject *__pyx_ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.find_vertex_on_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4750,182 +5854,201 @@ static PyObject *__pyx_pf_6kernel_12longlat_to_3d(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "kernel.pyx":275 +/* "kernel.pyx":209 * * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< - * #all in degree + * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[add a vertex to a list if it is not already included] * */ -static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_calculate_angle_betwen_vertex(PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in, CYTHON_UNUSED int __pyx_skip_dispatch) { - double __pyx_v_angle3deg; - double __pyx_v_x1; - double __pyx_v_y1; - double __pyx_v_z1; - double __pyx_v_x2; - double __pyx_v_y2; - double __pyx_v_z2; - double __pyx_v_x3; - double __pyx_v_y3; - double __pyx_v_z3; - double __pyx_v_x4; - double __pyx_v_y4; - double __pyx_v_z4; - double __pyx_v_x5; - double __pyx_v_y5; - double __pyx_v_z5; +static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_add_unique_vertex(PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6kernel_add_unique_vertex *__pyx_optional_args) { + double __pyx_v_dThreshold_in = ((double)1.0E-6); + int __pyx_v_iFlag_exist; + CYTHON_UNUSED int __pyx_v_nVertex; + CYTHON_UNUSED int __pyx_v_dummy; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __pyx_ctuple_double__and_double__and_double __pyx_t_1; - double __pyx_t_2; - double __pyx_t_3; - double __pyx_t_4; + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + struct __pyx_opt_args_6kernel_find_vertex_in_list __pyx_t_3; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex", 0); + __Pyx_RefNannySetupContext("add_unique_vertex", 1); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_dThreshold_in = __pyx_optional_args->dThreshold_in; + } + } - /* "kernel.pyx":286 + /* "kernel.pyx":222 + * cdef int nVertex + * cdef int dummy + * iFlag_exist = 0 # <<<<<<<<<<<<<< + * nVertex = len(aVertex_in) * - * # The points in 3D space - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) # <<<<<<<<<<<<<< - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, 0); - __pyx_t_2 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_4 = __pyx_t_1.f2; - __pyx_v_x1 = __pyx_t_2; - __pyx_v_y1 = __pyx_t_3; - __pyx_v_z1 = __pyx_t_4; + __pyx_v_iFlag_exist = 0; - /* "kernel.pyx":287 - * # The points in 3D space - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) # <<<<<<<<<<<<<< - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) - * # Vectors in 3D space + /* "kernel.pyx":223 + * cdef int dummy + * iFlag_exist = 0 + * nVertex = len(aVertex_in) # <<<<<<<<<<<<<< + * + * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); - __pyx_t_4 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_2 = __pyx_t_1.f2; - __pyx_v_x2 = __pyx_t_4; - __pyx_v_y2 = __pyx_t_3; - __pyx_v_z2 = __pyx_t_2; + if (unlikely(__pyx_v_aVertex_in == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 223, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_aVertex_in); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_v_nVertex = __pyx_t_1; - /* "kernel.pyx":288 - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) # <<<<<<<<<<<<<< - * # Vectors in 3D space + /* "kernel.pyx":225 + * nVertex = len(aVertex_in) + * + * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) # <<<<<<<<<<<<<< * + * if iFlag_exist == 1: */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); - __pyx_t_2 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_4 = __pyx_t_1.f2; - __pyx_v_x3 = __pyx_t_2; - __pyx_v_y3 = __pyx_t_3; - __pyx_v_z3 = __pyx_t_4; + __pyx_t_3.__pyx_n = 1; + __pyx_t_3.dThreshold_in = __pyx_v_dThreshold_in; + __pyx_t_2 = __pyx_f_6kernel_find_vertex_in_list(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 225, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_L4_unpacking_done:; + } + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_iFlag_exist = __pyx_t_8; + __pyx_v_dummy = __pyx_t_9; - /* "kernel.pyx":291 - * # Vectors in 3D space + /* "kernel.pyx":227 + * iFlag_exist, dummy = find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in) * - * x4 = x1 - x2 # <<<<<<<<<<<<<< - * y4 = y1 - y2 - * z4 = z1 - z2 + * if iFlag_exist == 1: # <<<<<<<<<<<<<< + * pass + * else: */ - __pyx_v_x4 = (__pyx_v_x1 - __pyx_v_x2); + __pyx_t_10 = (__pyx_v_iFlag_exist == 1); + if (__pyx_t_10) { + goto __pyx_L5; + } - /* "kernel.pyx":292 + /* "kernel.pyx":230 + * pass + * else: + * aVertex_in.append(pVertex_in) # <<<<<<<<<<<<<< + * pass * - * x4 = x1 - x2 - * y4 = y1 - y2 # <<<<<<<<<<<<<< - * z4 = z1 - z2 - * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] */ - __pyx_v_y4 = (__pyx_v_y1 - __pyx_v_y2); + /*else*/ { + if (unlikely(__pyx_v_aVertex_in == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 230, __pyx_L1_error) + } + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_aVertex_in, __pyx_v_pVertex_in); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) + } + __pyx_L5:; - /* "kernel.pyx":293 - * x4 = x1 - x2 - * y4 = y1 - y2 - * z4 = z1 - z2 # <<<<<<<<<<<<<< - * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] - * x5 = x3 - x2 + /* "kernel.pyx":233 + * pass + * + * return aVertex_in, iFlag_exist # <<<<<<<<<<<<<< + * + * */ - __pyx_v_z4 = (__pyx_v_z1 - __pyx_v_z2); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_iFlag_exist); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_aVertex_in); + __Pyx_GIVEREF(__pyx_v_aVertex_in); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_aVertex_in)) __PYX_ERR(0, 233, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; - /* "kernel.pyx":295 - * z4 = z1 - z2 - * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] - * x5 = x3 - x2 # <<<<<<<<<<<<<< - * y5 = y3 - y2 - * z5 = z3 - z2 - */ - __pyx_v_x5 = (__pyx_v_x3 - __pyx_v_x2); - - /* "kernel.pyx":296 - * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] - * x5 = x3 - x2 - * y5 = y3 - y2 # <<<<<<<<<<<<<< - * z5 = z3 - z2 - * - */ - __pyx_v_y5 = (__pyx_v_y3 - __pyx_v_y2); - - /* "kernel.pyx":297 - * x5 = x3 - x2 - * y5 = y3 - y2 - * z5 = z3 - z2 # <<<<<<<<<<<<<< - * - * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) - */ - __pyx_v_z5 = (__pyx_v_z3 - __pyx_v_z2); - - /* "kernel.pyx":299 - * z5 = z3 - z2 - * - * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) # <<<<<<<<<<<<<< - * return angle3deg - * - */ - __pyx_t_5 = __pyx_f_6kernel_angle_between_vectors_coordinates(__pyx_v_x4, __pyx_v_y4, __pyx_v_z4, __pyx_v_x5, __pyx_v_y5, __pyx_v_z5, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_angle3deg = __pyx_t_4; - - /* "kernel.pyx":300 - * - * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) - * return angle3deg # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) # deactivate bnds checking - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_angle3deg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "kernel.pyx":275 - * - * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< - * #all in degree - * + /* "kernel.pyx":209 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[add a vertex to a list if it is not already included] + * */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4934,123 +6057,154 @@ static PyObject *__pyx_f_6kernel_calculate_angle_betwen_vertex(PyObject *__pyx_v } /* Python wrapper */ -static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_dLongitude_degree1_in = 0; - PyObject *__pyx_v_dLatitude_degree1_in = 0; - PyObject *__pyx_v_dLongitude_degree2_in = 0; - PyObject *__pyx_v_dLatitude_degree2_in = 0; - PyObject *__pyx_v_dLongitude_degree3_in = 0; - PyObject *__pyx_v_dLatitude_degree3_in = 0; +static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_8add_unique_vertex, "[add a vertex to a list if it is not already included]\n\n Args:\n aVertex_in ([type]): [description]\n pVertex_in ([type]): [description]\n\n Returns:\n [type]: [description]\n "); +static PyMethodDef __pyx_mdef_6kernel_9add_unique_vertex = {"add_unique_vertex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_9add_unique_vertex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_8add_unique_vertex}; +static PyObject *__pyx_pw_6kernel_9add_unique_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_aVertex_in = 0; + PyObject *__pyx_v_pVertex_in = 0; + double __pyx_v_dThreshold_in; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex (wrapper)", 0); + __Pyx_RefNannySetupContext("add_unique_vertex (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,&__pyx_n_s_dLongitude_degree3_in,&__pyx_n_s_dLatitude_degree3_in,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_aVertex_in,&__pyx_n_s_pVertex_in,&__pyx_n_s_dThreshold_in,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree1_in)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_aVertex_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree1_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 1); __PYX_ERR(0, 275, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree2_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 2); __PYX_ERR(0, 275, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree2_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 3); __PYX_ERR(0, 275, __pyx_L3_error) + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pVertex_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree3_in)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 4); __PYX_ERR(0, 275, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_unique_vertex", 0, 2, 3, 1); __PYX_ERR(0, 209, __pyx_L3_error) } CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree3_in)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 5); __PYX_ERR(0, 275, __pyx_L3_error) + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dThreshold_in); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_angle_betwen_vertex") < 0)) __PYX_ERR(0, 275, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_unique_vertex") < 0)) __PYX_ERR(0, 209, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { - goto __pyx_L5_argtuple_error; } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_aVertex_in = ((PyObject*)values[0]); + __pyx_v_pVertex_in = values[1]; + if (values[2]) { + __pyx_v_dThreshold_in = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_dThreshold_in == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error) + } else { + __pyx_v_dThreshold_in = ((double)1.0E-6); } - __pyx_v_dLongitude_degree1_in = values[0]; - __pyx_v_dLatitude_degree1_in = values[1]; - __pyx_v_dLongitude_degree2_in = values[2]; - __pyx_v_dLatitude_degree2_in = values[3]; - __pyx_v_dLongitude_degree3_in = values[4]; - __pyx_v_dLatitude_degree3_in = values[5]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 275, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_unique_vertex", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 209, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_14calculate_angle_betwen_vertex(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_aVertex_in), (&PyList_Type), 1, "aVertex_in", 1))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_r = __pyx_pf_6kernel_8add_unique_vertex(__pyx_self, __pyx_v_aVertex_in, __pyx_v_pVertex_in, __pyx_v_dThreshold_in); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6kernel_14calculate_angle_betwen_vertex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in) { +static PyObject *__pyx_pf_6kernel_8add_unique_vertex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_aVertex_in, PyObject *__pyx_v_pVertex_in, double __pyx_v_dThreshold_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6kernel_add_unique_vertex __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex", 0); + __Pyx_RefNannySetupContext("add_unique_vertex", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_calculate_angle_betwen_vertex(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.dThreshold_in = __pyx_v_dThreshold_in; + __pyx_t_1 = __pyx_f_6kernel_add_unique_vertex(__pyx_v_aVertex_in, __pyx_v_pVertex_in, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5059,7 +6213,7 @@ static PyObject *__pyx_pf_6kernel_14calculate_angle_betwen_vertex(CYTHON_UNUSED /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.add_unique_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5067,311 +6221,372 @@ static PyObject *__pyx_pf_6kernel_14calculate_angle_betwen_vertex(CYTHON_UNUSED return __pyx_r; } -/* "kernel.pyx":303 - * +/* "kernel.pyx":238 * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< - * cdef double x1, y1, z1 - * cdef double x2, y2, z2 + * #cdef angle_between_vectors_coordinates(double *u, double *v): + * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< + * """Return the angle between two vectors in any dimension space, + * in degrees. */ -static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_6kernel_calculate_distance_to_plane(PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in, CYTHON_UNUSED int __pyx_skip_dispatch) { - double __pyx_v_x1; - double __pyx_v_y1; - double __pyx_v_z1; - double __pyx_v_x2; - double __pyx_v_y2; - double __pyx_v_z2; - double __pyx_v_x3; - double __pyx_v_y3; - double __pyx_v_z3; - double __pyx_v_distance; - PyObject *__pyx_v_b = 0; - PyObject *__pyx_v_c = 0; +static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_angle_between_vectors_coordinates(double __pyx_v_x1, double __pyx_v_y1, double __pyx_v_z1, double __pyx_v_x2, double __pyx_v_y2, double __pyx_v_z2, CYTHON_UNUSED int __pyx_skip_dispatch) { + double __pyx_v_a; + double __pyx_v_b; + double __pyx_v_c; + double __pyx_v_d; + double __pyx_v_e; + double __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __pyx_ctuple_double__and_double__and_double __pyx_t_1; - double __pyx_t_2; - double __pyx_t_3; - double __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + double __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_distance_to_plane", 0); + __Pyx_RefNannySetupContext("angle_between_vectors_coordinates", 1); - /* "kernel.pyx":310 - * cdef b, c - * # The points in 3D space - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) # <<<<<<<<<<<<<< - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) + /* "kernel.pyx":243 + * """ + * cdef double a, b, c, d, e, f + * a = x1*x2 + y1*y2 + z1*z2 # <<<<<<<<<<<<<< + * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, 0); - __pyx_t_2 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_4 = __pyx_t_1.f2; - __pyx_v_x1 = __pyx_t_2; - __pyx_v_y1 = __pyx_t_3; - __pyx_v_z1 = __pyx_t_4; + __pyx_v_a = (((__pyx_v_x1 * __pyx_v_x2) + (__pyx_v_y1 * __pyx_v_y2)) + (__pyx_v_z1 * __pyx_v_z2)); - /* "kernel.pyx":311 - * # The points in 3D space - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) # <<<<<<<<<<<<<< - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) - * #The formula is x+b*y+c*z=0 + /* "kernel.pyx":244 + * cdef double a, b, c, d, e, f + * a = x1*x2 + y1*y2 + z1*z2 + * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) # <<<<<<<<<<<<<< + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) + * d = a / (b* c) */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); - __pyx_t_4 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_2 = __pyx_t_1.f2; - __pyx_v_x2 = __pyx_t_4; - __pyx_v_y2 = __pyx_t_3; - __pyx_v_z2 = __pyx_t_2; + __pyx_v_b = sqrt((((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y1 * __pyx_v_y1)) + (__pyx_v_z1 * __pyx_v_z1))); - /* "kernel.pyx":312 - * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) - * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) # <<<<<<<<<<<<<< - * #The formula is x+b*y+c*z=0 - * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) + /* "kernel.pyx":245 + * a = x1*x2 + y1*y2 + z1*z2 + * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) # <<<<<<<<<<<<<< + * d = a / (b* c) + * if d > 1: */ - __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); - __pyx_t_2 = __pyx_t_1.f0; - __pyx_t_3 = __pyx_t_1.f1; - __pyx_t_4 = __pyx_t_1.f2; - __pyx_v_x3 = __pyx_t_2; - __pyx_v_y3 = __pyx_t_3; - __pyx_v_z3 = __pyx_t_4; + __pyx_v_c = sqrt((((__pyx_v_x2 * __pyx_v_x2) + (__pyx_v_y2 * __pyx_v_y2)) + (__pyx_v_z2 * __pyx_v_z2))); - /* "kernel.pyx":314 - * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) - * #The formula is x+b*y+c*z=0 - * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) # <<<<<<<<<<<<<< - * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) - * distance = abs( x2 + b * y2 + c * z2 ) + /* "kernel.pyx":246 + * b = sqrt( x1*x1 + y1*y1 + z1*z1 ) + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) + * d = a / (b* c) # <<<<<<<<<<<<<< + * if d > 1: + * d = 1 */ - __pyx_t_4 = (((-__pyx_v_x1) * __pyx_v_y3) + (__pyx_v_x3 * __pyx_v_y1)); - __pyx_t_3 = ((__pyx_v_z1 * __pyx_v_y3) - (__pyx_v_z3 * __pyx_v_y1)); - if (unlikely(__pyx_t_3 == 0)) { + __pyx_t_1 = (__pyx_v_b * __pyx_v_c); + if (unlikely(__pyx_t_1 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 314, __pyx_L1_error) + __PYX_ERR(0, 246, __pyx_L1_error) } - __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_c = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_d = (__pyx_v_a / __pyx_t_1); - /* "kernel.pyx":315 - * #The formula is x+b*y+c*z=0 - * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) - * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) # <<<<<<<<<<<<<< - * distance = abs( x2 + b * y2 + c * z2 ) - * return distance + /* "kernel.pyx":247 + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) + * d = a / (b* c) + * if d > 1: # <<<<<<<<<<<<<< + * d = 1 + * if d < -1: + */ + __pyx_t_2 = (__pyx_v_d > 1.0); + if (__pyx_t_2) { + + /* "kernel.pyx":248 + * d = a / (b* c) + * if d > 1: + * d = 1 # <<<<<<<<<<<<<< + * if d < -1: + * d = -1 + */ + __pyx_v_d = 1.0; + + /* "kernel.pyx":247 + * c = sqrt( x2*x2 + y2*y2 + z2*z2 ) + * d = a / (b* c) + * if d > 1: # <<<<<<<<<<<<<< + * d = 1 + * if d < -1: */ - __pyx_t_3 = (((-__pyx_v_x1) * __pyx_v_z3) + (__pyx_v_x3 * __pyx_v_z1)); - __pyx_t_4 = ((__pyx_v_y1 * __pyx_v_z3) - (__pyx_v_y3 * __pyx_v_z1)); - if (unlikely(__pyx_t_4 == 0)) { - PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 315, __pyx_L1_error) } - __pyx_t_5 = PyFloat_FromDouble((__pyx_t_3 / __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_b = __pyx_t_5; - __pyx_t_5 = 0; - /* "kernel.pyx":316 - * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) - * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) - * distance = abs( x2 + b * y2 + c * z2 ) # <<<<<<<<<<<<<< - * return distance + /* "kernel.pyx":249 + * if d > 1: + * d = 1 + * if d < -1: # <<<<<<<<<<<<<< + * d = -1 + * e = acos(d) + */ + __pyx_t_2 = (__pyx_v_d < -1.0); + if (__pyx_t_2) { + + /* "kernel.pyx":250 + * d = 1 + * if d < -1: + * d = -1 # <<<<<<<<<<<<<< + * e = acos(d) + * f = e / pi * 180.0 + */ + __pyx_v_d = -1.0; + + /* "kernel.pyx":249 + * if d > 1: + * d = 1 + * if d < -1: # <<<<<<<<<<<<<< + * d = -1 + * e = acos(d) + */ + } + + /* "kernel.pyx":251 + * if d < -1: + * d = -1 + * e = acos(d) # <<<<<<<<<<<<<< + * f = e / pi * 180.0 + * return f + */ + __pyx_v_e = acos(__pyx_v_d); + + /* "kernel.pyx":252 + * d = -1 + * e = acos(d) + * f = e / pi * 180.0 # <<<<<<<<<<<<<< + * return f * */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_y2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Multiply(__pyx_v_b, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_z2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyNumber_Multiply(__pyx_v_c, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_distance = __pyx_t_4; + if (unlikely(__pyx_v_6kernel_pi == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 252, __pyx_L1_error) + } + __pyx_v_f = ((__pyx_v_e / __pyx_v_6kernel_pi) * 180.0); - /* "kernel.pyx":317 - * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) - * distance = abs( x2 + b * y2 + c * z2 ) - * return distance # <<<<<<<<<<<<<< + /* "kernel.pyx":253 + * e = acos(d) + * f = e / pi * 180.0 + * return f # <<<<<<<<<<<<<< * + * @cython.boundscheck(False) # deactivate bnds checking */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_f); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "kernel.pyx":303 - * + /* "kernel.pyx":238 * @cython.boundscheck(False) # deactivate bnds checking - * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< - * cdef double x1, y1, z1 - * cdef double x2, y2, z2 + * #cdef angle_between_vectors_coordinates(double *u, double *v): + * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< + * """Return the angle between two vectors in any dimension space, + * in degrees. */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_b); - __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_dLongitude_degree1_in = 0; - PyObject *__pyx_v_dLatitude_degree1_in = 0; - PyObject *__pyx_v_dLongitude_degree2_in = 0; - PyObject *__pyx_v_dLatitude_degree2_in = 0; - PyObject *__pyx_v_dLongitude_degree3_in = 0; - PyObject *__pyx_v_dLatitude_degree3_in = 0; +static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_10angle_between_vectors_coordinates, "Return the angle between two vectors in any dimension space,\n in degrees.\n "); +static PyMethodDef __pyx_mdef_6kernel_11angle_between_vectors_coordinates = {"angle_between_vectors_coordinates", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_11angle_between_vectors_coordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_10angle_between_vectors_coordinates}; +static PyObject *__pyx_pw_6kernel_11angle_between_vectors_coordinates(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + double __pyx_v_x1; + double __pyx_v_y1; + double __pyx_v_z1; + double __pyx_v_x2; + double __pyx_v_y2; + double __pyx_v_z2; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("calculate_distance_to_plane (wrapper)", 0); + __Pyx_RefNannySetupContext("angle_between_vectors_coordinates (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,&__pyx_n_s_dLongitude_degree3_in,&__pyx_n_s_dLatitude_degree3_in,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x1,&__pyx_n_s_y1,&__pyx_n_s_z1,&__pyx_n_s_x2,&__pyx_n_s_y2,&__pyx_n_s_z2,0}; + if (__pyx_kwds) { Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree1_in)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree1_in)) != 0)) kw_args--; + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 1); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 1); __PYX_ERR(0, 238, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree2_in)) != 0)) kw_args--; + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 2); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 2); __PYX_ERR(0, 238, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree2_in)) != 0)) kw_args--; + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 3); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 3); __PYX_ERR(0, 238, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLongitude_degree3_in)) != 0)) kw_args--; + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 4); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 4); __PYX_ERR(0, 238, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dLatitude_degree3_in)) != 0)) kw_args--; + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_z2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 5); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, 5); __PYX_ERR(0, 238, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate_distance_to_plane") < 0)) __PYX_ERR(0, 303, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angle_between_vectors_coordinates") < 0)) __PYX_ERR(0, 238, __pyx_L3_error) } - } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { + } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } - __pyx_v_dLongitude_degree1_in = values[0]; - __pyx_v_dLatitude_degree1_in = values[1]; - __pyx_v_dLongitude_degree2_in = values[2]; - __pyx_v_dLatitude_degree2_in = values[3]; - __pyx_v_dLongitude_degree3_in = values[4]; - __pyx_v_dLatitude_degree3_in = values[5]; + __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_y1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_z1 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_z1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_x2 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_x2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_y2 = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_y2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_v_z2 = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_z2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L3_error) } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angle_between_vectors_coordinates", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6kernel_16calculate_distance_to_plane(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in); + __pyx_r = __pyx_pf_6kernel_10angle_between_vectors_coordinates(__pyx_self, __pyx_v_x1, __pyx_v_y1, __pyx_v_z1, __pyx_v_x2, __pyx_v_y2, __pyx_v_z2); /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6kernel_16calculate_distance_to_plane(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in) { +static PyObject *__pyx_pf_6kernel_10angle_between_vectors_coordinates(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x1, double __pyx_v_y1, double __pyx_v_z1, double __pyx_v_x2, double __pyx_v_y2, double __pyx_v_z2) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate_distance_to_plane", 0); + __Pyx_RefNannySetupContext("angle_between_vectors_coordinates", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6kernel_calculate_distance_to_plane(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6kernel_angle_between_vectors_coordinates(__pyx_v_x1, __pyx_v_y1, __pyx_v_z1, __pyx_v_x2, __pyx_v_y2, __pyx_v_z2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5380,7 +6595,7 @@ static PyObject *__pyx_pf_6kernel_16calculate_distance_to_plane(CYTHON_UNUSED Py /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("kernel.angle_between_vectors_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5388,1746 +6603,4660 @@ static PyObject *__pyx_pf_6kernel_16calculate_distance_to_plane(CYTHON_UNUSED Py return __pyx_r; } -/* "vector.to_py":60 - * - * @cname("__pyx_convert_vector_to_py_double") - * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<< - * return [v[i] for i in range(v.size())] +/* "kernel.pyx":256 * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< + * """Convert a point given latitude and longitude in radians to + * 3-dimensional space, assuming a sphere radius of one.""" */ -static PyObject *__pyx_convert_vector_to_py_double(const std::vector &__pyx_v_v) { - size_t __pyx_v_i; - PyObject *__pyx_r = NULL; +static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static __pyx_ctuple_double__and_double__and_double __pyx_f_6kernel_longlat_to_3d(PyObject *__pyx_v_dLongitude_degree_in, PyObject *__pyx_v_dLatitude_degree_in, CYTHON_UNUSED int __pyx_skip_dispatch) { + double __pyx_v_x; + double __pyx_v_y; + double __pyx_v_z; + PyObject *__pyx_v_dLongitude_radian = NULL; + PyObject *__pyx_v_dLatitude_radian = NULL; + __pyx_ctuple_double__and_double__and_double __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - size_t __pyx_t_2; - size_t __pyx_t_3; - size_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + double __pyx_t_5; + __pyx_ctuple_double__and_double__and_double __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0); + __Pyx_RefNannySetupContext("longlat_to_3d", 1); - /* "vector.to_py":61 - * @cname("__pyx_convert_vector_to_py_double") - * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): - * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + /* "kernel.pyx":264 + * cdef double dLongitude_degree, dLatitude_degree * + * dLongitude_radian = dLongitude_degree_in / 180.0 * pi # <<<<<<<<<<<<<< + * dLatitude_radian = dLatitude_degree_in / 180.0 * pi * */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_dLongitude_degree_in, __pyx_float_180_0, 180.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_v_v.size(); - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_r = __pyx_t_1; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6kernel_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dLongitude_radian = __pyx_t_3; + __pyx_t_3 = 0; + + /* "kernel.pyx":265 + * + * dLongitude_radian = dLongitude_degree_in / 180.0 * pi + * dLatitude_radian = dLatitude_degree_in / 180.0 * pi # <<<<<<<<<<<<<< + * + * x = cos(dLatitude_radian) * cos(dLongitude_radian) + */ + __pyx_t_3 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_dLatitude_degree_in, __pyx_float_180_0, 180.0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_6kernel_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dLatitude_radian = __pyx_t_1; __pyx_t_1 = 0; - goto __pyx_L0; - /* "vector.to_py":60 + /* "kernel.pyx":267 + * dLatitude_radian = dLatitude_degree_in / 180.0 * pi * - * @cname("__pyx_convert_vector_to_py_double") - * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<< - * return [v[i] for i in range(v.size())] + * x = cos(dLatitude_radian) * cos(dLongitude_radian) # <<<<<<<<<<<<<< + * y = cos(dLatitude_radian) * sin(dLongitude_radian) + * z = sin(dLatitude_radian) + */ + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_dLongitude_radian); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_v_x = (cos(__pyx_t_4) * cos(__pyx_t_5)); + + /* "kernel.pyx":268 + * + * x = cos(dLatitude_radian) * cos(dLongitude_radian) + * y = cos(dLatitude_radian) * sin(dLongitude_radian) # <<<<<<<<<<<<<< + * z = sin(dLatitude_radian) + * + */ + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLongitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_v_y = (cos(__pyx_t_5) * sin(__pyx_t_4)); + + /* "kernel.pyx":269 + * x = cos(dLatitude_radian) * cos(dLongitude_radian) + * y = cos(dLatitude_radian) * sin(dLongitude_radian) + * z = sin(dLatitude_radian) # <<<<<<<<<<<<<< + * + * return x, y, z + */ + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_dLatitude_radian); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_v_z = sin(__pyx_t_4); + + /* "kernel.pyx":271 + * z = sin(dLatitude_radian) + * + * return x, y, z # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_6.f0 = __pyx_v_x; + __pyx_t_6.f1 = __pyx_v_y; + __pyx_t_6.f2 = __pyx_v_z; + __pyx_r = __pyx_t_6; + goto __pyx_L0; + + /* "kernel.pyx":256 * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< + * """Convert a point given latitude and longitude in radians to + * 3-dimensional space, assuming a sphere radius of one.""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_v_dLongitude_radian); + __Pyx_XDECREF(__pyx_v_dLatitude_radian); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6kernel_12longlat_to_3d, "Convert a point given latitude and longitude in radians to\n 3-dimensional space, assuming a sphere radius of one."); +static PyMethodDef __pyx_mdef_6kernel_13longlat_to_3d = {"longlat_to_3d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_13longlat_to_3d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6kernel_12longlat_to_3d}; +static PyObject *__pyx_pw_6kernel_13longlat_to_3d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_dLongitude_degree_in = 0; + PyObject *__pyx_v_dLatitude_degree_in = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("longlat_to_3d (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree_in,&__pyx_n_s_dLatitude_degree_in,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("longlat_to_3d", 1, 2, 2, 1); __PYX_ERR(0, 256, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "longlat_to_3d") < 0)) __PYX_ERR(0, 256, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_dLongitude_degree_in = values[0]; + __pyx_v_dLatitude_degree_in = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("longlat_to_3d", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 256, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6kernel_12longlat_to_3d(__pyx_self, __pyx_v_dLongitude_degree_in, __pyx_v_dLatitude_degree_in); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_convert_vector_to_py_int(const std::vector &__pyx_v_v) { - size_t __pyx_v_i; +static PyObject *__pyx_pf_6kernel_12longlat_to_3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree_in, PyObject *__pyx_v_dLatitude_degree_in) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - size_t __pyx_t_2; - size_t __pyx_t_3; - size_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + __pyx_ctuple_double__and_double__and_double __pyx_t_1; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0); - - /* "vector.to_py":61 - * @cname("__pyx_convert_vector_to_py_int") - * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): - * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< - * - * - */ + __Pyx_RefNannySetupContext("longlat_to_3d", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_v_v.size(); - __pyx_t_3 = __pyx_t_2; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree_in, __pyx_v_dLatitude_degree_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_2 = __pyx_convert__to_py___pyx_ctuple_double__and_double__and_double(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "vector.to_py":60 - * - * @cname("__pyx_convert_vector_to_py_int") - * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<< - * return [v[i] for i in range(v.size())] - * - */ - /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("kernel.longlat_to_3d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "vector.from_py":45 +/* "kernel.pyx":275 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * #all in degree * - * @cname("__pyx_convert_vector_from_py_int") - * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< - * cdef vector[X] v - * for item in o: */ -static std::vector __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) { - std::vector __pyx_v_v; - PyObject *__pyx_v_item = NULL; - std::vector __pyx_r; +static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyObject *__pyx_f_6kernel_calculate_angle_betwen_vertex(PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in, CYTHON_UNUSED int __pyx_skip_dispatch) { + double __pyx_v_angle3deg; + double __pyx_v_x1; + double __pyx_v_y1; + double __pyx_v_z1; + double __pyx_v_x2; + double __pyx_v_y2; + double __pyx_v_z2; + double __pyx_v_x3; + double __pyx_v_y3; + double __pyx_v_z3; + double __pyx_v_x4; + double __pyx_v_y4; + double __pyx_v_z4; + double __pyx_v_x5; + double __pyx_v_y5; + double __pyx_v_z5; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + __pyx_ctuple_double__and_double__and_double __pyx_t_1; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_int", 0); + __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex", 1); - /* "vector.from_py":47 - * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: - * cdef vector[X] v - * for item in o: # <<<<<<<<<<<<<< - * v.push_back(item) - * return v + /* "kernel.pyx":286 + * + * # The points in 3D space + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) # <<<<<<<<<<<<<< + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) */ - if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { - __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(1, 47, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_4 = __pyx_t_1.f2; + __pyx_v_x1 = __pyx_t_2; + __pyx_v_y1 = __pyx_t_3; + __pyx_v_z1 = __pyx_t_4; - /* "vector.from_py":48 - * cdef vector[X] v - * for item in o: - * v.push_back(item) # <<<<<<<<<<<<<< - * return v + /* "kernel.pyx":287 + * # The points in 3D space + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) # <<<<<<<<<<<<<< + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) + * # Vectors in 3D space + */ + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_4 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_2 = __pyx_t_1.f2; + __pyx_v_x2 = __pyx_t_4; + __pyx_v_y2 = __pyx_t_3; + __pyx_v_z2 = __pyx_t_2; + + /* "kernel.pyx":288 + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) # <<<<<<<<<<<<<< + * # Vectors in 3D space * */ - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_item); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) - __pyx_v_v.push_back(((int)__pyx_t_5)); + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_4 = __pyx_t_1.f2; + __pyx_v_x3 = __pyx_t_2; + __pyx_v_y3 = __pyx_t_3; + __pyx_v_z3 = __pyx_t_4; - /* "vector.from_py":47 - * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: - * cdef vector[X] v - * for item in o: # <<<<<<<<<<<<<< - * v.push_back(item) - * return v + /* "kernel.pyx":291 + * # Vectors in 3D space + * + * x4 = x1 - x2 # <<<<<<<<<<<<<< + * y4 = y1 - y2 + * z4 = z1 - z2 */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_x4 = (__pyx_v_x1 - __pyx_v_x2); - /* "vector.from_py":49 - * for item in o: - * v.push_back(item) - * return v # <<<<<<<<<<<<<< + /* "kernel.pyx":292 + * + * x4 = x1 - x2 + * y4 = y1 - y2 # <<<<<<<<<<<<<< + * z4 = z1 - z2 + * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] + */ + __pyx_v_y4 = (__pyx_v_y1 - __pyx_v_y2); + + /* "kernel.pyx":293 + * x4 = x1 - x2 + * y4 = y1 - y2 + * z4 = z1 - z2 # <<<<<<<<<<<<<< + * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] + * x5 = x3 - x2 + */ + __pyx_v_z4 = (__pyx_v_z1 - __pyx_v_z2); + + /* "kernel.pyx":295 + * z4 = z1 - z2 + * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] + * x5 = x3 - x2 # <<<<<<<<<<<<<< + * y5 = y3 - y2 + * z5 = z3 - z2 + */ + __pyx_v_x5 = (__pyx_v_x3 - __pyx_v_x2); + + /* "kernel.pyx":296 + * #c3vec[i] = aCoordinate3[i] - aCoordinate2[i] + * x5 = x3 - x2 + * y5 = y3 - y2 # <<<<<<<<<<<<<< + * z5 = z3 - z2 + * + */ + __pyx_v_y5 = (__pyx_v_y3 - __pyx_v_y2); + + /* "kernel.pyx":297 + * x5 = x3 - x2 + * y5 = y3 - y2 + * z5 = z3 - z2 # <<<<<<<<<<<<<< * + * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) + */ + __pyx_v_z5 = (__pyx_v_z3 - __pyx_v_z2); + + /* "kernel.pyx":299 + * z5 = z3 - z2 + * + * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) # <<<<<<<<<<<<<< + * return angle3deg * */ - __pyx_r = __pyx_v_v; + __pyx_t_5 = __pyx_f_6kernel_angle_between_vectors_coordinates(__pyx_v_x4, __pyx_v_y4, __pyx_v_z4, __pyx_v_x5, __pyx_v_y5, __pyx_v_z5, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_angle3deg = __pyx_t_4; + + /* "kernel.pyx":300 + * + * angle3deg = angle_between_vectors_coordinates( x4, y4, z4, x5, y5, z5) + * return angle3deg # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) # deactivate bnds checking + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_angle3deg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "vector.from_py":45 + /* "kernel.pyx":275 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * #all in degree * - * @cname("__pyx_convert_vector_from_py_int") - * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< - * cdef vector[X] v - * for item in o: */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_pretend_to_initialize(&__pyx_r); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { - {"calculate_distance_based_on_longitude_latitude", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_1calculate_distance_based_on_longitude_latitude, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_calculate_distance_based_on_longitude_latitude}, - {"convert_360_to_180", (PyCFunction)__pyx_pw_6kernel_3convert_360_to_180, METH_O, __pyx_doc_6kernel_2convert_360_to_180}, - {"find_vertex_in_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_5find_vertex_in_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_4find_vertex_in_list}, - {"find_vertex_on_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_7find_vertex_on_edge, METH_VARARGS|METH_KEYWORDS, 0}, - {"add_unique_vertex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_9add_unique_vertex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_8add_unique_vertex}, - {"angle_between_vectors_coordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_11angle_between_vectors_coordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_10angle_between_vectors_coordinates}, - {"longlat_to_3d", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_13longlat_to_3d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6kernel_12longlat_to_3d}, - {"calculate_angle_betwen_vertex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_15calculate_angle_betwen_vertex, METH_VARARGS|METH_KEYWORDS, 0}, - {"calculate_distance_to_plane", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6kernel_17calculate_distance_to_plane, METH_VARARGS|METH_KEYWORDS, 0}, - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec_kernel(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec_kernel}, - {0, NULL} -}; -#endif - -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - "kernel", - 0, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #else - -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) +/* Python wrapper */ +static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else - #define CYTHON_SMALL_CODE +PyObject *__pyx_args, PyObject *__pyx_kwds #endif +); /*proto*/ +static PyMethodDef __pyx_mdef_6kernel_15calculate_angle_betwen_vertex = {"calculate_angle_betwen_vertex", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_15calculate_angle_betwen_vertex, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6kernel_15calculate_angle_betwen_vertex(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds #endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_RTree, __pyx_k_RTree, sizeof(__pyx_k_RTree), 0, 0, 1, 1}, - {&__pyx_n_s_aVertex_in, __pyx_k_aVertex_in, sizeof(__pyx_k_aVertex_in), 0, 0, 1, 1}, - {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, - {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, - {&__pyx_n_s_calculate_distance, __pyx_k_calculate_distance, sizeof(__pyx_k_calculate_distance), 0, 0, 1, 1}, - {&__pyx_n_s_check_vertex_on_edge, __pyx_k_check_vertex_on_edge, sizeof(__pyx_k_check_vertex_on_edge), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_dLatitude_degree, __pyx_k_dLatitude_degree, sizeof(__pyx_k_dLatitude_degree), 0, 0, 1, 1}, - {&__pyx_n_s_dLatitude_degree1_in, __pyx_k_dLatitude_degree1_in, sizeof(__pyx_k_dLatitude_degree1_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLatitude_degree2_in, __pyx_k_dLatitude_degree2_in, sizeof(__pyx_k_dLatitude_degree2_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLatitude_degree3_in, __pyx_k_dLatitude_degree3_in, sizeof(__pyx_k_dLatitude_degree3_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLatitude_degree_in, __pyx_k_dLatitude_degree_in, sizeof(__pyx_k_dLatitude_degree_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLongitude_degree, __pyx_k_dLongitude_degree, sizeof(__pyx_k_dLongitude_degree), 0, 0, 1, 1}, - {&__pyx_n_s_dLongitude_degree1_in, __pyx_k_dLongitude_degree1_in, sizeof(__pyx_k_dLongitude_degree1_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLongitude_degree2_in, __pyx_k_dLongitude_degree2_in, sizeof(__pyx_k_dLongitude_degree2_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLongitude_degree3_in, __pyx_k_dLongitude_degree3_in, sizeof(__pyx_k_dLongitude_degree3_in), 0, 0, 1, 1}, - {&__pyx_n_s_dLongitude_degree_in, __pyx_k_dLongitude_degree_in, sizeof(__pyx_k_dLongitude_degree_in), 0, 0, 1, 1}, - {&__pyx_n_s_dThreshold_in, __pyx_k_dThreshold_in, sizeof(__pyx_k_dThreshold_in), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, - {&__pyx_n_s_max_cap, __pyx_k_max_cap, sizeof(__pyx_k_max_cap), 0, 0, 1, 1}, - {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, - {&__pyx_n_s_min_cap, __pyx_k_min_cap, sizeof(__pyx_k_min_cap), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_pEdge_in, __pyx_k_pEdge_in, sizeof(__pyx_k_pEdge_in), 0, 0, 1, 1}, - {&__pyx_n_s_pVertex_end, __pyx_k_pVertex_end, sizeof(__pyx_k_pVertex_end), 0, 0, 1, 1}, - {&__pyx_n_s_pVertex_in, __pyx_k_pVertex_in, sizeof(__pyx_k_pVertex_in), 0, 0, 1, 1}, - {&__pyx_n_s_pVertex_start, __pyx_k_pVertex_start, sizeof(__pyx_k_pVertex_start), 0, 0, 1, 1}, - {&__pyx_n_s_pyflowline_external_tinyr_tinyr, __pyx_k_pyflowline_external_tinyr_tinyr, sizeof(__pyx_k_pyflowline_external_tinyr_tinyr), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, - {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, - {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, - {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, - {&__pyx_n_s_z1, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1}, - {&__pyx_n_s_z2, __pyx_k_z2, sizeof(__pyx_k_z2), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 81, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_float_180_0 = PyFloat_FromDouble(180.0); if (unlikely(!__pyx_float_180_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { +) { + PyObject *__pyx_v_dLongitude_degree1_in = 0; + PyObject *__pyx_v_dLatitude_degree1_in = 0; + PyObject *__pyx_v_dLongitude_degree2_in = 0; + PyObject *__pyx_v_dLatitude_degree2_in = 0; + PyObject *__pyx_v_dLongitude_degree3_in = 0; + PyObject *__pyx_v_dLatitude_degree3_in = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ + __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,&__pyx_n_s_dLongitude_degree3_in,&__pyx_n_s_dLatitude_degree3_in,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 1); __PYX_ERR(0, 275, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 2); __PYX_ERR(0, 275, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 3); __PYX_ERR(0, 275, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree3_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 4); __PYX_ERR(0, 275, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree3_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, 5); __PYX_ERR(0, 275, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate_angle_betwen_vertex") < 0)) __PYX_ERR(0, 275, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 6)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + } + __pyx_v_dLongitude_degree1_in = values[0]; + __pyx_v_dLatitude_degree1_in = values[1]; + __pyx_v_dLongitude_degree2_in = values[2]; + __pyx_v_dLatitude_degree2_in = values[3]; + __pyx_v_dLongitude_degree3_in = values[4]; + __pyx_v_dLatitude_degree3_in = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("calculate_angle_betwen_vertex", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 275, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return 0; -} + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6kernel_14calculate_angle_betwen_vertex(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in); -static int __Pyx_modinit_type_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); - return 0; + return __pyx_r; } -static int __Pyx_modinit_variable_import_code(void) { +static PyObject *__pyx_pf_6kernel_14calculate_angle_betwen_vertex(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("calculate_angle_betwen_vertex", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6kernel_calculate_angle_betwen_vertex(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; -static int __Pyx_modinit_function_import_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("kernel.calculate_angle_betwen_vertex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); - return 0; + return __pyx_r; } +/* "kernel.pyx":303 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * cdef double x1, y1, z1 + * cdef double x2, y2, z2 + */ -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif -#endif - - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initkernel(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initkernel(void) +static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else -__Pyx_PyMODINIT_FUNC PyInit_kernel(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit_kernel(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 - static PY_INT64_T main_interpreter_id = -1; - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { - result = PyDict_SetItemString(moddict, to_name, value); - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - if (__Pyx_check_single_interpreter()) - return NULL; - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec_kernel(PyObject *__pyx_pyinit_module) -#endif +PyObject *__pyx_args, PyObject *__pyx_kwds #endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; +); /*proto*/ +static PyObject *__pyx_f_6kernel_calculate_distance_to_plane(PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in, CYTHON_UNUSED int __pyx_skip_dispatch) { + double __pyx_v_x1; + double __pyx_v_y1; + double __pyx_v_z1; + double __pyx_v_x2; + double __pyx_v_y2; + double __pyx_v_z2; + double __pyx_v_x3; + double __pyx_v_y3; + double __pyx_v_z3; + double __pyx_v_distance; + PyObject *__pyx_v_b = 0; + PyObject *__pyx_v_c = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __pyx_ctuple_double__and_double__and_double __pyx_t_1; + double __pyx_t_2; + double __pyx_t_3; + double __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module 'kernel' has already been imported. Re-initialisation is not supported."); - return -1; - } - #elif PY_MAJOR_VERSION >= 3 - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_kernel(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); - #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("kernel", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_kernel) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "kernel")) { - if (unlikely(PyDict_SetItemString(modules, "kernel", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif + __Pyx_RefNannySetupContext("calculate_distance_to_plane", 1); - /* "kernel.pyx":1 - * import numpy as np # <<<<<<<<<<<<<< - * cimport cython - * from libcpp.vector cimport vector + /* "kernel.pyx":310 + * cdef b, c + * # The points in 3D space + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) # <<<<<<<<<<<<<< + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_4 = __pyx_t_1.f2; + __pyx_v_x1 = __pyx_t_2; + __pyx_v_y1 = __pyx_t_3; + __pyx_v_z1 = __pyx_t_4; - /* "kernel.pyx":5 - * from libcpp.vector cimport vector - * from libc.math cimport sin, cos, asin,acos, sqrt, abs - * from pyflowline.external.tinyr.tinyr.tinyr import RTree # <<<<<<<<<<<<<< - * - * """ Low-level function for pyflowline + /* "kernel.pyx":311 + * # The points in 3D space + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) # <<<<<<<<<<<<<< + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) + * #The formula is x+b*y+c*z=0 */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_RTree); - __Pyx_GIVEREF(__pyx_n_s_RTree); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_RTree); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyflowline_external_tinyr_tinyr, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RTree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RTree, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_4 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_2 = __pyx_t_1.f2; + __pyx_v_x2 = __pyx_t_4; + __pyx_v_y2 = __pyx_t_3; + __pyx_v_z2 = __pyx_t_2; - /* "kernel.pyx":13 - * #constant - * - * cdef double pi = 3.14159265358979323846264338327 # <<<<<<<<<<<<<< - * cdef double dRadius = 6378137.0 - * + /* "kernel.pyx":312 + * x1, y1, z1 = longlat_to_3d(dLongitude_degree1_in, dLatitude_degree1_in) + * x2, y2, z2 = longlat_to_3d(dLongitude_degree2_in, dLatitude_degree2_in) + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) # <<<<<<<<<<<<<< + * #The formula is x+b*y+c*z=0 + * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) */ - __pyx_v_6kernel_pi = 3.14159265358979323846264338327; + __pyx_t_1 = __pyx_f_6kernel_longlat_to_3d(__pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1.f0; + __pyx_t_3 = __pyx_t_1.f1; + __pyx_t_4 = __pyx_t_1.f2; + __pyx_v_x3 = __pyx_t_2; + __pyx_v_y3 = __pyx_t_3; + __pyx_v_z3 = __pyx_t_4; - /* "kernel.pyx":14 - * - * cdef double pi = 3.14159265358979323846264338327 - * cdef double dRadius = 6378137.0 # <<<<<<<<<<<<<< - * - * @cython.boundscheck(False) # deactivate bnds checking + /* "kernel.pyx":314 + * x3, y3, z3 = longlat_to_3d(dLongitude_degree3_in, dLatitude_degree3_in) + * #The formula is x+b*y+c*z=0 + * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) # <<<<<<<<<<<<<< + * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) + * distance = abs( x2 + b * y2 + c * z2 ) */ - __pyx_v_6kernel_dRadius = 6378137.0; + __pyx_t_4 = (((-__pyx_v_x1) * __pyx_v_y3) + (__pyx_v_x3 * __pyx_v_y1)); + __pyx_t_3 = ((__pyx_v_z1 * __pyx_v_y3) - (__pyx_v_z3 * __pyx_v_y1)); + if (unlikely(__pyx_t_3 == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 314, __pyx_L1_error) + } + __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_c = __pyx_t_5; + __pyx_t_5 = 0; - /* "kernel.pyx":1 - * import numpy as np # <<<<<<<<<<<<<< - * cimport cython - * from libcpp.vector cimport vector + /* "kernel.pyx":315 + * #The formula is x+b*y+c*z=0 + * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) + * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) # <<<<<<<<<<<<<< + * distance = abs( x2 + b * y2 + c * z2 ) + * return distance */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (((-__pyx_v_x1) * __pyx_v_z3) + (__pyx_v_x3 * __pyx_v_z1)); + __pyx_t_4 = ((__pyx_v_y1 * __pyx_v_z3) - (__pyx_v_y3 * __pyx_v_z1)); + if (unlikely(__pyx_t_4 == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 315, __pyx_L1_error) + } + __pyx_t_5 = PyFloat_FromDouble((__pyx_t_3 / __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_b = __pyx_t_5; + __pyx_t_5 = 0; - /* "vector.from_py":45 + /* "kernel.pyx":316 + * c = (-x1*y3 + x3* y1)/( z1*y3 - z3*y1 ) + * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) + * distance = abs( x2 + b * y2 + c * z2 ) # <<<<<<<<<<<<<< + * return distance * - * @cname("__pyx_convert_vector_from_py_int") - * cdef vector[X] __pyx_convert_vector_from_py_int(object o) except *: # <<<<<<<<<<<<<< - * cdef vector[X] v - * for item in o: */ + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_x2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_y2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Multiply(__pyx_v_b, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_z2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Multiply(__pyx_v_c, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_distance = __pyx_t_4; - /*--- Wrapped vars code ---*/ - + /* "kernel.pyx":317 + * b = (-x1*z3 + x3 * z1 ) / (y1 * z3 - y3*z1) + * distance = abs( x2 + b * y2 + c * z2 ) + * return distance # <<<<<<<<<<<<<< + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; + + /* "kernel.pyx":303 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * cdef double x1, y1, z1 + * cdef double x2, y2, z2 + */ + + /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init kernel", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_CLEAR(__pyx_m); - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init kernel"); - } + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; + __Pyx_XDECREF(__pyx_v_b); + __Pyx_XDECREF(__pyx_v_c); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_6kernel_17calculate_distance_to_plane = {"calculate_distance_to_plane", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6kernel_17calculate_distance_to_plane, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6kernel_17calculate_distance_to_plane(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_dLongitude_degree1_in = 0; + PyObject *__pyx_v_dLatitude_degree1_in = 0; + PyObject *__pyx_v_dLongitude_degree2_in = 0; + PyObject *__pyx_v_dLatitude_degree2_in = 0; + PyObject *__pyx_v_dLongitude_degree3_in = 0; + PyObject *__pyx_v_dLatitude_degree3_in = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("calculate_distance_to_plane (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - return; + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dLongitude_degree1_in,&__pyx_n_s_dLatitude_degree1_in,&__pyx_n_s_dLongitude_degree2_in,&__pyx_n_s_dLatitude_degree2_in,&__pyx_n_s_dLongitude_degree3_in,&__pyx_n_s_dLatitude_degree3_in,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree1_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 1); __PYX_ERR(0, 303, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 2); __PYX_ERR(0, 303, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree2_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 3); __PYX_ERR(0, 303, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLongitude_degree3_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 4); __PYX_ERR(0, 303, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dLatitude_degree3_in)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, 5); __PYX_ERR(0, 303, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate_distance_to_plane") < 0)) __PYX_ERR(0, 303, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 6)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + } + __pyx_v_dLongitude_degree1_in = values[0]; + __pyx_v_dLatitude_degree1_in = values[1]; + __pyx_v_dLongitude_degree2_in = values[2]; + __pyx_v_dLatitude_degree2_in = values[3]; + __pyx_v_dLongitude_degree3_in = values[4]; + __pyx_v_dLatitude_degree3_in = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("calculate_distance_to_plane", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 303, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6kernel_16calculate_distance_to_plane(__pyx_self, __pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; +static PyObject *__pyx_pf_6kernel_16calculate_distance_to_plane(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dLongitude_degree1_in, PyObject *__pyx_v_dLatitude_degree1_in, PyObject *__pyx_v_dLongitude_degree2_in, PyObject *__pyx_v_dLatitude_degree2_in, PyObject *__pyx_v_dLongitude_degree3_in, PyObject *__pyx_v_dLatitude_degree3_in) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("calculate_distance_to_plane", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6kernel_calculate_distance_to_plane(__pyx_v_dLongitude_degree1_in, __pyx_v_dLatitude_degree1_in, __pyx_v_dLongitude_degree2_in, __pyx_v_dLatitude_degree2_in, __pyx_v_dLongitude_degree3_in, __pyx_v_dLatitude_degree3_in, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("kernel.calculate_distance_to_plane", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_RTree, __pyx_k_RTree, sizeof(__pyx_k_RTree), 0, 0, 1, 1}, + {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, + {&__pyx_n_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 1}, + {&__pyx_n_s_aVertex_in, __pyx_k_aVertex_in, sizeof(__pyx_k_aVertex_in), 0, 0, 1, 1}, + {&__pyx_n_s_add_unique_vertex, __pyx_k_add_unique_vertex, sizeof(__pyx_k_add_unique_vertex), 0, 0, 1, 1}, + {&__pyx_n_s_angle_between_vectors_coordinate, __pyx_k_angle_between_vectors_coordinate, sizeof(__pyx_k_angle_between_vectors_coordinate), 0, 0, 1, 1}, + {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_calculate_angle_betwen_vertex, __pyx_k_calculate_angle_betwen_vertex, sizeof(__pyx_k_calculate_angle_betwen_vertex), 0, 0, 1, 1}, + {&__pyx_n_s_calculate_distance, __pyx_k_calculate_distance, sizeof(__pyx_k_calculate_distance), 0, 0, 1, 1}, + {&__pyx_n_s_calculate_distance_based_on_long, __pyx_k_calculate_distance_based_on_long, sizeof(__pyx_k_calculate_distance_based_on_long), 0, 0, 1, 1}, + {&__pyx_n_s_calculate_distance_to_plane, __pyx_k_calculate_distance_to_plane, sizeof(__pyx_k_calculate_distance_to_plane), 0, 0, 1, 1}, + {&__pyx_n_s_check_vertex_on_edge, __pyx_k_check_vertex_on_edge, sizeof(__pyx_k_check_vertex_on_edge), 0, 0, 1, 1}, + {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_convert_360_to_180, __pyx_k_convert_360_to_180, sizeof(__pyx_k_convert_360_to_180), 0, 0, 1, 1}, + {&__pyx_n_s_dLatitude_degree, __pyx_k_dLatitude_degree, sizeof(__pyx_k_dLatitude_degree), 0, 0, 1, 1}, + {&__pyx_n_s_dLatitude_degree1_in, __pyx_k_dLatitude_degree1_in, sizeof(__pyx_k_dLatitude_degree1_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLatitude_degree2_in, __pyx_k_dLatitude_degree2_in, sizeof(__pyx_k_dLatitude_degree2_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLatitude_degree3_in, __pyx_k_dLatitude_degree3_in, sizeof(__pyx_k_dLatitude_degree3_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLatitude_degree_in, __pyx_k_dLatitude_degree_in, sizeof(__pyx_k_dLatitude_degree_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_degree, __pyx_k_dLongitude_degree, sizeof(__pyx_k_dLongitude_degree), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_degree1_in, __pyx_k_dLongitude_degree1_in, sizeof(__pyx_k_dLongitude_degree1_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_degree2_in, __pyx_k_dLongitude_degree2_in, sizeof(__pyx_k_dLongitude_degree2_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_degree3_in, __pyx_k_dLongitude_degree3_in, sizeof(__pyx_k_dLongitude_degree3_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_degree_in, __pyx_k_dLongitude_degree_in, sizeof(__pyx_k_dLongitude_degree_in), 0, 0, 1, 1}, + {&__pyx_n_s_dLongitude_in, __pyx_k_dLongitude_in, sizeof(__pyx_k_dLongitude_in), 0, 0, 1, 1}, + {&__pyx_n_s_dThreshold_in, __pyx_k_dThreshold_in, sizeof(__pyx_k_dThreshold_in), 0, 0, 1, 1}, + {&__pyx_n_s_find_vertex_in_list, __pyx_k_find_vertex_in_list, sizeof(__pyx_k_find_vertex_in_list), 0, 0, 1, 1}, + {&__pyx_n_s_find_vertex_on_edge, __pyx_k_find_vertex_on_edge, sizeof(__pyx_k_find_vertex_on_edge), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_n_s_kernel, __pyx_k_kernel, sizeof(__pyx_k_kernel), 0, 0, 1, 1}, + {&__pyx_kp_s_kernel_pyx, __pyx_k_kernel_pyx, sizeof(__pyx_k_kernel_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_longlat_to_3d, __pyx_k_longlat_to_3d, sizeof(__pyx_k_longlat_to_3d), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_cap, __pyx_k_max_cap, sizeof(__pyx_k_max_cap), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_min_cap, __pyx_k_min_cap, sizeof(__pyx_k_min_cap), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_n_s_pEdge_in, __pyx_k_pEdge_in, sizeof(__pyx_k_pEdge_in), 0, 0, 1, 1}, + {&__pyx_n_s_pVertex_end, __pyx_k_pVertex_end, sizeof(__pyx_k_pVertex_end), 0, 0, 1, 1}, + {&__pyx_n_s_pVertex_in, __pyx_k_pVertex_in, sizeof(__pyx_k_pVertex_in), 0, 0, 1, 1}, + {&__pyx_n_s_pVertex_start, __pyx_k_pVertex_start, sizeof(__pyx_k_pVertex_start), 0, 0, 1, 1}, + {&__pyx_n_s_pyflowline_external_tinyr_tinyr, __pyx_k_pyflowline_external_tinyr_tinyr, sizeof(__pyx_k_pyflowline_external_tinyr_tinyr), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1}, + {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1}, + {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, + {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1}, + {&__pyx_n_s_z1, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1}, + {&__pyx_n_s_z2, __pyx_k_z2, sizeof(__pyx_k_z2), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 68, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "kernel.pyx":17 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< + * """ + * Calculate the great circle distance between two points + */ + __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_dLongitude_degree1_in, __pyx_n_s_dLatitude_degree1_in, __pyx_n_s_dLongitude_degree2_in, __pyx_n_s_dLatitude_degree2_in); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_calculate_distance_based_on_long, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 17, __pyx_L1_error) + + /* "kernel.pyx":44 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< + * """[This function is modified from + * http://www.idlcoyote.com/map_tips/lonconvert.html] + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_dLongitude_in); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_convert_360_to_180, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 44, __pyx_L1_error) + + /* "kernel.pyx":61 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[find the index of a vertex in a list] + * + */ + __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_aVertex_in, __pyx_n_s_pVertex_in, __pyx_n_s_dThreshold_in); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_find_vertex_in_list, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_float_1_0Eneg_6); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "kernel.pyx":132 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< + * # + * cdef int iFlag_exist = 0 + */ + __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_aVertex_in, __pyx_n_s_pEdge_in); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_find_vertex_on_edge, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 132, __pyx_L1_error) + + /* "kernel.pyx":209 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[add a vertex to a list if it is not already included] + * + */ + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_add_unique_vertex, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_float_1_0Eneg_6); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "kernel.pyx":238 + * @cython.boundscheck(False) # deactivate bnds checking + * #cdef angle_between_vectors_coordinates(double *u, double *v): + * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< + * """Return the angle between two vectors in any dimension space, + * in degrees. + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_z1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_z2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_angle_between_vectors_coordinate, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 238, __pyx_L1_error) + + /* "kernel.pyx":256 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< + * """Convert a point given latitude and longitude in radians to + * 3-dimensional space, assuming a sphere radius of one.""" + */ + __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_dLongitude_degree_in, __pyx_n_s_dLatitude_degree_in); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_longlat_to_3d, 256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 256, __pyx_L1_error) + + /* "kernel.pyx":275 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * #all in degree + * + */ + __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_s_dLongitude_degree1_in, __pyx_n_s_dLatitude_degree1_in, __pyx_n_s_dLongitude_degree2_in, __pyx_n_s_dLatitude_degree2_in, __pyx_n_s_dLongitude_degree3_in, __pyx_n_s_dLatitude_degree3_in); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_calculate_angle_betwen_vertex, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 275, __pyx_L1_error) + + /* "kernel.pyx":303 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * cdef double x1, y1, z1 + * cdef double x2, y2, z2 + */ + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kernel_pyx, __pyx_n_s_calculate_distance_to_plane, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_float_180_0 = PyFloat_FromDouble(180.0); if (unlikely(!__pyx_float_180_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_float_1_0Eneg_6 = PyFloat_FromDouble(1.0E-6); if (unlikely(!__pyx_float_1_0Eneg_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_kernel(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_kernel}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "kernel", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initkernel(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initkernel(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_kernel(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_kernel(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_kernel(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'kernel' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("kernel", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "kernel" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_kernel(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_kernel) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "kernel")) { + if (unlikely((PyDict_SetItemString(modules, "kernel", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + (void)__Pyx_modinit_type_init_code(); + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "kernel.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * cimport cython + * from libcpp.vector cimport vector + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "kernel.pyx":5 + * from libcpp.vector cimport vector + * from libc.math cimport sin, cos, asin,acos, sqrt, abs + * from pyflowline.external.tinyr.tinyr.tinyr import RTree # <<<<<<<<<<<<<< + * + * """ Low-level function for pyflowline + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_RTree); + __Pyx_GIVEREF(__pyx_n_s_RTree); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_RTree)) __PYX_ERR(0, 5, __pyx_L1_error); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pyflowline_external_tinyr_tinyr, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_RTree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RTree, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":13 + * #constant + * + * cdef double pi = 3.14159265358979323846264338327 # <<<<<<<<<<<<<< + * cdef double dRadius = 6378137.0 + * + */ + __pyx_v_6kernel_pi = 3.14159265358979323846264338327; + + /* "kernel.pyx":14 + * + * cdef double pi = 3.14159265358979323846264338327 + * cdef double dRadius = 6378137.0 # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) # deactivate bnds checking + */ + __pyx_v_6kernel_dRadius = 6378137.0; + + /* "kernel.pyx":17 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_based_on_longitude_latitude(double dLongitude_degree1_in, double dLatitude_degree1_in, double dLongitude_degree2_in, double dLatitude_degree2_in): # <<<<<<<<<<<<<< + * """ + * Calculate the great circle distance between two points + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_1calculate_distance_based_on_longitude_latitude, 0, __pyx_n_s_calculate_distance_based_on_long, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_distance_based_on_long, __pyx_t_3) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":44 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef convert_360_to_180(double dLongitude_in): # <<<<<<<<<<<<<< + * """[This function is modified from + * http://www.idlcoyote.com/map_tips/lonconvert.html] + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_3convert_360_to_180, 0, __pyx_n_s_convert_360_to_180, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_360_to_180, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":61 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef find_vertex_in_list(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[find the index of a vertex in a list] + * + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_5find_vertex_in_list, 0, __pyx_n_s_find_vertex_in_list, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_vertex_in_list, __pyx_t_3) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":132 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef find_vertex_on_edge(list aVertex_in, pEdge_in): # <<<<<<<<<<<<<< + * # + * cdef int iFlag_exist = 0 + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_7find_vertex_on_edge, 0, __pyx_n_s_find_vertex_on_edge, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_vertex_on_edge, __pyx_t_3) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":209 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef add_unique_vertex(list aVertex_in, pVertex_in, double dThreshold_in = 1.0E-6): # <<<<<<<<<<<<<< + * """[add a vertex to a list if it is not already included] + * + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_9add_unique_vertex, 0, __pyx_n_s_add_unique_vertex, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__13); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_unique_vertex, __pyx_t_3) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":238 + * @cython.boundscheck(False) # deactivate bnds checking + * #cdef angle_between_vectors_coordinates(double *u, double *v): + * cpdef angle_between_vectors_coordinates(double x1, double y1, double z1, double x2, double y2, double z2): # <<<<<<<<<<<<<< + * """Return the angle between two vectors in any dimension space, + * in degrees. + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_11angle_between_vectors_coordinates, 0, __pyx_n_s_angle_between_vectors_coordinate, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_angle_between_vectors_coordinate, __pyx_t_3) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":256 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef (double, double, double) longlat_to_3d(dLongitude_degree_in, dLatitude_degree_in): # <<<<<<<<<<<<<< + * """Convert a point given latitude and longitude in radians to + * 3-dimensional space, assuming a sphere radius of one.""" + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_13longlat_to_3d, 0, __pyx_n_s_longlat_to_3d, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_longlat_to_3d, __pyx_t_3) < 0) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":275 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_angle_betwen_vertex(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * #all in degree + * + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_15calculate_angle_betwen_vertex, 0, __pyx_n_s_calculate_angle_betwen_vertex, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_angle_betwen_vertex, __pyx_t_3) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":303 + * + * @cython.boundscheck(False) # deactivate bnds checking + * cpdef calculate_distance_to_plane(dLongitude_degree1_in, dLatitude_degree1_in, dLongitude_degree2_in, dLatitude_degree2_in, dLongitude_degree3_in, dLatitude_degree3_in): # <<<<<<<<<<<<<< + * cdef double x1, y1, z1 + * cdef double x2, y2, z2 + */ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6kernel_17calculate_distance_to_plane, 0, __pyx_n_s_calculate_distance_to_plane, NULL, __pyx_n_s_kernel, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_distance_to_plane, __pyx_t_3) < 0) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "kernel.pyx":1 + * import numpy as np # <<<<<<<<<<<<<< + * cimport cython + * from libcpp.vector cimport vector + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init kernel", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init kernel"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; } #endif -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; } #endif -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); return result; } - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); } - if (exact) { - more_or_less = "exactly"; + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); + vectorcallfunc f = PyVectorcall_Function(func); #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (!meth) { + PyErr_Clear(); } else { - goto invalid_keyword; + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; } } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); } -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; + return 0; } -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } + return __Pyx_IterFinish(); } -#endif -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; +/* PyIntCompare */ +static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 1; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + return (a == b); } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) == 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 0; + intval = -intval; + } else { + if (__Pyx_PyLong_IsNeg(op1)) + return 0; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else #endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal == 0); } - PyErr_Clear(); + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); #endif - return __Pyx_GetBuiltinName(name); + return ((double)a == (double)b); + } + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_EQ)); } -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); +/* PyFloatBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { + const double b = floatval; + double a, result; + CYTHON_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + if (likely(PyFloat_CheckExact(op1))) { +#if CYTHON_COMPILING_IN_LIMITED_API + a = __pyx_PyFloat_AsDouble(op1); +#else + a = PyFloat_AS_DOUBLE(op1); +#endif + + } else + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + a = (double) PyInt_AS_LONG(op1); + + } else + #endif + if (likely(PyLong_CheckExact(op1))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsZero(op1)) { + a = 0.0; + + } else if (__Pyx_PyLong_IsCompact(op1)) { + a = (double) __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + case 2: + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { + a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -2) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + case -3: + case 3: + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { + a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -3) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + case -4: + case 4: + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { + a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -4) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + default: + #endif + a = PyLong_AsDouble(op1); + if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; + #if CYTHON_USE_PYLONG_INTERNALS + } + } + #endif + } else { + return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); } - return result; + PyFPE_START_PROTECT("divide", return NULL) + result = a / b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); } #endif -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; +/* py_abs */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { +#if PY_VERSION_HEX >= 0x030C00A7 + if (likely(__Pyx_PyLong_IsCompact(n))) { + return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); + if (likely(Py_SIZE(n) == -1)) { + return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + { + PyObject *copy = _PyLong_Copy((PyLongObject*)n); + if (likely(copy)) { + #if PY_VERSION_HEX >= 0x030C00A7 + ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; + #else + __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); + #endif + } + return copy; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else - return PySequence_GetItem(o, i); + return PyNumber_Negative(n); #endif } -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; PyErr_Clear(); } } - return m->sq_item(o, i); + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif } } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; } -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; } -#if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; -#if PY_MAJOR_VERSION >= 3 - PyObject *kwdefs; #endif - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) return NULL; - } - if ( + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif #if PY_MAJOR_VERSION >= 3 - co->co_kwonlyargcount == 0 && +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); #endif - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s_; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; + if (likely(!spec)) { + PyErr_Clear(); + return module; } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); } - closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 - kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + if (unlikely(!module_name_str)) { goto modbad; } + module_name = PyUnicode_FromString(module_name_str); + if (unlikely(!module_name)) { goto modbad; } + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); + } + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); } - else { - d = NULL; - nd = 0; + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif } -#if PY_MAJOR_VERSION >= 3 - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); + return value; +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); #else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; #endif - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} + changed = 1; + } #endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } #endif - -/* PyCFunctionFastCall */ -#if CYTHON_FAST_PYCCALL -static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { - PyCFunctionObject *func = (PyCFunctionObject*)func_obj; - PyCFunction meth = PyCFunction_GET_FUNCTION(func); - PyObject *self = PyCFunction_GET_SELF(func); - int flags = PyCFunction_GET_FLAGS(func); - assert(PyCFunction_Check(func)); - assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); - assert(nargs >= 0); - assert(nargs == 0 || args != NULL); - /* _PyCFunction_FastCallDict() must not be called with an exception set, - because it may clear it (directly or indirectly) and so the - caller loses its exception */ - assert(!PyErr_Occurred()); - if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { - return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); - } else { - return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } + memb++; + } + if (changed) + PyType_Modified(type); } +#endif + return 0; } #endif -/* PyObjectCall2Args */ -static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args, *result = NULL; - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(function)) { - PyObject *args[2] = {arg1, arg2}; - return __Pyx_PyFunction_FastCall(function, args, 2); +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; } - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(function)) { - PyObject *args[2] = {arg1, arg2}; - return __Pyx_PyCFunction_FastCall(function, args, 2); + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; } - #endif - args = PyTuple_New(2); - if (unlikely(!args)) goto done; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - Py_INCREF(function); - result = __Pyx_PyObject_Call(function, args, NULL); - Py_DECREF(args); - Py_DECREF(function); + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; done: - return result; + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; } - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; } - return result; + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; } #endif -/* PyObjectCallOneArg */ -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; } -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCall(func, &arg, 1); +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} #endif - if (likely(PyCFunction_Check(func))) { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); -#if CYTHON_FAST_PYCCALL - } else if (__Pyx_PyFastCFunction_Check(func)) { - return __Pyx_PyCFunction_FastCall(func, &arg, 1); -#endif - } + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } - return __Pyx__PyObject_CallOneArg(func, arg); + return 0; } #else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif - -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { - PyObject *runerr; - Py_ssize_t key_value; - PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; - if (unlikely(!(m && m->sq_item))) { - PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); - return NULL; +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif } - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; } - return NULL; + Py_INCREF(op->func_name); + return op->func_name; } -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { - PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; - if (likely(m && m->mp_subscript)) { - return m->mp_subscript(obj, key); +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; } - return __Pyx_PyObject_GetIndex(obj, key); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; } +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) #endif - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; } - else { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; } - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } - -/* RaiseTooManyValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; } - -/* RaiseNeedMoreValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; } - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; } else { - return -1; + result = Py_None; } } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; } else { - return -1; + result = Py_None; } } - return 0; -#endif + Py_INCREF(result); + return result; } - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); return -1; - } else { - return __Pyx_IterFinish(); } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } - -/* PyIntCompare */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { - if (op1 == op2) { - Py_RETURN_TRUE; - } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = Py_SIZE(op1); - const digit* digits = ((PyLongObject*)op1)->ob_digit; - if (intval == 0) { - if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } else if (intval < 0) { - if (size >= 0) - Py_RETURN_FALSE; - intval = -intval; - size = -size; - } else { - if (size <= 0) - Py_RETURN_FALSE; + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else #endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } #endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else #endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = PyFloat_AS_DOUBLE(op1); - if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - return ( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - -/* PyFloatBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { - const double b = floatval; - double a, result; - (void)inplace; - (void)zerodivision_check; - if (likely(PyFloat_CheckExact(op1))) { - a = PyFloat_AS_DOUBLE(op1); - - } else - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - a = (double) PyInt_AS_LONG(op1); - - } else - #endif - if (likely(PyLong_CheckExact(op1))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)op1)->ob_digit; - const Py_ssize_t size = Py_SIZE(op1); - switch (size) { - case 0: a = 0.0; break; - case -1: a = -(double) digits[0]; break; - case 1: a = (double) digits[0]; break; - case -2: - case 2: - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { - a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -2) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - case -3: - case 3: - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { - a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -3) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - case -4: - case 4: - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { - a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -4) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - default: - #else - { - #endif - a = PyLong_AsDouble(op1); - if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; - - } - } else { - return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); - } - - PyFPE_START_PROTECT("divide", return NULL) - result = a / b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); -} #endif - -/* PyErrFetchRestore */ - #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif - -/* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, - int full_traceback, CYTHON_UNUSED int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); -#ifdef _MSC_VER - else state = (PyGILState_STATE)-1; #endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); #endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; } - -/* py_abs */ - #if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { - if (likely(Py_SIZE(n) == -1)) { - return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]); +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); } -#if CYTHON_COMPILING_IN_CPYTHON - { - PyObject *copy = _PyLong_Copy((PyLongObject*)n); - if (likely(copy)) { - __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; } - return copy; + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); #else - return PyNumber_Negative(n); + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); #endif + return NULL; } +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); #endif - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; } + ret = 1; } -bad: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; } - -/* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; } - return value; + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; } /* CLineInTraceback */ - #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } @@ -7141,7 +11270,7 @@ static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -7163,7 +11292,8 @@ static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int #endif /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; @@ -7241,17 +11371,101 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } +#endif /* AddTraceback */ - #include "compile.h" +#include "compile.h" #include "frameobject.h" #include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { @@ -7286,6 +11500,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( 0, 0, 0, + 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ @@ -7301,7 +11516,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -7348,9 +11563,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_code); Py_XDECREF(py_frame); } +#endif /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -7372,7 +11588,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* ToPyCTupleUtility */ - static PyObject* __pyx_convert__to_py___pyx_ctuple_double__and_double__and_double(__pyx_ctuple_double__and_double__and_double value) { +static PyObject* __pyx_convert__to_py___pyx_ctuple_double__and_double__and_double(__pyx_ctuple_double__and_double__and_double value) { PyObject* item = NULL; PyObject* result = PyTuple_New(3); if (!result) goto bad; @@ -7393,7 +11609,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7405,7 +11621,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { + if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); @@ -7419,40 +11635,45 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } } - } - break; + break; + } } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -7465,109 +11686,181 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, goto raise_neg_overflow; } #endif - if (sizeof(int) <= sizeof(unsigned long)) { + if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } } - } - break; + break; + } } #endif - if (sizeof(int) <= sizeof(long)) { + if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 +#if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } - #endif +#endif if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif Py_DECREF(v); if (likely(!ret)) return val; } -#endif return (int) -1; } } else { @@ -7589,7 +11882,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7621,209 +11914,55 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(size_t) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (size_t) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { - return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { - return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { - return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } #else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (size_t) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(size_t) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (size_t) 0; - case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) - case -2: - if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { - return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); - } - } - break; - } -#endif - if (sizeof(size_t) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - size_t val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; #endif - return (size_t) -1; - } - } else { - size_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (size_t) -1; - val = __Pyx_PyInt_As_size_t(tmp); - Py_DECREF(tmp); - return val; } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to size_t"); - return (size_t) -1; } +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__21); + } + return name; +} +#endif + /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7855,13 +11994,39 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif } } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7873,7 +12038,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { + if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); @@ -7887,40 +12052,45 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } } - } - break; + break; + } } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -7933,109 +12103,181 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, goto raise_neg_overflow; } #endif - if (sizeof(long) <= sizeof(unsigned long)) { + if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } } - } - break; + break; + } } #endif - if (sizeof(long) <= sizeof(long)) { + if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 +#if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } - #endif +#endif if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif Py_DECREF(v); if (likely(!ret)) return val; } -#endif return (long) -1; } } else { @@ -8057,10 +12299,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* FastTypeChecks */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { - a = a->tp_base; + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } @@ -8081,6 +12323,22 @@ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { } return __Pyx_InBases(a, b); } +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; @@ -8105,11 +12363,11 @@ static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; - if (!res) { - res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } - return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { @@ -8157,47 +12415,78 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #endif /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[5]; - int same=1, i, found_dot; - const char* rt_from_call = Py_GetVersion(); - PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - found_dot = 0; - for (i = 0; i < 4; i++) { - if (!ctversion[i]) { - same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); - break; +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; } - if (rt_from_call[i] != ctversion[i]) { - same = 0; + version += factor * digit; + if (rt_version[i] != '.') break; - } + digit = 0; + factor >>= 8; + ++i; } - if (!same) { - char rtversion[5] = {'\0'}; + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); return PyErr_WarnEx(NULL, message, 1); } - return 0; } /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { - #if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { @@ -8205,30 +12494,34 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; + #endif ++t; } return 0; } +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; @@ -8283,7 +12576,7 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); @@ -8312,22 +12605,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type %.200s). " - "The ability to return an instance of a strict subclass of int " - "is deprecated, and may be removed in a future version of Python.", - Py_TYPE(result)->tp_name)) { + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } + __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - type_name, type_name, Py_TYPE(result)->tp_name); + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } @@ -8393,13 +12690,11 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { @@ -8467,4 +12762,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { } +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ #endif /* Py_PYTHON_H */ diff --git a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py index 5e54b3a..87ac5e6 100644 --- a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py +++ b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py @@ -82,10 +82,7 @@ def intersect_flowline_with_flowline( sFilename_flowline_a_in, sFilename_flowlin #convert geometry to edge pGeometrytype_flowline_a = pGeometry_flowline_a.GetGeometryName() - if(pGeometrytype_flowline_a == 'LINESTRING'): - - - aFlowline_intersect = list() + if(pGeometrytype_flowline_a == 'LINESTRING'): iFlag_intersected = 0 for j in range (nfeature_flowline_b): #for pFeature_flowline in pLayer_flowline: diff --git a/pyflowline/algorithms/simplification/remove_returning_flowline.py b/pyflowline/algorithms/simplification/remove_returning_flowline.py index 9dcec18..94da824 100644 --- a/pyflowline/algorithms/simplification/remove_returning_flowline.py +++ b/pyflowline/algorithms/simplification/remove_returning_flowline.py @@ -28,8 +28,39 @@ def simplify_list(aCell_flowline_in): aCell_flowline_out = simplify_list(aCell_flowline_out) return aCell_flowline_out + + def simplify_list2(aCell_flowline_in): + aCell_flowline_out = copy.deepcopy(aCell_flowline_in) + nCell = len(aCell_flowline_out) + + # Check if list contains duplicates + iFlag_unique = check_if_duplicates(aCell_flowline_out) + if iFlag_unique == 1: + return aCell_flowline_out + + # Create a dictionary to store counts of elements + elem_counts = {} + for elem in aCell_flowline_out: + elem_counts[elem] = elem_counts.get(elem, 0) + 1 + + i = 0 + while i < nCell - 1: + elem = aCell_flowline_out[i] + if elem_counts[elem] > 1: + indices = [j for j, x in enumerate(aCell_flowline_out) if x == elem] + start = indices[0] + end = indices[-1] + del aCell_flowline_out[start + 1 : end] + nCell = len(aCell_flowline_out) + else: + i += 1 + + return aCell_flowline_out def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end_in): + lCellID =-1 + if iSegment_in == 608: + print('here') iFlag_found = 1 pVertex_end_current = pVertex_end_in aCell_flowline=list() @@ -39,10 +70,15 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end iFlag_skip = 0 iFlag_previous_overlap=0 while iFlag_found == 1: - iFlag_found = 0 + iFlag_found = 0 + #if lCellID == 110191: + # print('here') + # pass for j in range(nCell): pCell = aCell_intersect_in[j] lCellID = pCell.lCellID + #if lCellID == 110921: + # print('here') aFlowline= pCell.aFlowline nFlowline = len(aFlowline) for i in range(nFlowline): @@ -124,6 +160,10 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end if iFlag_found == 0: #reverse aCell_flowline = aCell_flowline[::-1] + #if 112378 in aCell_flowline: + # print(aCell_flowline) + # print('here') + # pass #simplify list aCell_simple = simplify_list(aCell_flowline) #save the output @@ -144,8 +184,8 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end aFlowline_out.append(pFlowline) sort_index = np.argsort(aStream_order) - sort_index = sort_index[::-1] - nUpstream = len(aSegment_upstream) + #sort_index = sort_index[::-1] #can we process low order first? + #nUpstream = len(aSegment_upstream) for i in sort_index: retrieve_flowline_intersect_index(aSegment_upstream[i], aStream_order[i], aVertex_end_upstream[i]) pass diff --git a/pyflowline/classes/_visual_basin.py b/pyflowline/classes/_visual_basin.py index 7576fee..7e33956 100644 --- a/pyflowline/classes/_visual_basin.py +++ b/pyflowline/classes/_visual_basin.py @@ -85,10 +85,12 @@ def basin_plot(self, aFilename_in = [sFilename_mesh, sFilename] map_multiple_vector_data(aFiletype_in, aFilename_in, + aFlag_thickness_in=[0, 1], + aVariable_in=['', 'drainage_area'], sFilename_output_in=sFilename_output_in, sTitle_in= 'Mesh with flowline', aFlag_color_in=[0, 0], - aFlag_fill_in = [0,0]) + aFlag_fill_in = [0, 0]) else: if sVariable_in == "flow_direction_with_observation": sFilename0 = self.sFilename_flow_direction #this can be either domain wide or subbasin level @@ -218,7 +220,7 @@ def _plot_polyline_variable(self, pass - map_vector_polyline_data(sFilename_json, + map_vector_polyline_data(1, sFilename_json, sFilename_output_in= sFilename_output_in, iFlag_thickness_in= iFlag_thickness , sTitle_in=sTitle, @@ -354,7 +356,7 @@ def _plot_polygon_variable(self, sTitle='' pass - map_vector_polygon_data(sFilename, + map_vector_polygon_data(1,sFilename, iFlag_color_in = 1, iFlag_colorbar_in = iFlag_colorbar_in, iFont_size_in = iFont_size_in, diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index ac6d2a0..4c49497 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -727,7 +727,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) if self.iFlag_debug ==1: sFilename_out = 'flowline_simplified_after_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) - export_flowline_to_geojson(aFlowline_basin_conceptual, sFilename_out) + export_flowline_to_geojson(aFlowline_basin_conceptual, sFilename_out) except: print('Error in remove_returning_flowline.') @@ -785,7 +785,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) except: print('Error in remove_flowline_loop.') - aFlowline_basin_conceptual = update_head_water_stream_order(aFlowline_basin_conceptual ) + try: + aFlowline_basin_conceptual = update_head_water_stream_order(aFlowline_basin_conceptual ) + except: + print('Error in update_head_water_stream_order.') try: print('Basin ', self.sBasinID, 'Start find flowline confluence') diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 0b20c1b..7b84cb0 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -313,7 +313,7 @@ def __init__(self, aConfig_in, if self.iFlag_mesh_boundary==1: if not os.path.isfile(self.sFilename_mesh_boundary ): print("The mesh boundary file does not exist, you should update this parameter before running the model!") - exit() + #exit() pass if 'sFilename_spatial_reference' in aConfig_in: @@ -422,7 +422,7 @@ def __init__(self, aConfig_in, exit() else: if not os.path.isfile(self.sFilename_dem ): #why DEM is required? - print("The DEM file does not exist!") + print("The DEM file does not exist in pyflowline!") #exit() self.aBasin = list() @@ -877,7 +877,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): return #no matter what type of mash, we will convert it to geoparquet for easy visualization - convert_geojson_to_geoparquet(sFilename_mesh, sFilename_mesh.replace('.geojson','.parquet')) + #convert_geojson_to_geoparquet(sFilename_mesh, sFilename_mesh.replace('.geojson','.parquet')) else: pass @@ -1151,7 +1151,7 @@ def pyflowline_export(self): """ Export the model outputs """ - print('Started export elevation') + print('PyFlowline started export results') ptimer = pytimer() ptimer.start() self.pyflowline_export_mesh_info_to_json() diff --git a/pyflowline/classes/vertex.py b/pyflowline/classes/vertex.py index fd28cc5..1d47c03 100644 --- a/pyflowline/classes/vertex.py +++ b/pyflowline/classes/vertex.py @@ -129,20 +129,23 @@ def __eq__(self, other): int: 1 if equivalent, 0 if not """ iFlag = False - #dThreshold_in = 1.0E-6 + dThreshold_in = 1.0E-10 if isinstance(other, pyvertex): - #c = self.calculate_distance(other) - #if( c <= dThreshold_in ): #be careful - # #print(self.dLongitude_degree ,self.dLatitude_degree , - # #other.dLongitude_degree, other.dLatitude_degree) - # iFlag = True - #else: - # iFlag = False + if (self.dLongitude_degree == other.dLongitude_degree) and \ (self.dLatitude_degree == other.dLatitude_degree): iFlag = True - else: - iFlag = False + else: + #use absolute difference to check whether two vertices are the same + if (abs(self.dLongitude_degree - other.dLongitude_degree) < dThreshold_in) and \ + (abs(self.dLatitude_degree - other.dLatitude_degree) < dThreshold_in): + #be careful + #print(self.dLongitude_degree ,self.dLatitude_degree , + #other.dLongitude_degree, other.dLatitude_degree) + iFlag = True + else: + iFlag = False + else: iFlag = False diff --git a/pyflowline/external/tinyr/build/temp.linux-x86_64-cpython-312/tinyr/tinyr.o b/pyflowline/external/tinyr/build/temp.linux-x86_64-cpython-312/tinyr/tinyr.o new file mode 100644 index 0000000000000000000000000000000000000000..ee695b5c143e24e297f8e383e062e5baa5020431 GIT binary patch literal 434232 zcmd?S34ByVwg;R*gl0rx6Ib55PDs;;e#59(4}Tx9+$E;_C#_hjA{6>Yw|oBvQPzp9INE84YagB2bW9&a5w zxOC!A@Oy9tes`PLhp$Wdx@_W)__`l{4+>d#wpvfM&K=)0{t&BgN?NfSPYv6RgG=qm zoQXZ~qr#3XxO~s?R`{e+tJlu>cVvat>(uaEQ=W~LZm@cFOqJbwmJm&msgzbDb%yz!8-D^wjbbF$Q?Y!FlO1d@q6WhI}tg@Bw z`izb{@7Ye~jOdv5HM#MR#`D}DKG=k_o;7;1l{Hr1diGn{iXjO+*M`68dm%jG4)Bz2 z7d-#d?b!kR9~8v@uC}`q2kQ2+9Xs4Gr#R8Y=_M2KP4h4xDE~%$==sYZ2B!NLwp;%U zy5rP$YhQ}F+6Qx0rEs%L-dsulGEY`t(8J&m>nyh$cYCnCy*;~&p_6*@4L?0?N1E7l zGArf%_Yc_aH0d(3ERnI(ixbo1&VOv@BimWszRbHCjj8sBx_bCwP%io#oBu5In0qDA z<>(3JClCm$poGRlHq)W}jgMH6OF56kjsg0hY`CWZ==5h=_ zWr507xgvxQ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azmhqat9{=5v|s^=FOhHaFO^)rDjb$)E;+t=8<3+{icpSSb9ZpO~{ z^^&q=!FoS!CkO21O*@~NY~wue9~krb>)81<`}~6*aby4cVPmQ5H@#c0-|J7mHiz4afSs9Q&U+xK2ifUnL{z~bx8yA>t`S{NWY^n1LU)TEo L #ifndef offsetof @@ -261,7 +261,7 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -588,17 +588,20 @@ END: Cython Metadata */ PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - PyObject *version_info; // borrowed + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -619,7 +622,6 @@ END: Cython Metadata */ Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -652,7 +654,7 @@ END: Cython Metadata */ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -763,6 +765,31 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); @@ -789,6 +816,8 @@ END: Cython Metadata */ #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 @@ -864,7 +893,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { } #endif #endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() @@ -876,7 +905,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); @@ -920,7 +949,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1064,6 +1093,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif +#if PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -1215,9 +1253,10 @@ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize @@ -1312,7 +1351,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1333,6 +1372,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -1383,6 +1423,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; @@ -1433,6 +1474,11 @@ static const char *__pyx_f[] = { "", }; /* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + /* #### Code section: numeric_typedefs ### */ /* "tinyr.pyx":42 @@ -1972,7 +2018,11 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -2015,8 +2065,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2027,9 +2077,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2196,7 +2251,11 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + L->ob_item[len] = x; + #else PyList_SET_ITEM(list, len, x); + #endif __Pyx_SET_SIZE(list, len + 1); return 0; } @@ -2331,7 +2390,7 @@ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObje /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; @@ -2395,7 +2454,11 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif /* CallNextTpTraverse.proto */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); @@ -2403,6 +2466,13 @@ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, trav /* CallNextTpClear.proto */ static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear); +/* SetPackagePathFromImportLib.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_PEP489_MULTI_PHASE_INIT +static int __Pyx_SetPackagePathFromImportLib(PyObject *module_name); +#else +#define __Pyx_SetPackagePathFromImportLib(a) 0 +#endif + /* IncludeStructmemberH.proto */ #include @@ -2567,7 +2637,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2575,9 +2645,13 @@ typedef struct { PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, @@ -2681,7 +2755,8 @@ typedef const char *__Pyx_TypeName; #endif /* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -3287,6 +3362,7 @@ typedef struct { PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tinyr; + PyObject *__pyx_n_u_tinyr; PyObject *__pyx_kp_s_tinyr_tinyr_pyx; PyObject *__pyx_n_s_tmp_coords; PyObject *__pyx_n_s_to_dot; @@ -3631,6 +3707,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tinyr); + Py_CLEAR(clear_module_state->__pyx_n_u_tinyr); Py_CLEAR(clear_module_state->__pyx_kp_s_tinyr_tinyr_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_tmp_coords); Py_CLEAR(clear_module_state->__pyx_n_s_to_dot); @@ -3953,6 +4030,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tinyr); + Py_VISIT(traverse_module_state->__pyx_n_u_tinyr); Py_VISIT(traverse_module_state->__pyx_kp_s_tinyr_tinyr_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_tmp_coords); Py_VISIT(traverse_module_state->__pyx_n_s_to_dot); @@ -4287,6 +4365,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tinyr __pyx_mstate_global->__pyx_n_s_tinyr +#define __pyx_n_u_tinyr __pyx_mstate_global->__pyx_n_u_tinyr #define __pyx_kp_s_tinyr_tinyr_pyx __pyx_mstate_global->__pyx_kp_s_tinyr_tinyr_pyx #define __pyx_n_s_tmp_coords __pyx_mstate_global->__pyx_n_s_tmp_coords #define __pyx_n_s_to_dot __pyx_mstate_global->__pyx_n_s_to_dot @@ -4391,7 +4470,7 @@ static CYTHON_INLINE PyObject *__Pyx_carray_to_py___pyx_t_5tinyr_Dfloat(__pyx_t_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5tinyr_Dfloat", 0); + __Pyx_RefNannySetupContext("__Pyx_carray_to_py___pyx_t_5tinyr_Dfloat", 1); /* "carray.to_py":117 * cdef size_t i @@ -4502,7 +4581,7 @@ static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple___pyx_t_5tinyr_Dfloat(__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5tinyr_Dfloat", 0); + __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple___pyx_t_5tinyr_Dfloat", 1); /* "carray.to_py":129 * cdef size_t i @@ -4617,7 +4696,7 @@ static int __Pyx_carray_from_py___pyx_t_5tinyr_Dfloat(PyObject *__pyx_v_o, __pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5tinyr_Dfloat", 0); + __Pyx_RefNannySetupContext("__Pyx_carray_from_py___pyx_t_5tinyr_Dfloat", 1); /* "carray.from_py":80 * @cname("__Pyx_carray_from_py___pyx_t_5tinyr_Dfloat") @@ -4722,7 +4801,8 @@ static int __Pyx_carray_from_py___pyx_t_5tinyr_Dfloat(PyObject *__pyx_v_o, __pyx */ __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { - __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error) @@ -4732,19 +4812,31 @@ static int __Pyx_carray_from_py___pyx_t_5tinyr_Dfloat(PyObject *__pyx_v_o, __pyx for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_7))) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 86, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 86, __pyx_L1_error) + #endif + if (__pyx_t_8 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error) #else - __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } @@ -4924,8 +5016,6 @@ static int __Pyx_carray_from_py___pyx_t_5tinyr_Dfloat(PyObject *__pyx_v_o, __pyx */ static CYTHON_INLINE void __pyx_f_5tinyr_init_Dfloat4(__pyx_t_5tinyr_Dfloat *__pyx_v_f) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("init_Dfloat4", 0); /* "tinyr.pyx":69 * cdef inline void init_Dfloat4(Dfloat *f): @@ -4972,7 +5062,6 @@ static CYTHON_INLINE void __pyx_f_5tinyr_init_Dfloat4(__pyx_t_5tinyr_Dfloat *__p */ /* function exit code */ - __Pyx_RefNannyFinishContext(); } /* "tinyr.pyx":74 @@ -4985,9 +5074,7 @@ static CYTHON_INLINE void __pyx_f_5tinyr_init_Dfloat4(__pyx_t_5tinyr_Dfloat *__p static CYTHON_INLINE void __pyx_f_5tinyr_make_order(__pyx_t_5tinyr_Dfloat *__pyx_v_coords) { __pyx_t_5tinyr_Dfloat __pyx_v_switch; - __Pyx_RefNannyDeclarations int __pyx_t_1; - __Pyx_RefNannySetupContext("make_order", 0); /* "tinyr.pyx":76 * cdef inline void make_order(Dfloat *coords): @@ -5090,7 +5177,6 @@ static CYTHON_INLINE void __pyx_f_5tinyr_make_order(__pyx_t_5tinyr_Dfloat *__pyx */ /* function exit code */ - __Pyx_RefNannyFinishContext(); } /* "tinyr.pyx":85 @@ -5110,7 +5196,7 @@ static void __pyx_f_5tinyr_tuple_to_array_interleaved(PyObject *__pyx_v_t, __pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("tuple_to_array_interleaved", 0); + __Pyx_RefNannySetupContext("tuple_to_array_interleaved", 1); /* "tinyr.pyx":86 * @@ -5177,7 +5263,7 @@ static void __pyx_f_5tinyr_tuple_to_array_normal(PyObject *__pyx_v_t, __pyx_t_5t int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("tuple_to_array_normal", 0); + __Pyx_RefNannySetupContext("tuple_to_array_normal", 1); /* "tinyr.pyx":91 * @@ -5275,7 +5361,7 @@ static PyObject *__pyx_f_5tinyr_array_to_tuple_interleaved(__pyx_t_5tinyr_Dfloat int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("array_to_tuple_interleaved", 0); + __Pyx_RefNannySetupContext("array_to_tuple_interleaved", 1); /* "tinyr.pyx":99 * @@ -5342,7 +5428,7 @@ static PyObject *__pyx_f_5tinyr_array_to_tuple_normal(__pyx_t_5tinyr_Dfloat *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("array_to_tuple_normal", 0); + __Pyx_RefNannySetupContext("array_to_tuple_normal", 1); /* "tinyr.pyx":102 * @@ -5423,7 +5509,7 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__InnerRecord *__pyx_f_5tinyr_parent int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("parent_record", 0); + __Pyx_RefNannySetupContext("parent_record", 1); /* "tinyr.pyx":108 * _InnerRecord e @@ -5436,13 +5522,20 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__InnerRecord *__pyx_f_5tinyr_parent PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 108, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_node->parent->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_v_node->parent->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 108, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 108, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5tinyr__InnerRecord))))) __PYX_ERR(0, 108, __pyx_L1_error) @@ -5540,7 +5633,7 @@ static CYTHON_INLINE void __pyx_f_5tinyr_common_boundaries(PyObject *__pyx_v_rec int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("common_boundaries", 0); + __Pyx_RefNannySetupContext("common_boundaries", 1); /* "tinyr.pyx":117 * _Record r @@ -5574,13 +5667,20 @@ static CYTHON_INLINE void __pyx_f_5tinyr_common_boundaries(PyObject *__pyx_v_rec PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 119, __pyx_L1_error) } - __pyx_t_2 = __pyx_v_records; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_v_records; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 119, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 119, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 119, __pyx_L1_error) @@ -5704,8 +5804,6 @@ static CYTHON_INLINE void __pyx_f_5tinyr_common_boundaries(PyObject *__pyx_v_rec static CYTHON_INLINE __pyx_t_5tinyr_Dfloat __pyx_f_5tinyr_area(__pyx_t_5tinyr_Dfloat *__pyx_v_coords) { __pyx_t_5tinyr_Dfloat __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area", 0); /* "tinyr.pyx":127 * @@ -5727,7 +5825,6 @@ static CYTHON_INLINE __pyx_t_5tinyr_Dfloat __pyx_f_5tinyr_area(__pyx_t_5tinyr_Df /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5741,10 +5838,8 @@ static CYTHON_INLINE __pyx_t_5tinyr_Dfloat __pyx_f_5tinyr_area(__pyx_t_5tinyr_Df static CYTHON_INLINE int __pyx_f_5tinyr_7_Record_overlaps(struct __pyx_obj_5tinyr__Record *__pyx_v_self, __pyx_t_5tinyr_Dfloat *__pyx_v_rect) { int __pyx_r; - __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; - __Pyx_RefNannySetupContext("overlaps", 0); /* "tinyr.pyx":134 * @@ -5787,7 +5882,6 @@ static CYTHON_INLINE int __pyx_f_5tinyr_7_Record_overlaps(struct __pyx_obj_5tiny /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5801,9 +5895,7 @@ static CYTHON_INLINE int __pyx_f_5tinyr_7_Record_overlaps(struct __pyx_obj_5tiny static CYTHON_INLINE void __pyx_f_5tinyr_7_Record_copy_coords_to(struct __pyx_obj_5tinyr__Record *__pyx_v_self, __pyx_t_5tinyr_Dfloat *__pyx_v_coords) { long __pyx_v_i; - __Pyx_RefNannyDeclarations long __pyx_t_1; - __Pyx_RefNannySetupContext("copy_coords_to", 0); /* "tinyr.pyx":137 * @@ -5834,7 +5926,6 @@ static CYTHON_INLINE void __pyx_f_5tinyr_7_Record_copy_coords_to(struct __pyx_ob */ /* function exit code */ - __Pyx_RefNannyFinishContext(); } /* "tinyr.pyx":140 @@ -5851,7 +5942,7 @@ static struct __pyx_obj_5tinyr__Record *__pyx_f_5tinyr_7_Record_copy(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 0); + __Pyx_RefNannySetupContext("copy", 1); /* "tinyr.pyx":141 * @@ -5906,9 +5997,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -5916,21 +6004,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._Record.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_7_Record___reduce_cython__(((struct __pyx_obj_5tinyr__Record *)__pyx_v_self)); /* function exit code */ @@ -5951,7 +6031,7 @@ static PyObject *__pyx_pf_5tinyr_7_Record___reduce_cython__(struct __pyx_obj_5ti int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict @@ -6190,8 +6270,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 16, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -6226,10 +6305,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -6261,7 +6341,7 @@ static PyObject *__pyx_pf_5tinyr_7_Record_2__setstate_cython__(struct __pyx_obj_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle__Record, (type(self), 0xd6fae5e, state) @@ -6317,8 +6397,7 @@ static int __pyx_pw_5tinyr_12_ChildRecord_1__init__(PyObject *__pyx_v_self, PyOb #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 147, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -6352,10 +6431,11 @@ static int __pyx_pw_5tinyr_12_ChildRecord_1__init__(PyObject *__pyx_v_self, PyOb } __pyx_v_identifier = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 147, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -6383,7 +6463,7 @@ static int __pyx_pw_5tinyr_12_ChildRecord_1__init__(PyObject *__pyx_v_self, PyOb static int __pyx_pf_5tinyr_12_ChildRecord___init__(struct __pyx_obj_5tinyr__ChildRecord *__pyx_v_self, PyObject *__pyx_v_identifier) { int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_RefNannySetupContext("__init__", 1); /* "tinyr.pyx":148 * @@ -6428,7 +6508,7 @@ static struct __pyx_obj_5tinyr__Record *__pyx_f_5tinyr_12_ChildRecord_copy(struc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 0); + __Pyx_RefNannySetupContext("copy", 1); /* "tinyr.pyx":154 * _ChildRecord ret @@ -6509,9 +6589,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -6519,21 +6596,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._ChildRecord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_12_ChildRecord_2__reduce_cython__(((struct __pyx_obj_5tinyr__ChildRecord *)__pyx_v_self)); /* function exit code */ @@ -6554,7 +6623,7 @@ static PyObject *__pyx_pf_5tinyr_12_ChildRecord_2__reduce_cython__(struct __pyx_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict @@ -6797,8 +6866,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 16, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -6833,10 +6901,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -6868,7 +6937,7 @@ static PyObject *__pyx_pf_5tinyr_12_ChildRecord_4__setstate_cython__(struct __py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle__ChildRecord, (type(self), 0x9d7f65c, state) @@ -6924,8 +6993,7 @@ static int __pyx_pw_5tinyr_12_InnerRecord_1__cinit__(PyObject *__pyx_v_self, PyO #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 162, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -6959,10 +7027,11 @@ static int __pyx_pw_5tinyr_12_InnerRecord_1__cinit__(PyObject *__pyx_v_self, PyO } __pyx_v_child = ((struct __pyx_obj_5tinyr__Node *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 162, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -6995,7 +7064,7 @@ static int __pyx_pw_5tinyr_12_InnerRecord_1__cinit__(PyObject *__pyx_v_self, PyO static int __pyx_pf_5tinyr_12_InnerRecord___cinit__(struct __pyx_obj_5tinyr__InnerRecord *__pyx_v_self, struct __pyx_obj_5tinyr__Node *__pyx_v_child) { int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":163 * @@ -7041,7 +7110,7 @@ static struct __pyx_obj_5tinyr__Record *__pyx_f_5tinyr_12_InnerRecord_copy(struc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 0); + __Pyx_RefNannySetupContext("copy", 1); /* "tinyr.pyx":169 * _InnerRecord ret @@ -7126,9 +7195,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -7136,21 +7202,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._InnerRecord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_12_InnerRecord_2__reduce_cython__(((struct __pyx_obj_5tinyr__InnerRecord *)__pyx_v_self)); /* function exit code */ @@ -7164,7 +7222,7 @@ static PyObject *__pyx_pf_5tinyr_12_InnerRecord_2__reduce_cython__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -7229,8 +7287,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -7265,10 +7322,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -7299,7 +7357,7 @@ static PyObject *__pyx_pf_5tinyr_12_InnerRecord_4__setstate_cython__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -7349,8 +7407,7 @@ static int __pyx_pw_5tinyr_5_Node_1__cinit__(PyObject *__pyx_v_self, PyObject *_ #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 179, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -7384,10 +7441,11 @@ static int __pyx_pw_5tinyr_5_Node_1__cinit__(PyObject *__pyx_v_self, PyObject *_ } __pyx_v_parent = ((struct __pyx_obj_5tinyr__Node *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 179, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -7424,7 +7482,7 @@ static int __pyx_pf_5tinyr_5_Node___cinit__(struct __pyx_obj_5tinyr__Node *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":180 * @@ -7495,7 +7553,7 @@ static struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5_Node_copy(struct __pyx_ob int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 0); + __Pyx_RefNannySetupContext("copy", 1); /* "tinyr.pyx":186 * cdef: @@ -7523,13 +7581,20 @@ static struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5_Node_copy(struct __pyx_ob PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 187, __pyx_L5_error) } - __pyx_t_2 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L5_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 187, __pyx_L5_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L5_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_rec, __pyx_t_4); @@ -7612,7 +7677,7 @@ static CYTHON_INLINE void __pyx_f_5tinyr_5_Node_common_boundaries(struct __pyx_o int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("common_boundaries", 0); + __Pyx_RefNannySetupContext("common_boundaries", 1); /* "tinyr.pyx":192 * @@ -7671,7 +7736,7 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Record *__pyx_f_5tinyr_5_Node_choo int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("choose_subtree_least_enlargement", 0); + __Pyx_RefNannySetupContext("choose_subtree_least_enlargement", 1); /* "tinyr.pyx":201 * list records @@ -7721,13 +7786,20 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Record *__pyx_f_5tinyr_5_Node_choo PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 207, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 207, __pyx_L1_error) @@ -7934,7 +8006,7 @@ static void __pyx_f_5tinyr_5_Node_find_overlapping_leafs_recursive(struct __pyx_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_overlapping_leafs_recursive", 0); + __Pyx_RefNannySetupContext("find_overlapping_leafs_recursive", 1); /* "tinyr.pyx":229 * _InnerRecord record @@ -7980,13 +8052,20 @@ static void __pyx_f_5tinyr_5_Node_find_overlapping_leafs_recursive(struct __pyx_ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 232, __pyx_L1_error) } - __pyx_t_2 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_v_self->records; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__InnerRecord))))) __PYX_ERR(0, 232, __pyx_L1_error) @@ -8068,7 +8147,7 @@ static void __pyx_f_5tinyr_5_Node_addChild(struct __pyx_obj_5tinyr__Node *__pyx_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("addChild", 0); + __Pyx_RefNannySetupContext("addChild", 1); /* "tinyr.pyx":240 * _InnerRecord ir @@ -8161,9 +8240,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -8171,21 +8247,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._Node.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5_Node_2__reduce_cython__(((struct __pyx_obj_5tinyr__Node *)__pyx_v_self)); /* function exit code */ @@ -8199,7 +8267,7 @@ static PyObject *__pyx_pf_5tinyr_5_Node_2__reduce_cython__(CYTHON_UNUSED struct int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -8264,8 +8332,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -8300,10 +8367,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -8334,7 +8402,7 @@ static PyObject *__pyx_pf_5tinyr_5_Node_4__setstate_cython__(CYTHON_UNUSED struc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -8380,7 +8448,7 @@ static PyObject *__pyx_f_5tinyr_find_overlapping_leafs_recursive(struct __pyx_ob int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_overlapping_leafs_recursive", 0); + __Pyx_RefNannySetupContext("find_overlapping_leafs_recursive", 1); /* "tinyr.pyx":251 * @@ -8393,13 +8461,20 @@ static PyObject *__pyx_f_5tinyr_find_overlapping_leafs_recursive(struct __pyx_ob PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 251, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_rtree->root->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_v_rtree->root->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 251, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 251, __pyx_L1_error) @@ -8557,7 +8632,7 @@ static int __pyx_f_5tinyr_PickSeedsQuadratic(struct __pyx_obj_5tinyr__Node *__py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PickSeedsQuadratic", 0); + __Pyx_RefNannySetupContext("PickSeedsQuadratic", 1); /* "tinyr.pyx":293 * list combi @@ -8630,7 +8705,8 @@ static int __pyx_f_5tinyr_PickSeedsQuadratic(struct __pyx_obj_5tinyr__Node *__py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) @@ -8641,19 +8717,31 @@ static int __pyx_f_5tinyr_PickSeedsQuadratic(struct __pyx_obj_5tinyr__Node *__py for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -8970,7 +9058,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_7min_cap___get__(struct __pyx_obj_5tinyr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":351 * property min_cap: @@ -9035,7 +9123,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_7max_cap___get__(struct __pyx_obj_5tinyr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":355 * property max_cap: @@ -9083,29 +9171,18 @@ static int __pyx_pw_5tinyr_5RTree_1__cinit__(PyObject *__pyx_v_self, PyObject *_ static int __pyx_pw_5tinyr_5RTree_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 357, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree___cinit__(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -9120,7 +9197,7 @@ static int __pyx_pf_5tinyr_5RTree___cinit__(struct __pyx_obj_5tinyr_RTree *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":358 * @@ -9210,8 +9287,7 @@ static int __pyx_pw_5tinyr_5RTree_3__init__(PyObject *__pyx_v_self, PyObject *__ #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 363, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -9274,10 +9350,11 @@ static int __pyx_pw_5tinyr_5RTree_3__init__(PyObject *__pyx_v_self, PyObject *__ __pyx_v_max_cap = values[1]; __pyx_v_min_cap = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 363, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -9312,7 +9389,7 @@ static int __pyx_pf_5tinyr_5RTree_2__init__(struct __pyx_obj_5tinyr_RTree *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_RefNannySetupContext("__init__", 1); /* "tinyr.pyx":364 * @@ -9494,8 +9571,6 @@ static Py_ssize_t __pyx_pw_5tinyr_5RTree_5__len__(PyObject *__pyx_v_self) { static Py_ssize_t __pyx_pf_5tinyr_5RTree_4__len__(struct __pyx_obj_5tinyr_RTree *__pyx_v_self) { Py_ssize_t __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__len__", 0); /* "tinyr.pyx":383 * @@ -9517,7 +9592,6 @@ static Py_ssize_t __pyx_pf_5tinyr_5RTree_4__len__(struct __pyx_obj_5tinyr_RTree /* function exit code */ __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9557,7 +9631,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_6__getitem__(struct __pyx_obj_5tinyr_RTr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 0); + __Pyx_RefNannySetupContext("__getitem__", 1); /* "tinyr.pyx":386 * @@ -9760,9 +9834,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iterkeys (wrapper)", 0); @@ -9770,21 +9841,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 393, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("iterkeys", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "iterkeys", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.iterkeys", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_8iterkeys(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -9799,7 +9862,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_8iterkeys(struct __pyx_obj_5tinyr_RTree int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("iterkeys", 0); + __Pyx_RefNannySetupContext("iterkeys", 1); /* "tinyr.pyx":394 * @@ -9862,9 +9925,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("itervalues (wrapper)", 0); @@ -9872,21 +9932,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 396, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("itervalues", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "itervalues", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.itervalues", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_10itervalues(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -9901,7 +9953,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_10itervalues(struct __pyx_obj_5tinyr_RTr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("itervalues", 0); + __Pyx_RefNannySetupContext("itervalues", 1); /* "tinyr.pyx":397 * @@ -9964,9 +10016,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iteritems (wrapper)", 0); @@ -9974,21 +10023,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("iteritems", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "iteritems", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_12iteritems(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -10003,7 +10044,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_12iteritems(struct __pyx_obj_5tinyr_RTre int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("iteritems", 0); + __Pyx_RefNannySetupContext("iteritems", 1); /* "tinyr.pyx":400 * @@ -10066,9 +10107,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_info (wrapper)", 0); @@ -10076,21 +10114,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 402, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_info", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_info", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.get_info", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_14get_info(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -10105,7 +10135,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_14get_info(struct __pyx_obj_5tinyr_RTree int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_info", 0); + __Pyx_RefNannySetupContext("get_info", 1); /* "tinyr.pyx":403 * @@ -10182,8 +10212,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 405, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -10232,10 +10261,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_key = values[0]; __pyx_v_coords = values[1]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 405, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -10274,7 +10304,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_16insert(struct __pyx_obj_5tinyr_RTree * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("insert", 0); + __Pyx_RefNannySetupContext("insert", 1); /* "tinyr.pyx":416 * _Node L @@ -10479,8 +10509,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 431, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -10515,10 +10544,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_coords = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("search", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 431, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -10562,7 +10592,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_18search(struct __pyx_obj_5tinyr_RTree * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("search", 0); + __Pyx_RefNannySetupContext("search", 1); /* "tinyr.pyx":443 * list leafnodes, result @@ -10695,13 +10725,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_18search(struct __pyx_obj_5tinyr_RTree * PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 454, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_leafnodes; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_v_leafnodes; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Node))))) __PYX_ERR(0, 454, __pyx_L1_error) @@ -10737,13 +10774,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_18search(struct __pyx_obj_5tinyr_RTree * PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 456, __pyx_L1_error) } - __pyx_t_4 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_4 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = 0; for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 456, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 456, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5tinyr__ChildRecord))))) __PYX_ERR(0, 456, __pyx_L1_error) @@ -10866,9 +10910,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); @@ -10876,21 +10917,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 462, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_20copy(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -10908,7 +10941,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_20copy(struct __pyx_obj_5tinyr_RTree *__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 0); + __Pyx_RefNannySetupContext("copy", 1); /* "tinyr.pyx":466 * RTree ret @@ -11042,8 +11075,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 472, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -11078,10 +11110,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_point = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("search_surrounding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 472, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -11275,13 +11308,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_22search_surrounding(struct __pyx_obj_5t PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 497, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_leafnodes; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_v_leafnodes; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 497, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 497, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Node))))) __PYX_ERR(0, 497, __pyx_L1_error) @@ -11317,13 +11357,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_22search_surrounding(struct __pyx_obj_5t PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 499, __pyx_L1_error) } - __pyx_t_4 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_4 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = 0; for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + #endif + if (__pyx_t_6 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5tinyr__ChildRecord))))) __PYX_ERR(0, 499, __pyx_L1_error) @@ -11676,8 +11723,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 524, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -11726,10 +11772,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_identifier = values[0]; __pyx_v_coords = values[1]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 524, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -11767,7 +11814,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_24remove(struct __pyx_obj_5tinyr_RTree * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("remove", 0); + __Pyx_RefNannySetupContext("remove", 1); /* "tinyr.pyx":534 * Dfloat coords_a[4] @@ -11969,7 +12016,7 @@ static CYTHON_INLINE void __pyx_f_5tinyr_5RTree_after_remove(struct __pyx_obj_5t int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("after_remove", 0); + __Pyx_RefNannySetupContext("after_remove", 1); /* "tinyr.pyx":551 * @@ -12091,7 +12138,7 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_FindLe int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FindLeaf_and_remove", 0); + __Pyx_RefNannySetupContext("FindLeaf_and_remove", 1); /* "tinyr.pyx":566 * _ChildRecord rec @@ -12116,13 +12163,20 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_FindLe PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 567, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_leafs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_1 = __pyx_v_leafs; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5tinyr__Node))))) __PYX_ERR(0, 567, __pyx_L1_error) @@ -12158,13 +12212,20 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_FindLe PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 569, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_3 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; for (;;) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5tinyr__ChildRecord))))) __PYX_ERR(0, 569, __pyx_L1_error) @@ -12580,13 +12641,20 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_CondenseTree(struct __pyx_obj_5ti * node = self.find_inner_node(ir) * ir.child.parent = node */ - __pyx_t_1 = __pyx_v_removed_innerrecords; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_v_removed_innerrecords; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 609, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 609, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__InnerRecord))))) __PYX_ERR(0, 609, __pyx_L1_error) @@ -12660,13 +12728,20 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_CondenseTree(struct __pyx_obj_5ti PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 615, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_removed_childrecords; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_v_removed_childrecords; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 615, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 615, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__ChildRecord))))) __PYX_ERR(0, 615, __pyx_L1_error) @@ -12772,7 +12847,7 @@ static struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_find_inner_node(stru int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("find_inner_node", 0); + __Pyx_RefNannySetupContext("find_inner_node", 1); /* "tinyr.pyx":627 * Duint subtree_len, level_reverse @@ -12904,7 +12979,7 @@ static __pyx_t_5tinyr_Duint __pyx_f_5tinyr_5RTree_subtree_len(CYTHON_UNUSED stru int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("subtree_len", 0); + __Pyx_RefNannySetupContext("subtree_len", 1); /* "tinyr.pyx":645 * Duint slen @@ -13032,7 +13107,7 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_is_full(struct __pyx_obj_5tinyr_R int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_full", 0); + __Pyx_RefNannySetupContext("is_full", 1); /* "tinyr.pyx":657 * @@ -13087,7 +13162,7 @@ static CYTHON_INLINE struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree__Choos int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_ChooseLeaf", 0); + __Pyx_RefNannySetupContext("_ChooseLeaf", 1); /* "tinyr.pyx":664 * _InnerRecord F @@ -13219,7 +13294,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5tinyr_5RTree__AdjustTree(struct __pyx_ob int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_AdjustTree", 0); + __Pyx_RefNannySetupContext("_AdjustTree", 1); /* "tinyr.pyx":677 * _Record EN, e @@ -13488,7 +13563,7 @@ static struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_SplitNode(struct __p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("SplitNode", 0); + __Pyx_RefNannySetupContext("SplitNode", 1); /* "tinyr.pyx":710 * _InnerRecord r @@ -13734,13 +13809,20 @@ static struct __pyx_obj_5tinyr__Node *__pyx_f_5tinyr_5RTree_SplitNode(struct __p PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 734, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_newnode->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_v_newnode->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = 0; for (;;) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 734, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 734, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5tinyr__InnerRecord))))) __PYX_ERR(0, 734, __pyx_L1_error) @@ -13840,7 +13922,7 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_PickNext(CYTHON_UNUSED struct __p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("PickNext", 0); + __Pyx_RefNannySetupContext("PickNext", 1); /* "tinyr.pyx":747 * _Record E_next, E, r @@ -13941,13 +14023,20 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_PickNext(CYTHON_UNUSED struct __p PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 756, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = 0; for (;;) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 756, __pyx_L1_error) + #endif + if (__pyx_t_1 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 756, __pyx_L1_error) @@ -13985,13 +14074,20 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_PickNext(CYTHON_UNUSED struct __p PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 759, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_newnode->records; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_v_newnode->records; __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = 0; for (;;) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 759, __pyx_L1_error) + #endif + if (__pyx_t_1 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 759, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 759, __pyx_L1_error) @@ -14064,13 +14160,20 @@ static CYTHON_INLINE int __pyx_f_5tinyr_5RTree_PickNext(CYTHON_UNUSED struct __p PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 767, __pyx_L1_error) } - __pyx_t_3 = __pyx_v_remaining; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_v_remaining; __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = 0; for (;;) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 767, __pyx_L1_error) + #endif + if (__pyx_t_1 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 767, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5tinyr__Record))))) __PYX_ERR(0, 767, __pyx_L1_error) @@ -14468,9 +14571,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("valid (wrapper)", 0); @@ -14478,21 +14578,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 806, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("valid", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "valid", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.valid", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_26valid(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -14535,7 +14627,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("valid", 0); + __Pyx_RefNannySetupContext("valid", 1); /* "tinyr.pyx":813 * Duint depth, item_count @@ -14578,7 +14670,8 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5tinyr__NodeIter), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) @@ -14589,19 +14682,31 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 817, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -14690,13 +14795,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 819, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 819, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_rec, __pyx_t_6); @@ -15122,13 +15234,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 847, __pyx_L1_error) } - __pyx_t_5 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_5 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_5); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 847, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_rec, __pyx_t_1); @@ -15306,13 +15425,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 858, __pyx_L1_error) } - __pyx_t_5 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_5 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_5); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_ir, __pyx_t_1); @@ -15496,13 +15622,20 @@ static PyObject *__pyx_pf_5tinyr_5RTree_26valid(struct __pyx_obj_5tinyr_RTree *_ * if d != nodedepht: * raise RTreeInvalid('leaf level is not equal for all leafs') */ - __pyx_t_2 = __pyx_v_leafnodes_and_depth; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_v_leafnodes_and_depth; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; for (;;) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 869, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { @@ -15762,9 +15895,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -15772,21 +15902,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_5RTree_28__reduce_cython__(((struct __pyx_obj_5tinyr_RTree *)__pyx_v_self)); /* function exit code */ @@ -15800,7 +15922,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_28__reduce_cython__(CYTHON_UNUSED struct int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -15865,8 +15987,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -15901,10 +16022,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -15935,7 +16057,7 @@ static PyObject *__pyx_pf_5tinyr_5RTree_30__setstate_cython__(CYTHON_UNUSED stru int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -15985,8 +16107,7 @@ static int __pyx_pw_5tinyr_9_Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 886, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -16020,10 +16141,11 @@ static int __pyx_pw_5tinyr_9_Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 886, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -16056,7 +16178,7 @@ static int __pyx_pw_5tinyr_9_Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec static int __pyx_pf_5tinyr_9_Iterator___cinit__(struct __pyx_obj_5tinyr__Iterator *__pyx_v_self, struct __pyx_obj_5tinyr_RTree *__pyx_v_rtree) { int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":887 * @@ -16111,7 +16233,7 @@ static PyObject *__pyx_pw_5tinyr_9_Iterator_3__iter__(PyObject *__pyx_v_self) { static PyObject *__pyx_pf_5tinyr_9_Iterator_2__iter__(struct __pyx_obj_5tinyr__Iterator *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__", 0); + __Pyx_RefNannySetupContext("__iter__", 1); /* "tinyr.pyx":890 * @@ -16166,9 +16288,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -16176,21 +16295,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._Iterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_9_Iterator_4__reduce_cython__(((struct __pyx_obj_5tinyr__Iterator *)__pyx_v_self)); /* function exit code */ @@ -16204,7 +16315,7 @@ static PyObject *__pyx_pf_5tinyr_9_Iterator_4__reduce_cython__(CYTHON_UNUSED str int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -16269,8 +16380,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -16305,10 +16415,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -16339,7 +16450,7 @@ static PyObject *__pyx_pf_5tinyr_9_Iterator_6__setstate_cython__(CYTHON_UNUSED s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -16389,8 +16500,7 @@ static int __pyx_pw_5tinyr_9_NodeIter_1__cinit__(PyObject *__pyx_v_self, PyObjec #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 896, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -16424,10 +16534,11 @@ static int __pyx_pw_5tinyr_9_NodeIter_1__cinit__(PyObject *__pyx_v_self, PyObjec } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 896, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -16466,7 +16577,7 @@ static int __pyx_pf_5tinyr_9_NodeIter___cinit__(struct __pyx_obj_5tinyr__NodeIte int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":897 * @@ -16598,7 +16709,7 @@ static PyObject *__pyx_pf_5tinyr_9_NodeIter_2__next__(struct __pyx_obj_5tinyr__N int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":907 * Duint level @@ -16770,13 +16881,20 @@ static PyObject *__pyx_pf_5tinyr_9_NodeIter_2__next__(struct __pyx_obj_5tinyr__N PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 913, __pyx_L16_error) } - __pyx_t_6 = __pyx_v_next->records; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; + __pyx_t_6 = __pyx_v_next->records; __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = 0; for (;;) { - if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 913, __pyx_L16_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 913, __pyx_L16_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L16_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_r, __pyx_t_5); @@ -16894,9 +17012,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -16904,21 +17019,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._NodeIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_9_NodeIter_4__reduce_cython__(((struct __pyx_obj_5tinyr__NodeIter *)__pyx_v_self)); /* function exit code */ @@ -16932,7 +17039,7 @@ static PyObject *__pyx_pf_5tinyr_9_NodeIter_4__reduce_cython__(CYTHON_UNUSED str int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -16997,8 +17104,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -17033,10 +17139,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -17067,7 +17174,7 @@ static PyObject *__pyx_pf_5tinyr_9_NodeIter_6__setstate_cython__(CYTHON_UNUSED s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -17117,8 +17224,7 @@ static int __pyx_pw_5tinyr_14_RectangleIter_1__cinit__(PyObject *__pyx_v_self, P #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 923, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -17152,10 +17258,11 @@ static int __pyx_pw_5tinyr_14_RectangleIter_1__cinit__(PyObject *__pyx_v_self, P } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 923, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -17192,7 +17299,7 @@ static int __pyx_pf_5tinyr_14_RectangleIter___cinit__(struct __pyx_obj_5tinyr__R int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":924 * @@ -17269,7 +17376,7 @@ static PyObject *__pyx_pf_5tinyr_14_RectangleIter_2__next__(struct __pyx_obj_5ti int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":932 * int level @@ -17354,7 +17461,7 @@ static PyObject *__pyx_pf_5tinyr_14_RectangleIter_2__next__(struct __pyx_obj_5ti } #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_2, }; + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error) @@ -17542,9 +17649,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -17552,21 +17656,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._RectangleIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_14_RectangleIter_4__reduce_cython__(((struct __pyx_obj_5tinyr__RectangleIter *)__pyx_v_self)); /* function exit code */ @@ -17580,7 +17676,7 @@ static PyObject *__pyx_pf_5tinyr_14_RectangleIter_4__reduce_cython__(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -17645,8 +17741,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -17681,10 +17776,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -17715,7 +17811,7 @@ static PyObject *__pyx_pf_5tinyr_14_RectangleIter_6__setstate_cython__(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -17765,8 +17861,7 @@ static int __pyx_pw_5tinyr_16_ChildRecordIter_1__cinit__(PyObject *__pyx_v_self, #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 951, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -17800,10 +17895,11 @@ static int __pyx_pw_5tinyr_16_ChildRecordIter_1__cinit__(PyObject *__pyx_v_self, } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 951, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -17841,7 +17937,7 @@ static int __pyx_pf_5tinyr_16_ChildRecordIter___cinit__(struct __pyx_obj_5tinyr_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":952 * @@ -17977,7 +18073,7 @@ static PyObject *__pyx_pf_5tinyr_16_ChildRecordIter_2__next__(struct __pyx_obj_5 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":963 * _ChildRecord cr @@ -18106,13 +18202,20 @@ static PyObject *__pyx_pf_5tinyr_16_ChildRecordIter_2__next__(struct __pyx_obj_5 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 970, __pyx_L16_error) } - __pyx_t_8 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; + __pyx_t_8 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_8); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 970, __pyx_L16_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 970, __pyx_L16_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L16_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_r, __pyx_t_6); @@ -18401,9 +18504,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -18411,21 +18511,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._ChildRecordIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_16_ChildRecordIter_4__reduce_cython__(((struct __pyx_obj_5tinyr__ChildRecordIter *)__pyx_v_self)); /* function exit code */ @@ -18439,7 +18531,7 @@ static PyObject *__pyx_pf_5tinyr_16_ChildRecordIter_4__reduce_cython__(CYTHON_UN int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -18504,8 +18596,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -18540,10 +18631,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -18574,7 +18666,7 @@ static PyObject *__pyx_pf_5tinyr_16_ChildRecordIter_6__setstate_cython__(CYTHON_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -18624,8 +18716,7 @@ static int __pyx_pw_5tinyr_8_KVIIter_1__cinit__(PyObject *__pyx_v_self, PyObject #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 989, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -18659,10 +18750,11 @@ static int __pyx_pw_5tinyr_8_KVIIter_1__cinit__(PyObject *__pyx_v_self, PyObject } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 989, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -18699,7 +18791,7 @@ static int __pyx_pf_5tinyr_8_KVIIter___cinit__(struct __pyx_obj_5tinyr__KVIIter int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_RefNannySetupContext("__cinit__", 1); /* "tinyr.pyx":990 * @@ -18762,9 +18854,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -18772,21 +18861,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._KVIIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_8_KVIIter_2__reduce_cython__(((struct __pyx_obj_5tinyr__KVIIter *)__pyx_v_self)); /* function exit code */ @@ -18800,7 +18881,7 @@ static PyObject *__pyx_pf_5tinyr_8_KVIIter_2__reduce_cython__(CYTHON_UNUSED stru int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -18865,8 +18946,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -18901,10 +18981,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -18935,7 +19016,7 @@ static PyObject *__pyx_pf_5tinyr_8_KVIIter_4__setstate_cython__(CYTHON_UNUSED st int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -18994,7 +19075,7 @@ static PyObject *__pyx_pf_5tinyr_9_KeysIter___next__(struct __pyx_obj_5tinyr__Ke int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":994 * cdef class _KeysIter(_KVIIter): @@ -19021,7 +19102,7 @@ static PyObject *__pyx_pf_5tinyr_9_KeysIter___next__(struct __pyx_obj_5tinyr__Ke } #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) @@ -19082,9 +19163,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -19092,21 +19170,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._KeysIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_9_KeysIter_2__reduce_cython__(((struct __pyx_obj_5tinyr__KeysIter *)__pyx_v_self)); /* function exit code */ @@ -19120,7 +19190,7 @@ static PyObject *__pyx_pf_5tinyr_9_KeysIter_2__reduce_cython__(CYTHON_UNUSED str int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -19185,8 +19255,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -19221,10 +19290,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -19255,7 +19325,7 @@ static PyObject *__pyx_pf_5tinyr_9_KeysIter_4__setstate_cython__(CYTHON_UNUSED s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -19314,7 +19384,7 @@ static PyObject *__pyx_pf_5tinyr_11_ValuesIter___next__(struct __pyx_obj_5tinyr_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":998 * cdef class _ValuesIter(_KVIIter): @@ -19341,7 +19411,7 @@ static PyObject *__pyx_pf_5tinyr_11_ValuesIter___next__(struct __pyx_obj_5tinyr_ } #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) @@ -19400,9 +19470,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -19410,21 +19477,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._ValuesIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_11_ValuesIter_2__reduce_cython__(((struct __pyx_obj_5tinyr__ValuesIter *)__pyx_v_self)); /* function exit code */ @@ -19438,7 +19497,7 @@ static PyObject *__pyx_pf_5tinyr_11_ValuesIter_2__reduce_cython__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -19503,8 +19562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -19539,10 +19597,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -19573,7 +19632,7 @@ static PyObject *__pyx_pf_5tinyr_11_ValuesIter_4__setstate_cython__(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -19633,7 +19692,7 @@ static PyObject *__pyx_pf_5tinyr_10_ItemsIter___next__(struct __pyx_obj_5tinyr__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__next__", 0); + __Pyx_RefNannySetupContext("__next__", 1); /* "tinyr.pyx":1003 * def __next__(self): @@ -19659,7 +19718,7 @@ static PyObject *__pyx_pf_5tinyr_10_ItemsIter___next__(struct __pyx_obj_5tinyr__ } #endif { - PyObject *__pyx_callargs[1] = {__pyx_t_3, }; + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) @@ -19740,9 +19799,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -19750,21 +19806,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr._ItemsIter.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_10_ItemsIter_2__reduce_cython__(((struct __pyx_obj_5tinyr__ItemsIter *)__pyx_v_self)); /* function exit code */ @@ -19778,7 +19826,7 @@ static PyObject *__pyx_pf_5tinyr_10_ItemsIter_2__reduce_cython__(CYTHON_UNUSED s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -19843,8 +19891,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 3, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -19879,10 +19926,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -19913,7 +19961,7 @@ static PyObject *__pyx_pf_5tinyr_10_ItemsIter_4__setstate_cython__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" @@ -19969,7 +20017,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_6levels___get__(struct __pyx_obj_5ti int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":1017 * property levels: @@ -20028,8 +20076,7 @@ static int __pyx_pw_5tinyr_9RTreeInfo_1__init__(PyObject *__pyx_v_self, PyObject #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 1019, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { @@ -20063,10 +20110,11 @@ static int __pyx_pw_5tinyr_9RTreeInfo_1__init__(PyObject *__pyx_v_self, PyObject } __pyx_v_rtree = ((struct __pyx_obj_5tinyr_RTree *)values[0]); } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1019, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -20099,7 +20147,7 @@ static int __pyx_pw_5tinyr_9RTreeInfo_1__init__(PyObject *__pyx_v_self, PyObject static int __pyx_pf_5tinyr_9RTreeInfo___init__(struct __pyx_obj_5tinyr_RTreeInfo *__pyx_v_self, struct __pyx_obj_5tinyr_RTree *__pyx_v_rtree) { int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_RefNannySetupContext("__init__", 1); /* "tinyr.pyx":1020 * @@ -20157,9 +20205,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iter_rectangles (wrapper)", 0); @@ -20167,21 +20212,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 1022, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("iter_rectangles", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "iter_rectangles", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTreeInfo.iter_rectangles", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_9RTreeInfo_2iter_rectangles(((struct __pyx_obj_5tinyr_RTreeInfo *)__pyx_v_self)); /* function exit code */ @@ -20196,7 +20233,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_2iter_rectangles(struct __pyx_obj_5t int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("iter_rectangles", 0); + __Pyx_RefNannySetupContext("iter_rectangles", 1); /* "tinyr.pyx":1029 * level of the index node or entry in the tree structure. @@ -20264,7 +20301,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_15common_boundary___get__(struct __p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":1035 * cdef: @@ -20376,7 +20413,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_5width___get__(struct __pyx_obj_5tin int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":1044 * cdef: @@ -20488,7 +20525,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_6height___get__(struct __pyx_obj_5ti int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_RefNannySetupContext("__get__", 1); /* "tinyr.pyx":1053 * cdef: @@ -20608,8 +20645,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(0, 1058, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -20644,10 +20680,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_filelike = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("to_dot", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1058, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -20705,7 +20742,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("to_dot", 0); + __Pyx_RefNannySetupContext("to_dot", 1); /* "tinyr.pyx":1068 * list node_record_leaf, node_record_child @@ -20774,7 +20811,8 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5tinyr__NodeIter), ((PyObject *)__pyx_v_self->rtree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) @@ -20785,19 +20823,31 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -20886,13 +20936,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1075, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5tinyr__ChildRecord))))) __PYX_ERR(0, 1075, __pyx_L1_error) @@ -20958,13 +21015,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1079, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_11); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5tinyr__InnerRecord))))) __PYX_ERR(0, 1079, __pyx_L1_error) @@ -21060,13 +21124,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1083, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; + __pyx_t_1 = __pyx_v_node->records; __Pyx_INCREF(__pyx_t_1); + __pyx_t_10 = 0; for (;;) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1083, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1083, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_XDECREF_SET(__pyx_v_record, __pyx_t_7); @@ -21214,13 +21285,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre * filelike.write(' %d;\n' % lid) * */ - __pyx_t_2 = __pyx_v_node_record_leaf; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_v_node_record_leaf; __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -21375,13 +21453,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre * filelike.write(' %d->%d [tailport=\"%d:s\"]\n' % ( nid, chid, rid )) * */ - __pyx_t_2 = __pyx_v_node_record_child; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_v_node_record_child; __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -21551,13 +21636,20 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_4to_dot(struct __pyx_obj_5tinyr_RTre * filelike.write(' %d->%d [tailport=\"%d:s\"]\n' % ( nid, lid, rid )) * */ - __pyx_t_2 = __pyx_v_node_record_leaf; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_v_node_record_leaf; __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + #endif + if (__pyx_t_5 >= __pyx_temp) break; + } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -21779,9 +21871,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); @@ -21789,21 +21878,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - goto __pyx_L4_argument_unpacking_done; - goto __pyx_L3_error; - __pyx_L3_error:; - __Pyx_AddTraceback("tinyr.RTreeInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_5tinyr_9RTreeInfo_6__reduce_cython__(((struct __pyx_obj_5tinyr_RTreeInfo *)__pyx_v_self)); /* function exit code */ @@ -21824,7 +21905,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_6__reduce_cython__(struct __pyx_obj_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict @@ -22062,8 +22143,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 16, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -22098,10 +22178,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v___pyx_state = values[0]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -22133,7 +22214,7 @@ static PyObject *__pyx_pf_5tinyr_9RTreeInfo_8__setstate_cython__(struct __pyx_ob int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setstate_cython__", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_RTreeInfo, (type(self), 0xda92ccd, state) @@ -22205,8 +22286,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -22269,10 +22349,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__Record", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -22310,7 +22391,7 @@ static PyObject *__pyx_pf_5tinyr___pyx_unpickle__Record(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle__Record", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle__Record", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -22493,7 +22574,7 @@ static PyObject *__pyx_f_5tinyr___pyx_unpickle__Record__set_state(struct __pyx_o int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle__Record__set_state", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle__Record__set_state", 1); /* "(tree fragment)":12 * return __pyx_result @@ -22647,8 +22728,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -22711,10 +22791,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__ChildRecord", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -22752,7 +22833,7 @@ static PyObject *__pyx_pf_5tinyr_2__pyx_unpickle__ChildRecord(CYTHON_UNUSED PyOb int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle__ChildRecord", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle__ChildRecord", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -22935,7 +23016,7 @@ static PyObject *__pyx_f_5tinyr___pyx_unpickle__ChildRecord__set_state(struct __ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle__ChildRecord__set_state", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle__ChildRecord__set_state", 1); /* "(tree fragment)":12 * return __pyx_result @@ -23100,8 +23181,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - __pyx_nargs = PyTuple_Size(__pyx_args); - if (unlikely((__pyx_nargs < 0))) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); @@ -23164,10 +23244,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } - goto __pyx_L4_argument_unpacking_done; + goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RTreeInfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) - goto __pyx_L3_error; + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; @@ -23205,7 +23286,7 @@ static PyObject *__pyx_pf_5tinyr_4__pyx_unpickle_RTreeInfo(CYTHON_UNUSED PyObjec int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RTreeInfo", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_RTreeInfo", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError @@ -23387,7 +23468,7 @@ static PyObject *__pyx_f_5tinyr___pyx_unpickle_RTreeInfo__set_state(struct __pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RTreeInfo__set_state", 0); + __Pyx_RefNannySetupContext("__pyx_unpickle_RTreeInfo__set_state", 1); /* "(tree fragment)":12 * return __pyx_result @@ -25938,6 +26019,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tinyr, __pyx_k_tinyr, sizeof(__pyx_k_tinyr), 0, 0, 1, 1}, + {&__pyx_n_u_tinyr, __pyx_k_tinyr, sizeof(__pyx_k_tinyr), 0, 1, 0, 1}, {&__pyx_kp_s_tinyr_tinyr_pyx, __pyx_k_tinyr_tinyr_pyx, sizeof(__pyx_k_tinyr_tinyr_pyx), 0, 0, 1, 0}, {&__pyx_n_s_tmp_coords, __pyx_k_tmp_coords, sizeof(__pyx_k_tmp_coords), 0, 0, 1, 1}, {&__pyx_n_s_to_dot, __pyx_k_to_dot, sizeof(__pyx_k_to_dot), 0, 0, 1, 1}, @@ -26984,9 +27066,15 @@ namespace { #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inittinyr(void) CYTHON_SMALL_CODE; /*proto*/ +#if !defined(CYTHON_NO_PYINIT_EXPORT) && (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) +__Pyx_PyMODINIT_FUNC init__init__(void) { inittinyr(); } +#endif __Pyx_PyMODINIT_FUNC inittinyr(void) #else __Pyx_PyMODINIT_FUNC PyInit_tinyr(void) CYTHON_SMALL_CODE; /*proto*/ +#if !defined(CYTHON_NO_PYINIT_EXPORT) && (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) +__Pyx_PyMODINIT_FUNC PyInit___init__(void) { return PyInit_tinyr(); } +#endif __Pyx_PyMODINIT_FUNC PyInit_tinyr(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { @@ -27106,7 +27194,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_tinyr(PyObject *__pyx_pyinit_modul __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to tinyr pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "tinyr" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -27118,10 +27206,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_tinyr(PyObject *__pyx_pyinit_modul CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_cython_runtime); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -27133,7 +27219,7 @@ if (!__Pyx_RefNanny) { } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_tinyr(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif @@ -27173,6 +27259,9 @@ if (!__Pyx_RefNanny) { if (__pyx_module_is_main_tinyr) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } + if (!CYTHON_PEP489_MULTI_PHASE_INIT) { + if (unlikely((__Pyx_SetPackagePathFromImportLib(__pyx_n_u_tinyr) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -27867,6 +27956,8 @@ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObjec tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; @@ -27924,14 +28015,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #endif /* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { @@ -27943,6 +28040,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; +#endif } /* GetBuiltinName */ @@ -28245,7 +28343,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -28632,13 +28730,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 0x030d00A1 + int res = PyObject_GetOptionalAttr(o, n, &r); + return (res != 0) ? r : __Pyx_NewRef(d); +#else + #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { @@ -28760,9 +28882,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject } return r; } -#endif + #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +#endif } /* PyDictVersioning */ @@ -28800,7 +28923,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { @@ -28899,7 +29022,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -28918,7 +29041,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -28950,7 +29073,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -29060,9 +29183,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && @@ -29139,8 +29268,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -29157,10 +29291,15 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -29173,6 +29312,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #endif /* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; @@ -29188,28 +29328,17 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg Py_DECREF(argstuple); return result; } +#endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { -#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) - if (__Pyx_IsCyOrPyCFunction(func)) -#else - if (PyCFunction_Check(func)) -#endif - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { - if (PyCFunction_Check(func)) - { - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, args[0]); - } - } + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 @@ -29233,25 +29362,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj } #endif #endif - #if CYTHON_VECTORCALL - #if Py_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif - if (f) { - return f(func, args, (size_t)nargs, kwargs); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, kwargs); + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif } - #endif if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif } /* PyObjectCallOneArg */ @@ -29333,11 +29468,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -29365,9 +29496,10 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -29389,9 +29521,10 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; - PyObject *result = PyObject_Call(method, selfless_args, kwargs); + result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } @@ -29411,7 +29544,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else - if (likely(!PyCFunction_Check(method))) + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; @@ -29419,9 +29552,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif -#if defined(CYTHON_COMPILING_IN_PYPY) -#elif PY_VERSION_HEX >= 0x03090000 - if (PyCFunction_CheckExact(method)) +#if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif @@ -29739,8 +29870,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg = NULL; - return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ @@ -29903,12 +30034,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyOb } /* PyObjectCallMethod1 */ +#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } +#endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { +#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 + PyObject *args[2] = {obj, arg}; + (void) __Pyx_PyObject_GetMethod; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_Call2Args; + return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -29918,6 +30058,7 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); +#endif } /* pop_index */ @@ -30073,7 +30214,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { @@ -30165,6 +30306,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { } /* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { @@ -30181,6 +30323,7 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { return 1; } } +#endif /* CallNextTpTraverse */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { @@ -30207,6 +30350,57 @@ static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { tp_clear(obj); } +/* SetPackagePathFromImportLib */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_PEP489_MULTI_PHASE_INIT +static int __Pyx_SetPackagePathFromImportLib(PyObject *module_name) { + PyObject *importlib, *osmod, *ossep, *parts, *package_path; + PyObject *file_path = NULL; + int result; + PyObject *spec; + importlib = PyImport_ImportModule("importlib.util"); + if (unlikely(!importlib)) + goto bad; + spec = PyObject_CallMethod(importlib, "find_spec", "(O)", module_name); + Py_DECREF(importlib); + if (unlikely(!spec)) + goto bad; + file_path = PyObject_GetAttrString(spec, "origin"); + Py_DECREF(spec); + if (unlikely(!file_path)) + goto bad; + if (unlikely(PyObject_SetAttrString(__pyx_m, "__file__", file_path) < 0)) + goto bad; + osmod = PyImport_ImportModule("os"); + if (unlikely(!osmod)) + goto bad; + ossep = PyObject_GetAttrString(osmod, "sep"); + Py_DECREF(osmod); + if (unlikely(!ossep)) + goto bad; + parts = PyObject_CallMethod(file_path, "rsplit", "(Oi)", ossep, 1); + Py_DECREF(file_path); file_path = NULL; + Py_DECREF(ossep); + if (unlikely(!parts)) + goto bad; + package_path = Py_BuildValue("[O]", PyList_GET_ITEM(parts, 0)); + Py_DECREF(parts); + if (unlikely(!package_path)) + goto bad; + goto set_path; +bad: + PyErr_WriteUnraisable(module_name); + Py_XDECREF(file_path); + PyErr_Clear(); + package_path = PyList_New(0); + if (unlikely(!package_path)) + return -1; +set_path: + result = PyObject_SetAttrString(__pyx_m, "__path__", package_path); + Py_DECREF(package_path); + return result; +} +#endif + /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { @@ -30325,38 +30519,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -31180,10 +31374,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME); - if (unlikely(!abi_module)) return NULL; - Py_INCREF(abi_module); - return abi_module; + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -31344,6 +31535,20 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ #endif /* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( @@ -32492,8 +32697,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject Py_DECREF(replace); return result; } - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; @@ -32513,6 +32718,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (result) Py_INCREF(result); return result; } + #else + return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -32610,7 +32817,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); @@ -32851,7 +33058,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -32987,13 +33194,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; @@ -33001,16 +33208,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -33049,13 +33258,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; @@ -33063,16 +33272,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -33248,7 +33459,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -33521,7 +33732,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -33657,13 +33868,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 return _PyLong_FromByteArray(bytes, sizeof(unsigned int), little, !is_unsigned); #else PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes"); + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int)); if (!py_bytes) goto limited_bad; @@ -33671,16 +33882,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: - Py_XDECREF(from_bytes); - Py_XDECREF(py_bytes); - Py_XDECREF(order_str); - Py_XDECREF(arg_tuple); Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); return result; #endif } @@ -33856,7 +34069,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #endif if (likely(v)) { int ret = -1; -#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)v, @@ -33976,41 +34189,50 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #endif /* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { - char ctversion[5]; - int same=1, i, found_dot; - const char* rt_from_call = Py_GetVersion(); - PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - found_dot = 0; - for (i = 0; i < 4; i++) { - if (!ctversion[i]) { - same = (rt_from_call[i] < '0' || rt_from_call[i] > '9'); - break; +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; } - if (rt_from_call[i] != ctversion[i]) { - same = 0; + version += factor * digit; + if (rt_version[i] != '.') break; - } + digit = 0; + factor >>= 8; + ++i; } - if (!same) { - char rtversion[5] = {'\0'}; + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { char message[200]; - for (i=0; i<4; ++i) { - if (rt_from_call[i] == '.') { - if (found_dot) break; - found_dot = 1; - } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') { - break; - } - rtversion[i] = rt_from_call[i]; - } PyOS_snprintf(message, sizeof(message), - "compile time version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); return PyErr_WarnEx(NULL, message, 1); } - return 0; } /* InitStrings */ @@ -34056,8 +34278,24 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { return 0; } +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; diff --git a/pyflowline/formats/convert_coordinates.py b/pyflowline/formats/convert_coordinates.py index 56d5ea6..8f7efd5 100644 --- a/pyflowline/formats/convert_coordinates.py +++ b/pyflowline/formats/convert_coordinates.py @@ -208,7 +208,12 @@ def convert_gcs_coordinates_to_flowline(aCoordinates_in): pEdge = pyedge( aVertex[j], aVertex[j+1] ) aEdge.append(pEdge) - pFlowline = pyflowline( aEdge) + if len(aEdge) == 0: + print('No edge is created') + pFlowline = None + pass + else: + pFlowline = pyflowline( aEdge) return pFlowline def convert_pcs_coordinates_to_flowline(aCoordinates_in, pSpatial_reference_in): diff --git a/pyflowline/formats/read_flowline.py b/pyflowline/formats/read_flowline.py index 89ad2f6..a182eaa 100644 --- a/pyflowline/formats/read_flowline.py +++ b/pyflowline/formats/read_flowline.py @@ -226,11 +226,12 @@ def read_flowline_geojson(sFilename_geojson_in): dummy1= np.array(aCoords) pFlowline = convert_gcs_coordinates_to_flowline(dummy1) - pFlowline.lFlowlineIndex = lFlowlineIndex - pFlowline.lFlowlineID = lFlowlineID - pFlowline.lNHDPlusID= lNHDPlusID - aFlowline.append(pFlowline) - lFlowlineIndex = lFlowlineIndex + 1 + if pFlowline is not None: + pFlowline.lFlowlineIndex = lFlowlineIndex + pFlowline.lFlowlineID = lFlowlineID + pFlowline.lNHDPlusID= lNHDPlusID + aFlowline.append(pFlowline) + lFlowlineIndex = lFlowlineIndex + 1 else: if sGeometry_type =='LINESTRING': @@ -242,13 +243,14 @@ def read_flowline_geojson(sFilename_geojson_in): dummy1= np.array(aCoords) pFlowline = convert_gcs_coordinates_to_flowline(dummy1) - pFlowline.lFlowlineIndex = lFlowlineIndex - pFlowline.iStream_segment = iStream_segment - pFlowline.iStream_order = iStream_order - pFlowline.lFlowlineID = lFlowlineID - pFlowline.lNHDPlusID = lNHDPlusID - aFlowline.append(pFlowline) - lFlowlineIndex = lFlowlineIndex + 1 + if pFlowline is not None: + pFlowline.lFlowlineIndex = lFlowlineIndex + pFlowline.iStream_segment = iStream_segment + pFlowline.iStream_order = iStream_order + pFlowline.lFlowlineID = lFlowlineID + pFlowline.lNHDPlusID = lNHDPlusID + aFlowline.append(pFlowline) + lFlowlineIndex = lFlowlineIndex + 1 else: print(sGeometry_type) pass diff --git a/pyflowline/formats/read_mesh.py b/pyflowline/formats/read_mesh.py index c77271c..b1d26ef 100644 --- a/pyflowline/formats/read_mesh.py +++ b/pyflowline/formats/read_mesh.py @@ -38,7 +38,7 @@ def read_mesh_json(iMesh_type_in, sFilename_mesh_in): #dummy0 = loads( pGeometry_mesh.ExportToWkt() ) #aCoords_gcs = dummy0.exterior.coords #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_mesh) + aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) lCellID = pFeature_mesh.GetField("cellid") dLon = pFeature_mesh.GetField("longitude") dLat = pFeature_mesh.GetField("latitude") @@ -96,7 +96,7 @@ def read_mesh_json_w_topology(iMesh_type_in, sFilename_mesh_in): #dummy0 = loads( pGeometry_mesh.ExportToWkt() ) #aCoords_gcs = dummy0.exterior.coords #aCoords_gcs= np.array(aCoords_gcs) - aCoords_gcs = get_geometry_coords(pGeometry_mesh) + aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) lCellID = pFeature_mesh.GetField("cellid") dLon = pFeature_mesh.GetField("longitude") dLat = pFeature_mesh.GetField("latitude") From c4c8bf55177a663896f59c3878356e9fe8949386 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Thu, 22 Feb 2024 09:45:18 -0800 Subject: [PATCH 05/15] remove aFlowline_basin_edge from the export function --- pyflowline/classes/basin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 4c49497..b544014 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -1100,7 +1100,7 @@ def basin_export_config_to_json(self, sFilename_output_in = None): aSkip = ['aFlowline_basin_filtered', \ 'aFlowline_basin_simplified','aFlowline_basin_conceptual','aConfluence_basin_simplified', - 'aConfluence_basin_conceptual'] + 'aConfluence_basin_conceptual','aFlowline_basin_edge'] obj = self.__dict__.copy() for sKey in aSkip: obj.pop(sKey, None) From 8d2de4a60041e8fc94ef649b3e854d2d3defc83e Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 27 Feb 2024 17:16:08 -0800 Subject: [PATCH 06/15] performance update --- .../algorithms/auxiliary/check_head_water.py | 45 +++-- .../auxiliary/find_vertex_in_list.py | 2 - .../direction/correct_flowline_direction.py | 23 ++- .../algorithms/loop/remove_flowline_loop.py | 22 ++- pyflowline/algorithms/merge/merge_flowline.py | 24 ++- .../simplification/remove_small_river.py | 53 +++--- .../split/find_flowline_confluence.py | 179 ++++++++++-------- .../algorithms/split/find_flowline_vertex.py | 27 +-- pyflowline/algorithms/split/split_flowline.py | 96 ++++++---- pyflowline/classes/basin.py | 15 +- pyflowline/classes/flowline.py | 16 +- pyflowline/formats/convert_coordinates.py | 49 ++--- .../formats/convert_flowline_to_geojson.py | 6 +- pyflowline/formats/export_flowline.py | 126 ++++++------ pyflowline/formats/export_vertex.py | 64 ++++--- pyflowline/formats/read_flowline.py | 30 +-- 16 files changed, 420 insertions(+), 357 deletions(-) diff --git a/pyflowline/algorithms/auxiliary/check_head_water.py b/pyflowline/algorithms/auxiliary/check_head_water.py index 1e223cd..456d7da 100644 --- a/pyflowline/algorithms/auxiliary/check_head_water.py +++ b/pyflowline/algorithms/auxiliary/check_head_water.py @@ -9,21 +9,30 @@ def check_head_water(aFlowline_in, pVertex_start_in): Returns: [int]: [0: not headwater; 1: is headwater] """ - nFlowline = len(aFlowline_in) - iFlag_head_water = -1 - iCount = 0 - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - pVerter_start = pFlowline.pVertex_start - pVerter_end = pFlowline.pVertex_end - if pVerter_start == pVertex_start_in: - iCount = iCount + 1 - pass - if pVerter_end == pVertex_start_in: - iCount = iCount + 1 - pass - pass - if iCount == 1: - iFlag_head_water=1 - - return iFlag_head_water \ No newline at end of file + #nFlowline = len(aFlowline_in) + #iFlag_head_water = -1 + #iCount = 0 + #for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # pVerter_start = pFlowline.pVertex_start + # pVerter_end = pFlowline.pVertex_end + # if pVerter_start == pVertex_start_in: + # iCount = iCount + 1 + # pass + # if pVerter_end == pVertex_start_in: + # iCount = iCount + 1 + # pass + # pass + #if iCount == 1: + # iFlag_head_water=1 + # + #return iFlag_head_water + #Create sets of all start and end vertices + start_vertices = {flowline.pVertex_start for flowline in aFlowline_in} + end_vertices = {flowline.pVertex_end for flowline in aFlowline_in} + + # Check if the vertex is a headwater + is_headwater = pVertex_start_in in start_vertices and pVertex_start_in not in end_vertices + + return int(is_headwater) + diff --git a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py index 5d5fb7c..89b0c7b 100644 --- a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py @@ -23,9 +23,7 @@ def find_vertex_in_list(aVertex_in, pVertex_in, dThreshold_in=1.0E-6): iFlag_exist = 0 lIndex= -1 nVertex= len(aVertex_in) - if iFlag_use_rtree == 1: - #can we use rtree here? #index_vertex = rtree.index.Index() index_vertex = RTree(max_cap=5, min_cap=2) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index 3907e6b..69e38ee 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -19,6 +19,10 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): aFlag_process=None global lFlowlineIndex nFlowline = len(aFlowline_in) + # Create sets for faster lookup + pVertex_start_in_set = {flowline.pVertex_start for flowline in aFlowline_in} + pVertex_end_in_set = {flowline.pVertex_end for flowline in aFlowline_in} + aFlag_process=np.full(nFlowline, 0, dtype =int) iFlag_first = 1 for i in range(nFlowline): @@ -26,21 +30,18 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): iFlag_dam = pFlowline.iFlag_dam iStream_order = pFlowline.iStream_order pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end - dDiatance = pVertex_end.calculate_distance( pVertex_outlet_in ) + pVertex_end = pFlowline.pVertex_end if iFlag_first == 1: - dDiatance_min = dDiatance + dDiatance_min = pVertex_end.calculate_distance( pVertex_outlet_in ) lIndex_outlet = i iFlag_first=0 - else: + else: + dDiatance = pFlowline.pVertex_end.calculate_distance(pVertex_outlet_in) if dDiatance < dDiatance_min: dDiatance_min = dDiatance #found it lIndex_outlet = i - pass - else: - - pass + lFlowlineIndex = 0 pFlowline = aFlowline_in[lIndex_outlet] @@ -59,7 +60,8 @@ def find_upstream_flowline(pVertex_start_in, pVertex_end_in): pFlowline = aFlowline_in[i] pVerter_start = pFlowline.pVertex_start pVerter_end = pFlowline.pVertex_end - if pVerter_end == pVertex_start_in and pVerter_start!=pVertex_end_in: + #if pVerter_end == pVertex_start_in and pVerter_start!=pVertex_end_in: + if pVerter_end in pVertex_start_in_set and pVerter_start != pVertex_end_in: if aFlag_process[i] != 1: nUpstream = nUpstream + 1 aUpstream.append(i) @@ -67,7 +69,8 @@ def find_upstream_flowline(pVertex_start_in, pVertex_end_in): aFlag_process[i] = 1 pass else: - if pVerter_start == pVertex_start_in and pVerter_end !=pVertex_end_in : + #if pVerter_start == pVertex_start_in and pVerter_end !=pVertex_end_in : + if pVerter_start in pVertex_start_in_set and pVerter_end != pVertex_end_in: if aFlag_process[i] != 1: nUpstream = nUpstream + 1 aUpstream.append(i) diff --git a/pyflowline/algorithms/loop/remove_flowline_loop.py b/pyflowline/algorithms/loop/remove_flowline_loop.py index a32bde5..0608135 100644 --- a/pyflowline/algorithms/loop/remove_flowline_loop.py +++ b/pyflowline/algorithms/loop/remove_flowline_loop.py @@ -10,6 +10,16 @@ def remove_flowline_loop(aFlowline_in): """ aFlowline_out=list() nFlowline = len(aFlowline_in) + + # Create a dictionary that maps pVertex_start to a list of flowlines + flowline_dict = {} + for i in range(nFlowline): + pFlowline = aFlowline_in[i] + pVertex_start = pFlowline.pVertex_start + if pVertex_start not in flowline_dict: + flowline_dict[pVertex_start] = [] + flowline_dict[pVertex_start].append((i, pFlowline)) + def find_paralle_stream( pVertex_start_in): ndownstream=0 aDownstream=list() @@ -32,7 +42,14 @@ def find_paralle_stream( pVertex_start_in): pVertex_start = pFlowline.pVertex_start pVertex_end = pFlowline.pVertex_end iStream_order = pFlowline.iStream_order - ndownstream , aDownstream, aStream_order = find_paralle_stream( pVertex_start) + #ndownstream , aDownstream, aStream_order = find_paralle_stream( pVertex_start) + + # Get all parallel streams + parallel_streams = flowline_dict.get(pVertex_start, []) + ndownstream = len(parallel_streams) + aDownstream = [j for j, _ in parallel_streams] + aStream_order = [flowline.iStream_order for _, flowline in parallel_streams] + if ndownstream == 1: if aFlag[i] !=1: pFlowline.lFlowlineIndex = lID @@ -56,7 +73,6 @@ def find_paralle_stream( pVertex_start_in): for k in range(ndownstream): aFlag[ aDownstream[k] ] = 1 - pass - pass + return aFlowline_out \ No newline at end of file diff --git a/pyflowline/algorithms/merge/merge_flowline.py b/pyflowline/algorithms/merge/merge_flowline.py index 12ca7d6..85776f2 100644 --- a/pyflowline/algorithms/merge/merge_flowline.py +++ b/pyflowline/algorithms/merge/merge_flowline.py @@ -1,7 +1,5 @@ import numpy as np - - import importlib iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -43,9 +41,15 @@ def merge_flowline(aFlowline_in, aVertex_headwater=aVertex[aIndex_headwater] aVertex_middle=aVertex[aIndex_middle] + + #convert to set + aVertex_headwater_set = set(aVertex[aIndex_headwater]) + aVertex_middle_set = set(aVertex[aIndex_middle]) + if aIndex_confluence.size > 0: iFlag_confluence = 1 aVertex_confluence=aVertex[aIndex_confluence] + aVertex_confluence_set = set(aVertex[aIndex_confluence]) else: iFlag_confluence = 0 pass @@ -56,7 +60,8 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): iSegment = pFlowline.iStream_segment pVertex_current = pVertex_start_in - while (find_vertex_in_list(aVertex_middle.tolist(), pVertex_current)[0] ==1): + #while (find_vertex_in_list(aVertex_middle.tolist(), pVertex_current)[0] ==1): + while (pVertex_current in aVertex_middle_set): for j in range(0, nFlowline): pFlowline2 = aFlowline_in[j] pVertex_start = pFlowline2.pVertex_start @@ -65,12 +70,11 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): pFlowline = pFlowline.merge_upstream(pFlowline2) pVertex_current = pVertex_start break - else: - pass - + #go to next - if find_vertex_in_list(aVertex_headwater.tolist(), pVertex_current)[0] ==1: + #if find_vertex_in_list(aVertex_headwater.tolist(), pVertex_current)[0] ==1: + if pVertex_current in aVertex_headwater_set: pFlowline.iStream_segment = iSegment pFlowline.iStream_order = 1 pFlowline.lFlowlineIndex = lID @@ -83,7 +87,8 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): aFlowline_out.append(pFlowline) lID = lID + 1 #confluence - if find_vertex_in_list(aVertex_confluence.tolist(), pVertex_current)[0] ==1: + #if find_vertex_in_list(aVertex_confluence.tolist(), pVertex_current)[0] ==1: + if pVertex_current in aVertex_confluence_set: for k in range(0, nFlowline): pFlowline3 = aFlowline_in[k] pVertex_start = pFlowline3.pVertex_start @@ -118,7 +123,8 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): #now start from outlet if iFlag_confluence == 1: #check whether outlet is a confluence - if (find_vertex_in_list(aVertex_confluence.tolist(), pVertex_end)[0] ==1): + #if (find_vertex_in_list(aVertex_confluence.tolist(), pVertex_end)[0] ==1): + if pVertex_end in aVertex_confluence_set: for i in range(nFlowline): pFlowline = aFlowline_in[i] pVertex_start_dummy = pFlowline.pVertex_start diff --git a/pyflowline/algorithms/simplification/remove_small_river.py b/pyflowline/algorithms/simplification/remove_small_river.py index 35bd45b..6e782bc 100644 --- a/pyflowline/algorithms/simplification/remove_small_river.py +++ b/pyflowline/algorithms/simplification/remove_small_river.py @@ -8,38 +8,35 @@ def remove_small_river(aFlowline_in, dThreshold_in): Returns: List: Theortically, the flowline should be ordered from outlet to headwater - """ - nFlowline = len(aFlowline_in) - aFlowline_out=list() - if nFlowline == 1: - aFlowline_out.append(aFlowline_in[0]) + """ + + if len(aFlowline_in) == 1: + return [aFlowline_in[0]] else: + aFlowline_out=list() lID = 0 - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - iFlag_dam = pFlowline.iFlag_dam - pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end + for pFlowline in aFlowline_in: + iFlag_dam = pFlowline.iFlag_dam dLength = pFlowline.calculate_length() - if iFlag_dam ==1: + if iFlag_dam == 1 or pFlowline.iStream_order != 1 or dLength > dThreshold_in: pFlowline.lFlowlineIndex = lID aFlowline_out.append(pFlowline) - lID = lID +1 - else: - if pFlowline.iStream_order == 1: - if dLength > dThreshold_in : - pFlowline.lFlowlineIndex = lID - aFlowline_out.append(pFlowline) - lID = lID + 1 - pass - else: - pass - pass - else: #this one might be not used - pFlowline.lFlowlineIndex = lID - aFlowline_out.append(pFlowline) - lID = lID +1 - pass + lID += 1 + #if iFlag_dam ==1: + # pFlowline.lFlowlineIndex = lID + # aFlowline_out.append(pFlowline) + # lID = lID +1 + #else: + # if pFlowline.iStream_order == 1: + # if dLength > dThreshold_in : + # pFlowline.lFlowlineIndex = lID + # aFlowline_out.append(pFlowline) + # lID = lID + 1 + # else: #this one might be not used + # pFlowline.lFlowlineIndex = lID + # aFlowline_out.append(pFlowline) + # lID = lID +1 + # pass #if check_head_water(aFlowline_in, pVertex_start)==1: # if dLength > dThreshold_in : # pFlowline.lIndex = lID @@ -54,6 +51,6 @@ def remove_small_river(aFlowline_in, dThreshold_in): # lID = lID +1 # pass - pass + return aFlowline_out \ No newline at end of file diff --git a/pyflowline/algorithms/split/find_flowline_confluence.py b/pyflowline/algorithms/split/find_flowline_confluence.py index 7562a4e..f5c8616 100644 --- a/pyflowline/algorithms/split/find_flowline_confluence.py +++ b/pyflowline/algorithms/split/find_flowline_confluence.py @@ -1,9 +1,5 @@ import numpy as np - -#from pyflowline.algorithms.auxiliary.check_head_water import check_head_water - - import importlib iFlag_cython = importlib.util.find_spec("cython") @@ -33,94 +29,115 @@ def find_flowline_confluence(aFlowline_in, pVertex_outlet_in): aIndex_middle =list() lIndex_outlet = -1 - #add all the flowline start and end vertex into a host list - #because the flowlines are order from outlet to headwater, there is no order in vertex list - #for i in range(0, nFlowline): - # pFlowline = aFlowline_in[i] - # pVertex_start = pFlowline.pVertex_start - # pVertex_end = pFlowline.pVertex_end - # aVertex, dummy = add_unique_vertex(aVertex, pVertex_start) - # aVertex, dummy = add_unique_vertex(aVertex, pVertex_end) - # pass - aVertex = find_flowline_vertex(aFlowline_in) + vertex_to_index = {vertex: index for index, vertex in enumerate(aVertex)} + + nVertex=len(aVertex) aConnectivity = np.full( nVertex , 0, dtype=int ) - iFlag_first=1 - for i in range(nVertex): - pVertex = aVertex[i] - dDiatance = pVertex.calculate_distance( pVertex_outlet_in) - if iFlag_first ==1: - dDiatance_min = dDiatance - lIndex_outlet = i - pVertex_outlet_out = pVertex - iFlag_first=0 - else: - if dDiatance < dDiatance_min: - dDiatance_min = dDiatance - #found it - lIndex_outlet = i - pVertex_outlet_out = pVertex - pass - else: - pass + #iFlag_first=1 + #for i in range(nVertex): + # pVertex = aVertex[i] + # dDiatance = pVertex.calculate_distance( pVertex_outlet_in) + # if iFlag_first ==1: + # dDiatance_min = dDiatance + # lIndex_outlet = i + # pVertex_outlet_out = pVertex + # iFlag_first=0 + # else: + # if dDiatance < dDiatance_min: + # dDiatance_min = dDiatance + # #found it + # lIndex_outlet = i + # pVertex_outlet_out = pVertex + # pass + # else: + # pass + + distances = [vertex.calculate_distance(pVertex_outlet_in) for vertex in aVertex] + lIndex_outlet = np.argmin(distances) + pVertex_outlet_out = aVertex[lIndex_outlet] #a outlet can be a confluence, so we won't set it - #aConnectivity[lIndex_outlet] =0 - for i in range(0, nFlowline): - pFlowline = aFlowline_in[i] + aConnectivity[lIndex_outlet] =0 + + #for i in range(0, nFlowline): + # pFlowline = aFlowline_in[i] + # pVertex_start = pFlowline.pVertex_start + # pVertex_end = pFlowline.pVertex_end + # + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) + # if lIndex != lIndex_outlet: + # #if check_head_water(aFlowline_in, pVertex_start)==1: + # if pFlowline.iStream_order == 1: + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) + # aConnectivity[lIndex] = 1 + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) + # aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + # else: + # #middle point, or confluence + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) + # if iFlag_exist ==1: + # aConnectivity[lIndex] = aConnectivity[lIndex] + 1 +# + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) + # if iFlag_exist ==1: + # aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + # else: + # #it is outlet, but an outlet can be a confluence as well + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) + # if iFlag_exist ==1: + # aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + # iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) + # if iFlag_exist ==1: + # aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + # pass + for pFlowline in aFlowline_in: pVertex_start = pFlowline.pVertex_start pVertex_end = pFlowline.pVertex_end - - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) - if lIndex != lIndex_outlet: + lIndex_end = vertex_to_index.get(pVertex_end) - #if check_head_water(aFlowline_in, pVertex_start)==1: + if lIndex_end != lIndex_outlet: if pFlowline.iStream_order == 1: - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) - aConnectivity[lIndex] = 1 - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) - aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + lIndex_start = vertex_to_index.get(pVertex_start) + aConnectivity[lIndex_start] = 1 + aConnectivity[lIndex_end] += 1 else: - #middle point, or confluence - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) - if iFlag_exist ==1: - aConnectivity[lIndex] = aConnectivity[lIndex] + 1 - - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) - if iFlag_exist ==1: - aConnectivity[lIndex] = aConnectivity[lIndex] + 1 + lIndex_start = vertex_to_index.get(pVertex_start) + if lIndex_start is not None: + aConnectivity[lIndex_start] += 1 + if lIndex_end is not None: + aConnectivity[lIndex_end] += 1 else: - #it is outlet, but an outlet can be a confluence as well - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_start) - if iFlag_exist ==1: - aConnectivity[lIndex] = aConnectivity[lIndex] + 1 - iFlag_exist, lIndex = find_vertex_in_list(aVertex, pVertex_end) - if iFlag_exist ==1: - aConnectivity[lIndex] = aConnectivity[lIndex] + 1 - pass - + lIndex_start = vertex_to_index.get(pVertex_start) + if lIndex_start is not None: + aConnectivity[lIndex_start] += 1 + if lIndex_end is not None: + aConnectivity[lIndex_end] += 1 #reset outlet - #aConnectivity[lIndex_outlet] = 0 - for i in range(0, nVertex): - if i == lIndex_outlet: - if (aConnectivity[i] >1): - aIndex_confluence.append(i) - pass - pass - else: - if (aConnectivity[i] >=3): - aIndex_confluence.append(i) - else: - if (aConnectivity[i] ==1): - aIndex_headwater.append(i) - else: - if (aConnectivity[i] ==2): - aIndex_middle.append(i) - else: - #this is outlet - pass - - + + #for i in range(0, nVertex): + # if i == lIndex_outlet: + # if (aConnectivity[i] >1): + # aIndex_confluence.append(i) + # pass + # pass + # else: + # if (aConnectivity[i] >=3): + # aIndex_confluence.append(i) + # else: + # if (aConnectivity[i] ==1): + # aIndex_headwater.append(i) + # else: + # if (aConnectivity[i] ==2): + # aIndex_middle.append(i) + # else: + # #this is outlet + # pass + + aIndex_headwater = [i for i, x in enumerate(aConnectivity) if x == 1 and i != lIndex_outlet] + aIndex_middle = [i for i, x in enumerate(aConnectivity) if x == 2 and i != lIndex_outlet] + aIndex_confluence = [i for i, x in enumerate(aConnectivity) if x >= 3 or (i == lIndex_outlet and x > 1)] + return aVertex, lIndex_outlet, aIndex_headwater, aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet_out diff --git a/pyflowline/algorithms/split/find_flowline_vertex.py b/pyflowline/algorithms/split/find_flowline_vertex.py index 20a9a10..e6387ba 100644 --- a/pyflowline/algorithms/split/find_flowline_vertex.py +++ b/pyflowline/algorithms/split/find_flowline_vertex.py @@ -1,5 +1,3 @@ - - import importlib iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -18,30 +16,21 @@ def find_flowline_vertex(aFlowline_in, dThreshold_in=1.0E-6): _type_: _description_ """ aVertex = set() - nFlowline = len(aFlowline_in) + #nFlowline = len(aFlowline_in) #set up index and id first lVertexID = 1 - for i in range(0, nFlowline): - pFlowline = aFlowline_in[i] - #update the start and end vertex + for pFlowline in aFlowline_in: pFlowline.pVertex_start.lVertexID = lVertexID - lVertexID = lVertexID + 1 + pFlowline.pVertex_start.lFlowlineID = pFlowline.lFlowlineID + lVertexID += 1 pFlowline.pVertex_end.lVertexID = lVertexID - lVertexID = lVertexID + 1 - aVertex.add(pFlowline.pVertex_start) - aVertex.add(pFlowline.pVertex_end) - pass + pFlowline.pVertex_end.lFlowlineID = pFlowline.lFlowlineID + lVertexID += 1 + aVertex.update([pFlowline.pVertex_start, pFlowline.pVertex_end]) #conver the set back to list - aVertex=list(aVertex) - #for i in range(0, nFlowline): - # pFlowline = aFlowline_in[i] - # pVertex_start = pFlowline.pVertex_start - # pVertex_end = pFlowline.pVertex_end - # aVertex, dummy = add_unique_vertex(aVertex, pVertex_start,dThreshold_in) - # aVertex, dummy = add_unique_vertex(aVertex, pVertex_end, dThreshold_in) - # pass + aVertex=list(aVertex) return aVertex diff --git a/pyflowline/algorithms/split/split_flowline.py b/pyflowline/algorithms/split/split_flowline.py index 458a11c..91c3871 100644 --- a/pyflowline/algorithms/split/split_flowline.py +++ b/pyflowline/algorithms/split/split_flowline.py @@ -27,14 +27,14 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i """ aFlowline_out = list() nFlowline = len(aFlowline_in) - + aVertex_in_set = set(aVertex_in) + for i in range(nFlowline): pFlowline = aFlowline_in[i] iStream_order = pFlowline.iStream_order - iStream_segment = pFlowline.iStream_segment - lFlowlineID = pFlowline.lFlowlineID + #iStream_segment = pFlowline.iStream_segment iFlag_dam = pFlowline.iFlag_dam - nVertex = pFlowline.nVertex + #nVertex = pFlowline.nVertex nEdge= pFlowline.nEdge iPart = 0 aVertex = list() #the actual vertex of ROI @@ -44,11 +44,15 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i pVertex = pEdge.pVertex_start aVertex_all.append(pVertex) #get the start first - iFlag_exist, lIndex = find_vertex_in_list( aVertex_in, pVertex) - if iFlag_exist == 1: - iPart = iPart + 1 - aVertex.append(pVertex) - pass + #iFlag_exist, lIndex = find_vertex_in_list( aVertex_in, pVertex) + #if iFlag_exist == 1: + # iPart = iPart + 1 + # aVertex.append(pVertex) + # pass + + if pVertex in aVertex_in_set: + iPart += 1 + aVertex.append(pVertex) if iFlag_intersect is not None: if iFlag_use_id is not None: @@ -59,7 +63,7 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i npoint =0 for k in range(len(aVertex_in)): pVertex = aVertex_in[k] - if pVertex.lFlowlineID == lFlowlineID: + if pVertex.lFlowlineID == pFlowline.lFlowlineID: iFlag_exist =1 iPart = iPart + 1 distance = pEdge.pVertex_start.calculate_distance(pVertex) @@ -69,18 +73,24 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i npoint= npoint+ 1 #sort needed - if iFlag_exist == 1 : - x = np.array(aDistance) - b = np.argsort(x) - c = np.array(aIndex) - d= c[b] - aIndex_order = list(d) - #then push back - for k in range(npoint): - pVertex_dummy = aVertex_in[ aIndex_order[k] ] + #if iFlag_exist == 1 : + # x = np.array(aDistance) + # b = np.argsort(x) + # c = np.array(aIndex) + # d= c[b] + # aIndex_order = list(d) + # #then push back + # for k in range(npoint): + # pVertex_dummy = aVertex_in[ aIndex_order[k] ] + # aVertex.append(pVertex_dummy) + # aVertex_all.append(pVertex_dummy) + # pass + if aDistance: + aIndex_order = np.argsort(aDistance) + for k in aIndex_order: + pVertex_dummy = aVertex_in[k] aVertex.append(pVertex_dummy) aVertex_all.append(pVertex_dummy) - pass else: iFlag_exist, npoint, aIndex = find_vertex_on_edge( aVertex_in, pEdge) @@ -91,20 +101,18 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i iPart = iPart + 1 aVertex.append(pVertex_dummy) aVertex_all.append(pVertex_dummy) - pass - pass + #the last ending vertex pVertex = pFlowline.pVertex_end aVertex_all.append(pVertex) - iFlag_exist, lIndex = find_vertex_in_list( aVertex_in, pVertex) - if iFlag_exist == 1: + #iFlag_exist, lIndex = find_vertex_in_list( aVertex_in, pVertex) + #if iFlag_exist == 1: + if pVertex in aVertex_in_set: iPart = iPart + 1 - aVertex.append(pVertex) - pass + aVertex.append(pVertex) if iPart == 0 : - print('Something is wrong') - pass + print('Something is wrong') else: if iPart ==1: #print('This flowline does not form any loop') @@ -115,26 +123,30 @@ def split_flowline(aFlowline_in, aVertex_in, iFlag_intersect = None, iFlag_use_i if iPart >=2: nLine = iPart-1 #rebuild index - aVertex_index =list() - for m in range(iPart): - pVertex= aVertex[m] - iFlag_exist, lIndex = find_vertex_in_list( aVertex_all, pVertex) - if iFlag_exist ==1: - aVertex_index.append(lIndex) - pass + #aVertex_index =list() + #for m in range(iPart): + # pVertex= aVertex[m] + # iFlag_exist, lIndex = find_vertex_in_list( aVertex_all, pVertex) + # if iFlag_exist ==1: + # aVertex_index.append(lIndex) + # pass + + aVertex_index = [aVertex_all.index(pVertex) for pVertex in aVertex if pVertex in aVertex_all] + #find duplicate for k in range(nLine): t = aVertex_index[k] s = aVertex_index[k+1] if s!=t: - aEdge=list() - for l in range(t,s): - pVertex0 = aVertex_all[l] - pVertex1 = aVertex_all[l+1] - pEdge = pyedge(pVertex0, pVertex1) - aEdge.append(pEdge) - pass + #aEdge=list() + #for l in range(t,s): + # pVertex0 = aVertex_all[l] + # pVertex1 = aVertex_all[l+1] + # pEdge = pyedge(pVertex0, pVertex1) + # aEdge.append(pEdge) + # pass + aEdge=[pyedge(aVertex_all[l], aVertex_all[l+1]) for l in range(t,s)] pFlowline1 = pyflowline(aEdge) pFlowline1.iStream_order = iStream_order diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index b544014..5a6a5c8 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -1131,13 +1131,14 @@ def basin_calculate_flowline_length(self, aFlowline_in): Returns: float: The total length of all flowlines """ - dLength = 0.0 - nflowline = len(aFlowline_in) - for i in range(nflowline): - pFlowline= aFlowline_in[i] - pFlowline.calculate_length() - dLength = dLength + pFlowline.dLength - return dLength + #dLength = 0.0 + #nflowline = len(aFlowline_in) + #for i in range(nflowline): + # pFlowline= aFlowline_in[i] + # pFlowline.calculate_length() + # dLength = dLength + pFlowline.dLength + #return dLength + return sum(pFlowline.dLength for pFlowline in aFlowline_in) def basin_calculate_river_sinuosity(self): """ diff --git a/pyflowline/classes/flowline.py b/pyflowline/classes/flowline.py index 5950c22..5ded75b 100644 --- a/pyflowline/classes/flowline.py +++ b/pyflowline/classes/flowline.py @@ -105,17 +105,19 @@ def calculate_length(self): Returns: float: The length of the flowline """ - dLength =0.0 + #dLength =0.0 #loop though - for i in range(self.nEdge): + #for i in range(self.nEdge): #for edge in self.aEdge: - self.aEdge[i].calculate_length() - dLength = dLength + self.aEdge[i].dLength + # self.aEdge[i].calculate_length() + # dLength = dLength + self.aEdge[i].dLength #assing - self.dLength= dLength + #self.dLength= dLength - return dLength + + self.dLength = sum(edge.dLength for edge in self.aEdge) + return self.dLength def calculate_flowline_bound(self): dLat_min = 90 @@ -270,7 +272,7 @@ def split_by_length(self, dDistance): aEdge=list() pFlowline_out=None for edge in self.aEdge: - edge.calculate_length() + #edge.calculate_length() if edge.dLength > dDistance: #break it aEdge0=edge.split_by_length(dDistance) diff --git a/pyflowline/formats/convert_coordinates.py b/pyflowline/formats/convert_coordinates.py index 8f7efd5..a7ab4db 100644 --- a/pyflowline/formats/convert_coordinates.py +++ b/pyflowline/formats/convert_coordinates.py @@ -189,32 +189,37 @@ def convert_gcs_coordinates_to_flowline(aCoordinates_in): npoint = len(aCoordinates_in) - aVertex=list() - for i in range(npoint): - x = aCoordinates_in[i][0] - y = aCoordinates_in[i][1] - dummy = dict() - dummy['dLongitude_degree'] = x - dummy['dLatitude_degree'] = y - pVertex = pyvertex(dummy) - aVertex.append(pVertex) + #aVertex=list() + #for i in range(npoint): + # x = aCoordinates_in[i][0] + # y = aCoordinates_in[i][1] + # dummy = dict() + # dummy['dLongitude_degree'] = x + # dummy['dLatitude_degree'] = y + # pVertex = pyvertex(dummy) + # aVertex.append(pVertex) + + #simplified using a list comprehension. + + aVertex = [pyvertex({'dLongitude_degree': x, 'dLatitude_degree': y}) for x, y in aCoordinates_in] + - aEdge=list() - for j in range(npoint-1): - if aVertex[j] == aVertex[j+1]: - print('Two vertices are the same') - pass - else: - pEdge = pyedge( aVertex[j], aVertex[j+1] ) - aEdge.append(pEdge) + #aEdge=list() + #for j in range(npoint-1): + # if aVertex[j] == aVertex[j+1]: + # print('Two vertices are the same') + # pass + # else: + # pEdge = pyedge( aVertex[j], aVertex[j+1] ) + # aEdge.append(pEdge) + + aEdge = [pyedge(aVertex[j], aVertex[j+1]) for j in range(npoint - 1) if aVertex[j] != aVertex[j+1]] if len(aEdge) == 0: print('No edge is created') - pFlowline = None - pass - else: - pFlowline = pyflowline( aEdge) - return pFlowline + return None + + return pyflowline(aEdge) def convert_pcs_coordinates_to_flowline(aCoordinates_in, pSpatial_reference_in): npoint = len(aCoordinates_in) diff --git a/pyflowline/formats/convert_flowline_to_geojson.py b/pyflowline/formats/convert_flowline_to_geojson.py index ec7802d..f7e81bf 100644 --- a/pyflowline/formats/convert_flowline_to_geojson.py +++ b/pyflowline/formats/convert_flowline_to_geojson.py @@ -25,11 +25,7 @@ def convert_flowline_to_geojson(iFlag_type_in, sFilename_geojson_in, sFilename_g aFlowline_basin, pSpatial_reference = read_flowline_geojson( sFilename_geojson_in ) #convert it - - iFlag_projected = 0 - #pSpatial_reference_gcs = osr.SpatialReference() - #pSpatial_reference_gcs.ImportFromEPSG(4326) - #pSpatial_reference_gcs.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) + iFlag_projected = 0 export_flowline_to_geojson(aFlowline_basin, sFilename_geojson_out) else: if iFlag_type_in == 2: diff --git a/pyflowline/formats/export_flowline.py b/pyflowline/formats/export_flowline.py index f73f562..5c99293 100644 --- a/pyflowline/formats/export_flowline.py +++ b/pyflowline/formats/export_flowline.py @@ -15,13 +15,12 @@ def export_flowline_to_geojson( aFlowline_in, """ - convert a shpefile to json format. + convert a flowlist object list to json format. This function should be used for stream flowline only. """ if os.path.exists(sFilename_json_in): os.remove(sFilename_json_in) - pass nFlowline = len(aFlowline_in) if iFlag_projected_in is None: @@ -35,83 +34,102 @@ def export_flowline_to_geojson( aFlowline_in, else: pass - if aAttribute_field is not None and aAttribute_data is not None and aAttribute_dtype is not None: - iFlag_attribute = 1 + iFlag_attribute = int(all([aAttribute_field, aAttribute_data, aAttribute_dtype])) - nAttribute1 = len(aAttribute_field) - nAttribute2 = len(aAttribute_data) - nAttribute3 = len(aAttribute_dtype) - nAttribute4 = len(aAttribute_data[0]) - if nAttribute3 != nAttribute1 or nAttribute1 != nAttribute2 or nFlowline!= nAttribute4: + + #if aAttribute_field is not None and aAttribute_data is not None and aAttribute_dtype is not None: + # iFlag_attribute = 1 + # nAttribute1 = len(aAttribute_field) + # nAttribute2 = len(aAttribute_data) + # nAttribute3 = len(aAttribute_dtype) + # nAttribute4 = len(aAttribute_data[0]) + # if nAttribute3 != nAttribute1 or nAttribute1 != nAttribute2 or nFlowline!= nAttribute4: + # print('The attribute is not correct, please check!') + # return + # else: + # iFlag_attribute = 1 + #else: + # iFlag_attribute=0 + # pass + + if iFlag_attribute: + nAttribute1, nAttribute2, nAttribute3, nAttribute4 = map(len, [aAttribute_field, aAttribute_data, aAttribute_dtype, aAttribute_data[0]]) + if not nAttribute1 == nAttribute2 == nAttribute3 == nFlowline == nAttribute4: print('The attribute is not correct, please check!') return - else: - iFlag_attribute = 1 - else: - iFlag_attribute=0 - pass - pDriver_json = ogr.GetDriverByName('GeoJSON') - - pDataset_json = pDriver_json.CreateDataSource(sFilename_json_in) - - + pDriver_json = ogr.GetDriverByName('GeoJSON') + pDataset_json = pDriver_json.CreateDataSource(sFilename_json_in) pLayer_json = pDataset_json.CreateLayer('flowline', pSpatial_reference_in, ogr.wkbLineString) # Add one attribute pLayer_json.CreateField(ogr.FieldDefn('lineid', ogr.OFTInteger64)) #long type for high resolution #add the other fields - if iFlag_attribute ==1: - for i in range(nAttribute1): - sField = aAttribute_field[i] - dtype = aAttribute_dtype[i] - if dtype == 'int': - pLayer_json.CreateField(ogr.FieldDefn(sField, ogr.OFTInteger64)) - pass - else: - pLayer_json.CreateField(ogr.FieldDefn(sField, ogr.OFTReal)) - pass + #if iFlag_attribute ==1: + # for i in range(nAttribute1): + # sField = aAttribute_field[i] + # dtype = aAttribute_dtype[i] + # if dtype == 'int': + # pLayer_json.CreateField(ogr.FieldDefn(sField, ogr.OFTInteger64)) + # pass + # else: + # pLayer_json.CreateField(ogr.FieldDefn(sField, ogr.OFTReal)) + # pass + + dtype_to_ogr = {'int': ogr.OFTInteger64, 'float': ogr.OFTReal} + if iFlag_attribute: + for field, dtype in zip(aAttribute_field, aAttribute_dtype): + pLayer_json.CreateField(ogr.FieldDefn(field, dtype_to_ogr[dtype])) pLayerDefn = pLayer_json.GetLayerDefn() pFeature_out = ogr.Feature(pLayerDefn) - lID = 0 - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - dummy =pFlowline.aVertex + #lID = 0 + flag_to_attr = {1: ('dx', 'dy'), 0: ('dLongitude_degree', 'dLatitude_degree')} + for lID in range(nFlowline): + pFlowline = aFlowline_in[lID] + #dummy =pFlowline.aVertex #replace shapely with gdal function #aPoint=list() pLine = ogr.Geometry(ogr.wkbLineString) - for j in dummy: - if iFlag_projected_in ==1: - #aPoint.append( Point( j.dx, j.dy ) ) - pLine.AddPoint(j.dx, j.dy) - pass - else: - #aPoint.append( Point( j.dLongitude_degree, j.dLatitude_degree ) ) - pLine.AddPoint(j.dLongitude_degree, j.dLatitude_degree) - pass + #for j in dummy: + # if iFlag_projected_in ==1: + # #aPoint.append( Point( j.dx, j.dy ) ) + # pLine.AddPoint(j.dx, j.dy) + # pass + # else: + # #aPoint.append( Point( j.dLongitude_degree, j.dLatitude_degree ) ) + # pLine.AddPoint(j.dLongitude_degree, j.dLatitude_degree) + # pass + + for vertex in pFlowline.aVertex: + pLine.AddPoint(*(getattr(vertex, attr) for attr in flag_to_attr[iFlag_projected_in])) + #dummy1= LineString( aPoint ) pGeometry_out = ogr.CreateGeometryFromWkb(pLine.ExportToWkb()) - pFeature_out.SetGeometry(pGeometry_out) - + pFeature_out.SetGeometry(pGeometry_out) pFeature_out.SetField("lineid", lID) - if iFlag_attribute == 1: - for k in range(nAttribute1): - sField = aAttribute_field[k] - dtype = aAttribute_dtype[k] - dummy = aAttribute_data[k] - if dtype == 'int': - pFeature_out.SetField(sField, int(dummy[i])) - else: - pFeature_out.SetField(sField, float(dummy[i])) + #if iFlag_attribute == 1: + # for k in range(nAttribute1): + # sField = aAttribute_field[k] + # dtype = aAttribute_dtype[k] + # dummy = aAttribute_data[k] + # if dtype == 'int': + # pFeature_out.SetField(sField, int(dummy[i])) + # else: + # pFeature_out.SetField(sField, float(dummy[i])) + + + if iFlag_attribute: + for field, dtype, data in zip(aAttribute_field, aAttribute_dtype, aAttribute_data): + pFeature_out.SetField(field, dtype_to_ogr[dtype](data[lID])) # Add new pFeature_shapefile to output Layer pLayer_json.CreateFeature(pFeature_out) - lID = lID + 1 + pass pDataset_json.FlushCache() diff --git a/pyflowline/formats/export_vertex.py b/pyflowline/formats/export_vertex.py index 4bb7099..e6bb927 100644 --- a/pyflowline/formats/export_vertex.py +++ b/pyflowline/formats/export_vertex.py @@ -1,6 +1,6 @@ import os from osgeo import ogr, osr -#from shapely.geometry import Point + def export_vertex_to_geojson(aVertex_in, sFilename_json_in, @@ -22,26 +22,18 @@ def export_vertex_to_geojson(aVertex_in, if os.path.exists(sFilename_json_in): os.remove(sFilename_json_in) - pass - - if iFlag_projected_in is None: - iFlag_projected_in = 0 - else: - iFlag_projected_in = 1 + + iFlag_projected_in = 0 if iFlag_projected_in is None else 1 if pSpatial_reference_in is None: pSpatial_reference_in = osr.SpatialReference() pSpatial_reference_in.ImportFromEPSG(4326) # WGS84 lat/lon - else: - pass - if aAttribute_data is not None: - aAttribute= aAttribute_data - iFlag_attribute =1 - else: - iFlag_attribute=0 - nVertex = len(aVertex_in) + iFlag_attribute = 1 if aAttribute_data is not None else 0 + aAttribute = aAttribute_data if aAttribute_data is not None else [] + + #nVertex = len(aVertex_in) pDriver = ogr.GetDriverByName('GeoJSON') pDataset_json = pDriver.CreateDataSource(sFilename_json_in) pLayer_json = pDataset_json.CreateLayer('vertex', pSpatial_reference_in, ogr.wkbPoint) @@ -53,29 +45,41 @@ def export_vertex_to_geojson(aVertex_in, pLayerDefn = pLayer_json.GetLayerDefn() pFeature_out = ogr.Feature(pLayerDefn) - lID = 0 - for i in range(nVertex): - pVertex = aVertex_in[i] + #lID = 0 + #for i in range(nVertex): + # pVertex = aVertex_in[i] + # pPoint = ogr.Geometry(ogr.wkbPoint) + # if iFlag_projected_in ==1: + # pPoint.AddPoint(pVertex.dx, pVertex.dy) + # pass + # else: + # pPoint.AddPoint(pVertex.dLongitude_degree, pVertex.dLatitude_degree) + # pass + # pGeometry_out = ogr.CreateGeometryFromWkb(pPoint.ExportToWkb()) + # pFeature_out.SetGeometry(pGeometry_out) + # pFeature_out.SetField("pointid", lID) + # if iFlag_attribute ==1: + # pFeature_out.SetField("connectivity", int(aAttribute[i]) ) + # + # pLayer_json.CreateFeature(pFeature_out) + # lID = lID + 1 + # pass + + for lID, pVertex in enumerate(aVertex_in): pPoint = ogr.Geometry(ogr.wkbPoint) - if iFlag_projected_in ==1: - #dummy1= Point( pVertex.dx, pVertex.dy ) + if iFlag_projected_in == 1: pPoint.AddPoint(pVertex.dx, pVertex.dy) - pass else: - #dummy1= Point( pVertex.dLongitude_degree, pVertex.dLatitude_degree ) pPoint.AddPoint(pVertex.dLongitude_degree, pVertex.dLatitude_degree) - pass - pGeometry_out = ogr.CreateGeometryFromWkb(pPoint.ExportToWkb()) pFeature_out.SetGeometry(pGeometry_out) pFeature_out.SetField("pointid", lID) - if iFlag_attribute ==1: - pFeature_out.SetField("connectivity", int(aAttribute[i]) ) - - pLayer_json.CreateFeature(pFeature_out) - lID = lID + 1 - pass + + if iFlag_attribute == 1: + pFeature_out.SetField("connectivity", int(aAttribute[lID])) + + pLayer_json.CreateFeature(pFeature_out) pDataset_json.FlushCache() pDataset_json = pLayer_json = pFeature_out = None diff --git a/pyflowline/formats/read_flowline.py b/pyflowline/formats/read_flowline.py index a182eaa..8405847 100644 --- a/pyflowline/formats/read_flowline.py +++ b/pyflowline/formats/read_flowline.py @@ -207,7 +207,7 @@ def read_flowline_geojson(sFilename_geojson_in): if iFlag_id ==1: lFlowlineID = pFeature_geojson.GetField("lineid") else: - lFlowlineID = -1 + pass if iFlag_NHDPlusID ==1: lNHDPlusID = pFeature_geojson.GetField("NHDPlusID") @@ -217,32 +217,21 @@ def read_flowline_geojson(sFilename_geojson_in): if(sGeometry_type == 'MULTILINESTRING'): nLine = pGeometry_in.GetGeometryCount() for i in range(nLine): - Line = pGeometry_in.GetGeometryRef(i) - aCoords = list() - for i in range(0, Line.GetPointCount()): - pt = Line.GetPoint(i) - aCoords.append( [ pt[0], pt[1]]) - pass - - dummy1= np.array(aCoords) - pFlowline = convert_gcs_coordinates_to_flowline(dummy1) + Line = pGeometry_in.GetGeometryRef(i) + aCoords = [[pt[0], pt[1]] for pt in Line.GetPoints()] + pFlowline = convert_gcs_coordinates_to_flowline(np.array(aCoords)) if pFlowline is not None: pFlowline.lFlowlineIndex = lFlowlineIndex pFlowline.lFlowlineID = lFlowlineID pFlowline.lNHDPlusID= lNHDPlusID aFlowline.append(pFlowline) lFlowlineIndex = lFlowlineIndex + 1 + lFlowlineID = lFlowlineID + 1 #careful else: - if sGeometry_type =='LINESTRING': - aCoords = list() - for i in range(0, pGeometry_in.GetPointCount()): - pt = pGeometry_in.GetPoint(i) - aCoords.append( [ pt[0], pt[1]]) - pass - - dummy1= np.array(aCoords) - pFlowline = convert_gcs_coordinates_to_flowline(dummy1) + if sGeometry_type =='LINESTRING': + aCoords = [[pt[0], pt[1]] for pt in pGeometry_in.GetPoints()] + pFlowline = convert_gcs_coordinates_to_flowline(np.array(aCoords)) if pFlowline is not None: pFlowline.lFlowlineIndex = lFlowlineIndex pFlowline.iStream_segment = iStream_segment @@ -250,7 +239,8 @@ def read_flowline_geojson(sFilename_geojson_in): pFlowline.lFlowlineID = lFlowlineID pFlowline.lNHDPlusID = lNHDPlusID aFlowline.append(pFlowline) - lFlowlineIndex = lFlowlineIndex + 1 + lFlowlineIndex = lFlowlineIndex + 1 + lFlowlineID = lFlowlineID + 1 #careful else: print(sGeometry_type) pass From f4daf7904354f5d3c1776bb86aeea976ce85b2c9 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 27 Feb 2024 17:50:49 -0800 Subject: [PATCH 07/15] performance improvement --- .../algorithms/index/define_stream_order.py | 112 ++++++++++-------- .../index/define_stream_segment_index.py | 29 +++-- .../index/define_stream_topology.py | 65 ++++++---- pyflowline/algorithms/merge/merge_flowline.py | 60 ++++++---- .../split/split_flowline_to_edge.py | 34 +++--- pyflowline/classes/basin.py | 49 ++++++-- 6 files changed, 216 insertions(+), 133 deletions(-) diff --git a/pyflowline/algorithms/index/define_stream_order.py b/pyflowline/algorithms/index/define_stream_order.py index acb755a..e16576d 100644 --- a/pyflowline/algorithms/index/define_stream_order.py +++ b/pyflowline/algorithms/index/define_stream_order.py @@ -55,17 +55,23 @@ def define_stream_order(aFlowline_in, aConfluence_in): aFlag_confluence_treated = np.full(nConfleunce, 0, dtype=int) #build rtree for confluence index_confluence = RTree( max_cap=5, min_cap=2) - for i in range(nConfleunce): - lID = i - pVertex_confluence = aConfluence_in[i].pVertex_confluence - x = pVertex_confluence.dLongitude_degree - y = pVertex_confluence.dLatitude_degree - left = x - 1E-5 - right = x + 1E-5 - bottom = y - 1E-5 - top = y + 1E-5 - pBound= (left, bottom, right, top) - index_confluence.insert(lID, pBound) # + #for i in range(nConfleunce): + # lID = i + # pVertex_confluence = aConfluence_in[i].pVertex_confluence + # x = pVertex_confluence.dLongitude_degree + # y = pVertex_confluence.dLatitude_degree + # left = x - 1E-5 + # right = x + 1E-5 + # bottom = y - 1E-5 + # top = y + 1E-5 + # pBound= (left, bottom, right, top) + # index_confluence.insert(lID, pBound) # + + for i, confluence in enumerate(aConfluence_in): + pVertex_confluence = confluence.pVertex_confluence + x, y = pVertex_confluence.dLongitude_degree, pVertex_confluence.dLatitude_degree + pBound = (x - 1E-5, y - 1E-5, x + 1E-5, y + 1E-5) + index_confluence.insert(i, pBound) while aFlowline_in[0].iStream_order < 0: @@ -77,43 +83,51 @@ def define_stream_order(aFlowline_in, aConfluence_in): aFlowline_upstream = pConfluence.aFlowline_upstream pFlowline_downstream = pConfluence.pFlowline_downstream iStream_segment = pFlowline_downstream.iStream_segment - iFlag_upstream_done = 1 - nUpstream = len(aFlowline_upstream) - aStrord = list() - for j in range(nUpstream): - pFlowline_upstream = aFlowline_upstream[j] - iStream_order_upstream = pFlowline_upstream.iStream_order - if iStream_order_upstream < 1: - iFlag_upstream_done = 0 - break - else: - aStrord.append( iStream_order_upstream ) - pass - - if iFlag_upstream_done == 1: + #iFlag_upstream_done = 1 + #nUpstream = len(aFlowline_upstream) + aStrord = [upstream.iStream_order for upstream in aFlowline_upstream if upstream.iStream_order >= 1] + + #aStrord = list() + #for j in range(nUpstream): + # pFlowline_upstream = aFlowline_upstream[j] + # iStream_order_upstream = pFlowline_upstream.iStream_order + # if iStream_order_upstream < 1: + # iFlag_upstream_done = 0 + # break + # else: + # aStrord.append( iStream_order_upstream ) + + #if iFlag_upstream_done == 1: + if len(aStrord) == len(aFlowline_upstream): aFlag_confluence_treated[i] = 1 #now we can process the downstream #get unique value - dummy = np.array(aStrord) - dummy1 = np.unique(dummy) - if len(dummy1) == 1: #all upstreams have the same order - iStream_order = aStrord[0] + 1 - else: - iStream_order = np.max(dummy) - pass - + iStream_order = max(aStrord) if len(set(aStrord)) > 1 else aStrord[0] + 1 + #dummy = np.array(aStrord) + #dummy1 = np.unique(dummy) + #if len(dummy1) == 1: #all upstreams have the same order + # iStream_order = aStrord[0] + 1 + #else: + # iStream_order = np.max(dummy) + #update pFlowline_downstream.iStream_order = iStream_order aFlowline_in[nSegment-iStream_segment].iStream_order = iStream_order #update confluence - x = pFlowline_downstream.pVertex_end.dLongitude_degree - y = pFlowline_downstream.pVertex_end.dLatitude_degree - left = x - 1E-5 - right = x + 1E-5 - bottom = y - 1E-5 - top = y + 1E-5 - pBound= (left, bottom, right, top) + #x = pFlowline_downstream.pVertex_end.dLongitude_degree + #y = pFlowline_downstream.pVertex_end.dLatitude_degree + #left = x - 1E-5 + #right = x + 1E-5 + #bottom = y - 1E-5 + #top = y + 1E-5 + #pBound= (left, bottom, right, top) + #aIntersect = list(index_confluence.search(pBound)) + + #update confluence + x, y = pFlowline_downstream.pVertex_end.dLongitude_degree, pFlowline_downstream.pVertex_end.dLatitude_degree + pBound = (x - 1E-5, y - 1E-5, x + 1E-5, y + 1E-5) aIntersect = list(index_confluence.search(pBound)) + for k in aIntersect: pConfluence2 = aConfluence_in[k] if pConfluence2.pVertex_confluence == pFlowline_downstream.pVertex_end: @@ -124,15 +138,17 @@ def define_stream_order(aFlowline_in, aConfluence_in): pass - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - pFlowline.iStream_order = aFlowline_in[i].iStream_order - aFlowline_out.append(pFlowline) - aStream_order[i] = pFlowline.iStream_order + #for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # pFlowline.iStream_order = aFlowline_in[i].iStream_order + # aFlowline_out.append(pFlowline) + # aStream_order[i] = pFlowline.iStream_order + for i, flowline in enumerate(aFlowline_in): + aFlowline_out.append(flowline) + aStream_order[i] = flowline.iStream_order - pass - else: #the old method, not computationally efficient enough - + + else: #the old method, not computationally efficient enough for i in range(nFlowline): pFlowline = aFlowline_in[i] pVertex_start=pFlowline.pVertex_start diff --git a/pyflowline/algorithms/index/define_stream_segment_index.py b/pyflowline/algorithms/index/define_stream_segment_index.py index 59adc58..994bb73 100644 --- a/pyflowline/algorithms/index/define_stream_segment_index.py +++ b/pyflowline/algorithms/index/define_stream_segment_index.py @@ -9,16 +9,25 @@ def define_stream_segment_index(aFlowline_in): _type_: _description_ """ nFlowline = len(aFlowline_in) - aFlowline_out = list() - aStream_segment = list() + #aFlowline_out = list() + #aStream_segment = list() + #if nFlowline == 0 : + # print ('data incomplete') + #else: + # for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # pFlowline.iStream_segment = nFlowline - i + # aStream_segment.append(pFlowline.iStream_segment) + # aFlowline_out.append(pFlowline) + # pass + if nFlowline == 0 : print ('data incomplete') - else: - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - pFlowline.iStream_segment = nFlowline - i - aStream_segment.append(pFlowline.iStream_segment) - aFlowline_out.append(pFlowline) + return [], [] + + for i, pFlowline in enumerate(aFlowline_in, start=1): + pFlowline.iStream_segment = nFlowline - i + 1 - pass - return aFlowline_out, aStream_segment \ No newline at end of file + aStream_segment = [pFlowline.iStream_segment for pFlowline in aFlowline_in] + #return aFlowline_out, aStream_segment + return aFlowline_in, aStream_segment \ No newline at end of file diff --git a/pyflowline/algorithms/index/define_stream_topology.py b/pyflowline/algorithms/index/define_stream_topology.py index 3fc6c90..7f5bad2 100644 --- a/pyflowline/algorithms/index/define_stream_topology.py +++ b/pyflowline/algorithms/index/define_stream_topology.py @@ -9,30 +9,49 @@ def define_stream_topology(aFlowline_in, aConfluence_in): _type_: _description_ """ nFlowline = len(aFlowline_in) - aFlowline_out = list() - nConfluence = len(aConfluence_in) + #aFlowline_out = list() + #nConfluence = len(aConfluence_in) + #if nFlowline == 0 : + # print ('data incomplete') + #else: + # for i in range(nConfluence): + # pConfluence = aConfluence_in[i] + # aFlowline_upstream = pConfluence.aFlowline_upstream + # pFlowline_downstream = pConfluence.pFlowline_downstream + # iStream_segment_downstream = pFlowline_downstream.iStream_segment + # lFlowline_index_downstream = nFlowline - iStream_segment_downstream + # aFlowline_in[lFlowline_index_downstream].aFlowline_upstream = list() + # #process upstream + # nUpstream = len(aFlowline_upstream) + # for j in range(nUpstream): + # pFlowline_upstream = aFlowline_upstream[j] + # iStream_segment_upstream = pFlowline_upstream.iStream_segment + # #index are flipped + # lFlowline_index_upstream = nFlowline - iStream_segment_upstream + # aFlowline_in[lFlowline_index_upstream].lFlowline_downstream = lFlowline_index_downstream + # aFlowline_in[lFlowline_index_downstream].aFlowline_upstream.append(iStream_segment_upstream) + # pass + # pass + + #aFlowline_out = aFlowline_in if nFlowline == 0 : print ('data incomplete') - else: - for i in range(nConfluence): - pConfluence = aConfluence_in[i] - aFlowline_upstream = pConfluence.aFlowline_upstream - pFlowline_downstream = pConfluence.pFlowline_downstream - iStream_segment_downstream = pFlowline_downstream.iStream_segment - lFlowline_index_downstream = nFlowline - iStream_segment_downstream - aFlowline_in[lFlowline_index_downstream].aFlowline_upstream = list() - #process upstream - nUpstream = len(aFlowline_upstream) - for j in range(nUpstream): - pFlowline_upstream = aFlowline_upstream[j] - iStream_segment_upstream = pFlowline_upstream.iStream_segment - #index are flipped - lFlowline_index_upstream = nFlowline - iStream_segment_upstream - aFlowline_in[lFlowline_index_upstream].lFlowline_downstream = lFlowline_index_downstream - aFlowline_in[lFlowline_index_downstream].aFlowline_upstream.append(iStream_segment_upstream) - pass - pass + return [] + + for pConfluence in aConfluence_in: + aFlowline_upstream = pConfluence.aFlowline_upstream + pFlowline_downstream = pConfluence.pFlowline_downstream + iStream_segment_downstream = pFlowline_downstream.iStream_segment + lFlowline_index_downstream = nFlowline - iStream_segment_downstream + aFlowline_in[lFlowline_index_downstream].aFlowline_upstream = [] + + #process upstream + for pFlowline_upstream in aFlowline_upstream: + iStream_segment_upstream = pFlowline_upstream.iStream_segment + lFlowline_index_upstream = nFlowline - iStream_segment_upstream + aFlowline_in[lFlowline_index_upstream].lFlowline_downstream = lFlowline_index_downstream + aFlowline_in[lFlowline_index_downstream].aFlowline_upstream.append(iStream_segment_upstream) - aFlowline_out = aFlowline_in + return aFlowline_in - return aFlowline_out \ No newline at end of file + #return aFlowline_out \ No newline at end of file diff --git a/pyflowline/algorithms/merge/merge_flowline.py b/pyflowline/algorithms/merge/merge_flowline.py index 85776f2..5a78982 100644 --- a/pyflowline/algorithms/merge/merge_flowline.py +++ b/pyflowline/algorithms/merge/merge_flowline.py @@ -39,22 +39,26 @@ def merge_flowline(aFlowline_in, if aIndex_middle.size == 0: return aFlowline_in - aVertex_headwater=aVertex[aIndex_headwater] - aVertex_middle=aVertex[aIndex_middle] + #aVertex_headwater=aVertex[aIndex_headwater] + #aVertex_middle=aVertex[aIndex_middle] + #if aIndex_middle.size == 0: + # return aFlowline_in #convert to set aVertex_headwater_set = set(aVertex[aIndex_headwater]) aVertex_middle_set = set(aVertex[aIndex_middle]) + if aVertex_middle_set.size == 0: + return aFlowline_in if aIndex_confluence.size > 0: iFlag_confluence = 1 - aVertex_confluence=aVertex[aIndex_confluence] + #aVertex_confluence=aVertex[aIndex_confluence] aVertex_confluence_set = set(aVertex[aIndex_confluence]) else: iFlag_confluence = 0 pass - def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): + def merge_flowline_reach(lIndex_in, pVertex_start_in): global lID pFlowline = aFlowline_in[lIndex_in] iSegment = pFlowline.iStream_segment @@ -94,27 +98,38 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): pVertex_start = pFlowline3.pVertex_start pVertex_end = pFlowline3.pVertex_end if pVertex_end == pVertex_current: - merge_flowline_reach(k, pVertex_start, pVertex_end) + merge_flowline_reach(k, pVertex_start) #find outlet - iFlag_first=1 + #iFlag_first=1 + #for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # pVertex_start = pFlowline.pVertex_start + # pVertex_end = pFlowline.pVertex_end + # dDiatance = pVertex_end.calculate_distance( pVertex_outlet_in) + # if iFlag_first ==1: + # dDiatance_min = dDiatance + # lIndex_outlet = i + # iFlag_first=0 + # else: + # if dDiatance < dDiatance_min: + # dDiatance_min = dDiatance + # lIndex_outlet = i + # pass + # else: + # pass + #find outlet + dDiatance_min = float('inf') for i in range(nFlowline): pFlowline = aFlowline_in[i] - pVertex_start = pFlowline.pVertex_start pVertex_end = pFlowline.pVertex_end - dDiatance = pVertex_end.calculate_distance( pVertex_outlet_in) - if iFlag_first ==1: - dDiatance_min = dDiatance - lIndex_outlet = i - iFlag_first=0 - else: - if dDiatance < dDiatance_min: - dDiatance_min = dDiatance - lIndex_outlet = i - pass - else: - pass + dDiatance = pVertex_end.calculate_distance(pVertex_outlet_in) + if dDiatance < dDiatance_min: + dDiatance_min = dDiatance + lIndex_outlet = i + + pFlowline = aFlowline_in[lIndex_outlet] pVertex_start = pFlowline.pVertex_start @@ -129,13 +144,12 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in, pVertex_end_in): pFlowline = aFlowline_in[i] pVertex_start_dummy = pFlowline.pVertex_start pVertex_end_dummy = pFlowline.pVertex_end - if pVertex_end == pVertex_end_dummy: #this is - merge_flowline_reach(i, pVertex_start_dummy, pVertex_end_dummy) + merge_flowline_reach(i, pVertex_start_dummy) pass else: - merge_flowline_reach(lIndex_outlet, pVertex_start, pVertex_end) + merge_flowline_reach(lIndex_outlet, pVertex_start) else: - merge_flowline_reach(lIndex_outlet, pVertex_start, pVertex_end) + merge_flowline_reach(lIndex_outlet, pVertex_start) return aFlowline_out diff --git a/pyflowline/algorithms/split/split_flowline_to_edge.py b/pyflowline/algorithms/split/split_flowline_to_edge.py index bd570f7..48dc13b 100644 --- a/pyflowline/algorithms/split/split_flowline_to_edge.py +++ b/pyflowline/algorithms/split/split_flowline_to_edge.py @@ -2,21 +2,23 @@ def split_flowline_to_edge(aFlowline_in): aFlowline_out = list() aEdge_out=list() - nFlowline = len(aFlowline_in) - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - iStream_order = pFlowline.iStream_order - nVertex = pFlowline.nVertex - nEdge = pFlowline.nEdge - iPart = 0 - for j in range(nEdge): - pEdge = pFlowline.aEdge[j] - aEdge = list() - aEdge.append(pEdge) - aEdge_out.append(pEdge) - pFlowline1 = pyflowline(aEdge) - aFlowline_out.append(pFlowline1) - pass - pass + #nFlowline = len(aFlowline_in) + #for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # nEdge = pFlowline.nEdge + # for j in range(nEdge): + # pEdge = pFlowline.aEdge[j] + # aEdge = list() + # aEdge.append(pEdge) + # aEdge_out.append(pEdge) + # pFlowline1 = pyflowline(aEdge) + # aFlowline_out.append(pFlowline1) + # pass + # pass + for pFlowline in aFlowline_in: + for pEdge in pFlowline.aEdge: + aEdge_out.append(pEdge) + aFlowline_out.append(pyflowline([pEdge])) + return aFlowline_out, aEdge_out diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 5a6a5c8..5ab73a4 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -895,21 +895,44 @@ def basin_build_confluence(self, aFlowline_basin_in, aVertex_confluence_in): list [pyconfluence]: A list of confluences in this basin """ #this can only be calculated for confluence - aConfluence_basin=list() - for pVertex in aVertex_confluence_in: - aFlowline_upstream =list() - for pFlowline in aFlowline_basin_in: - pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end - if pVertex_end == pVertex: - aFlowline_upstream.append(pFlowline) - pass - if pVertex_start == pVertex: - pFlowline_downstream=pFlowline - + # Create a dictionary to map each vertex to its upstream and downstream flowlines + vertex_to_flowlines = {} + for pFlowline in aFlowline_basin_in: + pVertex_start = pFlowline.pVertex_start + pVertex_end = pFlowline.pVertex_end + + if pVertex_end not in vertex_to_flowlines: + vertex_to_flowlines[pVertex_end] = {'upstream': [], 'downstream': None} + vertex_to_flowlines[pVertex_end]['upstream'].append(pFlowline) + + if pVertex_start not in vertex_to_flowlines: + vertex_to_flowlines[pVertex_start] = {'upstream': [], 'downstream': None} + vertex_to_flowlines[pVertex_start]['downstream'] = pFlowline + + # Build the confluence for each vertex + aConfluence_basin = [] + for pVertex in aVertex_confluence_in: + aFlowline_upstream = vertex_to_flowlines[pVertex]['upstream'] + pFlowline_downstream = vertex_to_flowlines[pVertex]['downstream'] pConfluence = pyconfluence(pVertex, aFlowline_upstream, pFlowline_downstream) - aConfluence_basin.append(pConfluence) + aConfluence_basin.append(pConfluence) + + #aConfluence_basin=list() + #for pVertex in aVertex_confluence_in: + # aFlowline_upstream =list() + # for pFlowline in aFlowline_basin_in: + # pVertex_start = pFlowline.pVertex_start + # pVertex_end = pFlowline.pVertex_end + # if pVertex_end == pVertex: + # aFlowline_upstream.append(pFlowline) + # pass + # if pVertex_start == pVertex: + # pFlowline_downstream=pFlowline + # pConfluence = pyconfluence(pVertex, aFlowline_upstream, pFlowline_downstream) + # aConfluence_basin.append(pConfluence) + return aConfluence_basin + def basin_analyze(self): """ From 4ad153e49c92a5dd5eb7c578f408252a1a372efe Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 27 Feb 2024 20:58:37 -0800 Subject: [PATCH 08/15] correction direction speedup --- .../direction/correct_flowline_direction.py | 41 +++++++------------ .../index/define_stream_segment_index.py | 2 +- pyflowline/classes/basin.py | 2 + 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index 69e38ee..6a03ae2 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -1,7 +1,7 @@ import sys -sys.setrecursionlimit(10000) import numpy as np from pyflowline.algorithms.auxiliary.check_head_water import check_head_water +sys.setrecursionlimit(100000) lFlowlineIndex=0 def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): """_summary_ This function should expect the flowline may not be ordered, so the stream order info is not available. @@ -20,28 +20,16 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): global lFlowlineIndex nFlowline = len(aFlowline_in) # Create sets for faster lookup - pVertex_start_in_set = {flowline.pVertex_start for flowline in aFlowline_in} - pVertex_end_in_set = {flowline.pVertex_end for flowline in aFlowline_in} - - aFlag_process=np.full(nFlowline, 0, dtype =int) - iFlag_first = 1 - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - iFlag_dam = pFlowline.iFlag_dam - iStream_order = pFlowline.iStream_order - pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end - if iFlag_first == 1: - dDiatance_min = pVertex_end.calculate_distance( pVertex_outlet_in ) - lIndex_outlet = i - iFlag_first=0 - else: - dDiatance = pFlowline.pVertex_end.calculate_distance(pVertex_outlet_in) - if dDiatance < dDiatance_min: - dDiatance_min = dDiatance - #found it - lIndex_outlet = i - + pVertex_start_in_set = {flowline.pVertex_start for flowline in aFlowline_in} + aFlag_process=np.full(nFlowline, 0, dtype =int) + dDiatance_min = float('inf') + for i in range(nFlowline): + pFlowline = aFlowline_in[i] + pVertex_end = pFlowline.pVertex_end + dDiatance = pVertex_end.calculate_distance(pVertex_outlet_in) + if dDiatance < dDiatance_min: + dDiatance_min = dDiatance + lIndex_outlet = i lFlowlineIndex = 0 pFlowline = aFlowline_in[lIndex_outlet] @@ -52,7 +40,7 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): pVertex_end = pFlowline.pVertex_end lFlowlineIndex = lFlowlineIndex + 1 #we might find more than 1 upstream - def find_upstream_flowline(pVertex_start_in, pVertex_end_in): + def find_upstream_flowline( pVertex_end_in): nUpstream = 0 aUpstream=list() aReverse=list() @@ -89,9 +77,8 @@ def tag_upstream(pVertex_start_in, pVertex_end_in): if(check_head_water(aFlowline_in, pVertex_start_in)==1): pass else: - nUpstream, aUpstream, aReverse = find_upstream_flowline(pVertex_start_in, pVertex_end_in) - if nUpstream > 0: - + nUpstream, aUpstream, aReverse = find_upstream_flowline( pVertex_end_in) + if nUpstream > 0: for j in range(nUpstream): pFlowline = aFlowline_in[ aUpstream[j] ] if (aReverse[j]==1): diff --git a/pyflowline/algorithms/index/define_stream_segment_index.py b/pyflowline/algorithms/index/define_stream_segment_index.py index 994bb73..949db3e 100644 --- a/pyflowline/algorithms/index/define_stream_segment_index.py +++ b/pyflowline/algorithms/index/define_stream_segment_index.py @@ -1,4 +1,4 @@ -from pyflowline.algorithms.auxiliary.check_head_water import check_head_water +#from pyflowline.algorithms.auxiliary.check_head_water import check_head_water def define_stream_segment_index(aFlowline_in): """build stream segment index, because they are ordered from outlet to headwater, so the index is from 1 to n diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 5ab73a4..cd350dd 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -520,6 +520,7 @@ def basin_flowline_simplification(self): try: print('Basin ', self.sBasinID, 'started correction flow direction') ptimer.start() + sys.stdout.flush() nFlowline_before = len(aFlowline_basin_simplified) #this flowline is ordered from downstream to upstream aFlowline_basin_simplified = correct_flowline_direction(aFlowline_basin_simplified, pVertex_outlet ) @@ -541,6 +542,7 @@ def basin_flowline_simplification(self): try: print('Basin ', self.sBasinID, 'started loop removal') ptimer.start() + sys.stdout.flush() aFlowline_basin_simplified = remove_flowline_loop(aFlowline_basin_simplified) ptimer.stop() sys.stdout.flush() From 7e912133ee5c527f60ca024a546493b2c62d496f Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Wed, 28 Feb 2024 09:52:40 -0800 Subject: [PATCH 09/15] update the hashtable default function --- .../direction/correct_flowline_direction.py | 17 +- .../algorithms/loop/remove_flowline_loop.py | 6 +- pyflowline/classes/basin.py | 489 +++++++++--------- pyflowline/classes/vertex.py | 14 +- 4 files changed, 260 insertions(+), 266 deletions(-) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index 6a03ae2..e36b66c 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -47,8 +47,7 @@ def find_upstream_flowline( pVertex_end_in): for i in range(nFlowline): pFlowline = aFlowline_in[i] pVerter_start = pFlowline.pVertex_start - pVerter_end = pFlowline.pVertex_end - #if pVerter_end == pVertex_start_in and pVerter_start!=pVertex_end_in: + pVerter_end = pFlowline.pVertex_end if pVerter_end in pVertex_start_in_set and pVerter_start != pVertex_end_in: if aFlag_process[i] != 1: nUpstream = nUpstream + 1 @@ -56,23 +55,17 @@ def find_upstream_flowline( pVertex_end_in): aReverse.append(0) aFlag_process[i] = 1 pass - else: - #if pVerter_start == pVertex_start_in and pVerter_end !=pVertex_end_in : + else: if pVerter_start in pVertex_start_in_set and pVerter_end != pVertex_end_in: if aFlag_process[i] != 1: nUpstream = nUpstream + 1 aUpstream.append(i) aReverse.append(1) aFlag_process[i] = 1 - pass - pass - - pass - return nUpstream, aUpstream, aReverse - + + return nUpstream, aUpstream, aReverse - def tag_upstream(pVertex_start_in, pVertex_end_in): - + def tag_upstream(pVertex_start_in, pVertex_end_in): global lFlowlineIndex if(check_head_water(aFlowline_in, pVertex_start_in)==1): pass diff --git a/pyflowline/algorithms/loop/remove_flowline_loop.py b/pyflowline/algorithms/loop/remove_flowline_loop.py index 0608135..49f3852 100644 --- a/pyflowline/algorithms/loop/remove_flowline_loop.py +++ b/pyflowline/algorithms/loop/remove_flowline_loop.py @@ -27,7 +27,7 @@ def find_paralle_stream( pVertex_start_in): for j in range(nFlowline): pFlowline = aFlowline_in[j] pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end + #pVertex_end = pFlowline.pVertex_end if pVertex_start == pVertex_start_in: ndownstream= ndownstream+1 aDownstream.append(j) @@ -40,8 +40,8 @@ def find_paralle_stream( pVertex_start_in): for i in range(nFlowline): pFlowline = aFlowline_in[i] pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end - iStream_order = pFlowline.iStream_order + #pVertex_end = pFlowline.pVertex_end + #iStream_order = pFlowline.iStream_order #ndownstream , aDownstream, aStream_order = find_paralle_stream( pVertex_start) # Get all parallel streams diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index cd350dd..6245985 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -18,13 +18,6 @@ from pyflowline.formats.export_flowline import export_flowline_to_geojson from pyflowline.formats.export_vertex import export_vertex_to_geojson from pyearth.toolbox.reader.text_reader_string import text_reader_string -iFlag_cython = importlib.util.find_spec("cython") -if iFlag_cython is not None: - from pyflowline.external.tinyr.tinyr.tinyr import RTree - iFlag_use_rtree = 1 -else: - iFlag_use_rtree =0 - pass from pyflowline.algorithms.split.find_flowline_vertex import find_flowline_vertex from pyflowline.algorithms.split.find_flowline_confluence import find_flowline_confluence @@ -44,19 +37,23 @@ from pyflowline.algorithms.intersect.intersect_flowline_with_flowline import intersect_flowline_with_flowline from pyflowline.algorithms.auxiliary.calculate_area_of_difference import calculate_area_of_difference_simplified -iFlag_cython = importlib.util.find_spec("cython") +iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: + from pyflowline.algorithms.cython.kernel import find_vertex_in_list + from pyflowline.external.tinyr.tinyr.tinyr import RTree + iFlag_use_rtree = 1 else: from pyflowline.algorithms.auxiliary.find_vertex_in_list import find_vertex_in_list + iFlag_use_rtree =0 -iFlag_kml = importlib.util.find_spec("simplekml") +iFlag_kml = importlib.util.find_spec("simplekml") if iFlag_kml is not None: #from pyearth.gis.kml.convert_geojson_to_kml import convert_geojson_to_kml pass -else: - pass -sys.setrecursionlimit(10000) + + +sys.setrecursionlimit(100000) class BasinClassEncoder(JSONEncoder): """Basin class encoder @@ -72,16 +69,16 @@ def default(self, obj): if isinstance(obj, np.ndarray): return obj.tolist() if isinstance(obj, list): - pass + pass if isinstance(obj, pyvertex): - return json.loads(obj.tojson()) + return json.loads(obj.tojson()) if isinstance(obj, pyedge): - return obj.lEdgeID + return obj.lEdgeID if isinstance(obj, pyflowline): return obj.lFlowlineID if isinstance(obj, pyconfluence): return obj.dAngle_upstream - + return JSONEncoder.default(self, obj) class pybasin(object): @@ -93,7 +90,7 @@ class pybasin(object): Returns: None: A basin object """ - lBasinID =1 + lBasinID =1 sBasinID='' lCellID_outlet=-1 iFlag_debug = 0 @@ -113,9 +110,9 @@ class pybasin(object): dArea_of_difference=0.0 dDistance_displace = 0.0 - dThreshold_break_by_distance = 5000.0 + dThreshold_break_by_distance = 5000.0 sWorkspace_output_basin='' - sFilename_flowline_raw='' + sFilename_flowline_raw='' sFilename_flowline_filter='' sFilename_flowline_filter_geojson='' sFilename_dam='' @@ -129,11 +126,11 @@ class pybasin(object): sFilename_flowline_simplified_info='' sFilename_flowline_conceptual_info='' sFilename_confluence_simplified_info='' - sFilename_confluence_conceptual_info='' + sFilename_confluence_conceptual_info='' aFlowline_basin_filtered=None aFlowline_basin_simplified=None - aFlowline_basin_conceptual=None + aFlowline_basin_conceptual=None aFlowline_basin_edge = None pVertex_outlet=None aConfluence_basin_simplified= None @@ -152,7 +149,7 @@ class pybasin(object): sFilename_elevation='' sFilename_slope='' sFilename_drainage_area='' - sFilename_flow_direction ='' + sFilename_flow_direction ='' sFilename_distance_to_outlet = '' sFilename_stream_segment='' sFilename_stream_edge='' @@ -163,14 +160,14 @@ class pybasin(object): pRTree_flowline = None pRTree_edge = None - - iFlag_visual = importlib.util.find_spec("cartopy") + + iFlag_visual = importlib.util.find_spec("cartopy") if iFlag_visual is not None: from ._visual_basin import basin_plot from ._visual_basin import _plot_polyline_variable from ._visual_basin import _plot_polygon_variable - from ._visual_basin import _plot_area_of_difference + from ._visual_basin import _plot_area_of_difference else: pass @@ -182,23 +179,23 @@ def __init__(self, aParameter): aParameter (dict): Dictionary for parameters """ - if 'lBasinID' in aParameter: + if 'lBasinID' in aParameter: self.lBasinID = int(aParameter['lBasinID']) else: self.lBasinID = 1 - - - if 'lCellID_outlet' in aParameter: + + + if 'lCellID_outlet' in aParameter: self.lCellID_outlet = int(aParameter['lCellID_outlet']) else: self.lCellID_outlet = -1 - if 'iFlag_disconnected' in aParameter: + if 'iFlag_disconnected' in aParameter: self.iFlag_disconnected = int(aParameter['iFlag_disconnected']) else: self.iFlag_disconnected = 0 - if 'iFlag_remove_small_river' in aParameter: + if 'iFlag_remove_small_river' in aParameter: self.iFlag_remove_small_river = int(aParameter['iFlag_remove_small_river']) else: self.iFlag_remove_small_river = 0 @@ -207,42 +204,42 @@ def __init__(self, aParameter): self.iFlag_remove_low_order_river = int(aParameter['iFlag_remove_low_order_river']) else: self.iFlag_remove_low_order_river = 0 - - if 'iFlag_dam' in aParameter: + + if 'iFlag_dam' in aParameter: self.iFlag_dam = int(aParameter['iFlag_dam']) else: self.iFlag_dam = 0 - - if 'iFlag_debug' in aParameter: + + if 'iFlag_debug' in aParameter: self.iFlag_debug = int(aParameter['iFlag_debug']) else: self.iFlag_debug = 0 - - if 'dLongitude_outlet_degree' in aParameter: + + if 'dLongitude_outlet_degree' in aParameter: self.dLongitude_outlet_degree = float(aParameter['dLongitude_outlet_degree']) else: self.dLongitude_outlet_degree = -9999. - - if 'dLatitude_outlet_degree' in aParameter: + + if 'dLatitude_outlet_degree' in aParameter: self.dLatitude_outlet_degree = float(aParameter['dLatitude_outlet_degree']) else: self.dLatitude_outlet_degree = -9999. - - if 'dThreshold_small_river' in aParameter: + + if 'dThreshold_small_river' in aParameter: self.dThreshold_small_river = float(aParameter['dThreshold_small_river']) else: self.dThreshold_small_river = 10000.0 - if 'dAccumulation_threshold' in aParameter: + if 'dAccumulation_threshold' in aParameter: self.dAccumulation_threshold = float(aParameter['dAccumulation_threshold']) else: - self.dAccumulation_threshold = 100000.0 + self.dAccumulation_threshold = 100000.0 if 'sFilename_flowline_raw' in aParameter: self.sFilename_flowline_raw = aParameter['sFilename_flowline_raw'] else: self.sFilename_flowline_raw = '' - + if 'sFilename_flowline_filter' in aParameter: self.sFilename_flowline_filter = aParameter['sFilename_flowline_filter'] else: @@ -252,7 +249,7 @@ def __init__(self, aParameter): self.sWorkspace_output_basin = aParameter['sWorkspace_output_basin'] else: self.sWorkspace_output_basin = '.' - + Path(self.sWorkspace_output_basin).mkdir(parents=True, exist_ok=True) self.sFilename_flowline_filter_geojson = os.path.join(str(self.sWorkspace_output_basin ), "flowline_filter.geojson" ) @@ -315,7 +312,7 @@ def __init__(self, aParameter): self.sFilename_flowline_simplified_info = os.path.join(str(self.sWorkspace_output_basin ), 'flowline_simplified_info.json') self.sFilename_confluence_conceptual_info = os.path.join(str(self.sWorkspace_output_basin ),'confluence_conceptual_info.json') self.sFilename_confluence_simplified_info = os.path.join(str(self.sWorkspace_output_basin ),'confluence_simplified_info.json') - + #geojson, full path of the file #full paths are required for the following files #for hexwatershed compatibility, the geojson files will be generated by the pyhexwatershed front end @@ -326,7 +323,7 @@ def __init__(self, aParameter): self.sFilename_flowline_conceptual = os.path.join(str(self.sWorkspace_output_basin ),'flowline_conceptual.geojson') self.sFilename_flowline_edge = os.path.join(str(self.sWorkspace_output_basin ),'flowline_edge.geojson') self.sFilename_area_of_difference = os.path.join(str(self.sWorkspace_output_basin ),'area_of_difference.geojson') - + self.sFilename_elevation = os.path.join(str(self.sWorkspace_output_basin ), "elevation.geojson" ) self.sFilename_slope = os.path.join(str(self.sWorkspace_output_basin ), "slope.geojson" ) self.sFilename_drainage_area = os.path.join(str(self.sWorkspace_output_basin ), "drainage_area.geojson" ) @@ -336,11 +333,11 @@ def __init__(self, aParameter): self.sFilename_stream_segment = os.path.join(str(self.sWorkspace_output_basin ), "stream_segment.geojson" ) self.sFilename_variable_polygon = os.path.join(str(self.sWorkspace_output_basin ), "variable_polygon.geojson" ) self.sFilename_variable_polyline = os.path.join(str(self.sWorkspace_output_basin ), "variable_polyline.geojson" ) - + #kml self.sFilename_flowline_conceptual_kml = os.path.join(str(self.sWorkspace_output_basin ),'flowline_conceptual.kml') return - + def basin_flowline_simplification(self): """ Run the basin flowline simplification @@ -350,14 +347,14 @@ def basin_flowline_simplification(self): """ print('Start flowline simplification:', self.sBasinID) sWorkspace_output_basin = self.sWorkspace_output_basin - + ptimer = pytimer() - - if self.iFlag_dam == 1: + + if self.iFlag_dam == 1: sFilename_flowline_filter = self.sFilename_flowline_filter - aFlowline_basin_filtered_raw, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) + aFlowline_basin_filtered_raw, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) aVertex_filtered = find_flowline_vertex(aFlowline_basin_filtered_raw) - + ptimer.start() nFlowline_before = len(aFlowline_basin_filtered_raw) sFilename_dam = self.sFilename_dam @@ -379,7 +376,7 @@ def basin_flowline_simplification(self): for j in range(0, ndam): dLon = float(aData_dam[j][1]) dLat = float(aData_dam[j][0]) - sDam = aData_dam[j][4] + sDam = aData_dam[j][4] #individual ID lNHDPlusID = int(aData_dam[j][5]) #if lNHDPlusID in aNHDPlusID_filter: @@ -391,11 +388,11 @@ def basin_flowline_simplification(self): aFlowline_basin_filtered_raw[k].iFlag_dam =1 break pass - else: + else: aNHDPlusID_dams_headwater.append(lNHDPlusID) - #not in A, so we need to trace it down - - aNHDPlusID_dam_nonheadwater = track_nhdplus_flowline(aNHDPlusID_filter, aFromFlowline, aToFlowline, lNHDPlusID) + #not in A, so we need to trace it down + + aNHDPlusID_dam_nonheadwater = track_nhdplus_flowline(aNHDPlusID_filter, aFromFlowline, aToFlowline, lNHDPlusID) aFlowline_dam_nonheadwater = extract_nhdplus_flowline_shapefile_by_attribute(sFilename_flowline_raw, aNHDPlusID_dam_nonheadwater ) #clean up aVertex_dam_nonheadwater = find_flowline_vertex(aFlowline_dam_nonheadwater) @@ -411,35 +408,35 @@ def basin_flowline_simplification(self): pVertex_dam = aVertex_dam_nonheadwater[i] dDistance = pVertex.calculate_distance(pVertex_dam) if dDistance<= dThreshold: - aVertex_dam_nonheadwater[i] = pVertex + aVertex_dam_nonheadwater[i] = pVertex for k in range(len(aFlowline_dam_nonheadwater)): - if aFlowline_dam_nonheadwater[k].pVertex_end == pVertex_dam: - #update + if aFlowline_dam_nonheadwater[k].pVertex_end == pVertex_dam: + #update aEdge = aFlowline_dam_nonheadwater[k].aEdge aEdge[-1] = pyedge( aEdge[-1].pVertex_start, pVertex) - aFlowline_dam_nonheadwater[k] = pyflowline(aEdge) + aFlowline_dam_nonheadwater[k] = pyflowline(aEdge) - iFlag_found = 1 + iFlag_found = 1 break else: - #print(dDistance) - pass + #print(dDistance) + pass aVertex_dams_nonheadwater.append(aVertex_dam_nonheadwater) - + aFlowline_dams_nonheadwater.append(aFlowline_dam_nonheadwater) aFlowline_dams_headwater = extract_nhdplus_flowline_shapefile_by_attribute(sFilename_flowline_raw, aNHDPlusID_dams_headwater ) for i in range(len(aFlowline_dams_headwater)): aFlowline_dams_headwater[i].iFlag_dam = 1 - + aFlowline_dams_nonheadwater_all = [item for sublist in aFlowline_dams_nonheadwater for item in sublist] aVertex_dam_nonheadwater_all = [item for sublist in aVertex_dams_nonheadwater for item in sublist] - - aFlowline_basin_filtered = aFlowline_basin_filtered_raw + aFlowline_dams_headwater + aFlowline_dams_nonheadwater_all + + aFlowline_basin_filtered = aFlowline_basin_filtered_raw + aFlowline_dams_headwater + aFlowline_dams_nonheadwater_all aVertex_dam = find_flowline_vertex(aFlowline_dams_headwater) - + if self.iFlag_debug ==1: sFilename_out = 'flowline_vertex_filtered.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -449,7 +446,7 @@ def basin_flowline_simplification(self): export_vertex_to_geojson( aVertex_dam, sFilename_out) sFilename_out = 'flowline_vertex_dam_nonheadwater.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) - export_vertex_to_geojson( aVertex_dam_nonheadwater_all, sFilename_out) + export_vertex_to_geojson( aVertex_dam_nonheadwater_all, sFilename_out) nFlowline_after = len(aFlowline_basin_filtered) print('Basin ', self.sBasinID, ' has dam', nFlowline_before, nFlowline_after) @@ -457,34 +454,35 @@ def basin_flowline_simplification(self): else: print('Basin ', self.sBasinID, ' has no dam') sFilename_flowline_filter = self.sFilename_flowline_filter - aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) - #aVertex_filtered = find_flowline_vertex(aFlowline_basin_filtered) - + aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) + #aVertex_filtered = find_flowline_vertex(aFlowline_basin_filtered) + pass sys.stdout.flush() if self.iFlag_disconnected == 1: - #not used anymore + #not used anymore #aThreshold = np.full(2, 300.0, dtype=float) #aFlowline_basin_filtered = connect_disconnect_flowline(aFlowline_basin_filtered, aVertex, aThreshold) #sFilename_out = 'flowline_connect.geojson' - #sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) + #sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) #export_flowline_to_geojson(iFlag_projected, aFlowline_basin_filtered,pSpatial_reference_gcs, sFilename_out) pass - - + + if self.iFlag_debug ==1: sFilename_out = 'flowline_before_intersect.geojson' - sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) + sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) self.basin_export_flowline(aFlowline_basin_filtered, sFilename_out) #calculate length self.aFlowline_basin_filtered = aFlowline_basin_filtered self.dLength_flowline_filtered = self.basin_calculate_flowline_length(aFlowline_basin_filtered) #assign vertex id - + #simplification started print('Basin ', self.sBasinID, 'find flowline vertex') + sys.stdout.flush() ptimer.start() aVertex = find_flowline_vertex(aFlowline_basin_filtered) ptimer.stop() @@ -492,41 +490,43 @@ def basin_flowline_simplification(self): sFilename_out = 'flowline_vertex_without_confluence_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_vertex_to_geojson( aVertex, sFilename_out) - + try: print('Basin ', self.sBasinID, 'split flowline') - ptimer.start() sys.stdout.flush() + ptimer.start() + nFlowline_before = len(aFlowline_basin_filtered) aFlowline_basin_simplified = split_flowline(aFlowline_basin_filtered, aVertex) nFlowline_after = len(aFlowline_basin_simplified) ptimer.stop() except: print(nFlowline_before) - - + + if self.iFlag_debug ==1: sFilename_out = 'flowline_split_by_point_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson(aFlowline_basin_simplified, sFilename_out) - + #use location to find outlet - point= dict() + point= dict() point['dLongitude_degree'] = self.dLongitude_outlet_degree point['dLatitude_degree'] = self.dLatitude_outlet_degree pVertex_outlet=pyvertex(point) - + try: print('Basin ', self.sBasinID, 'started correction flow direction') - ptimer.start() sys.stdout.flush() - nFlowline_before = len(aFlowline_basin_simplified) - #this flowline is ordered from downstream to upstream + ptimer.start() + + nFlowline_before = len(aFlowline_basin_simplified) + #this flowline is ordered from downstream to upstream aFlowline_basin_simplified = correct_flowline_direction(aFlowline_basin_simplified, pVertex_outlet ) nFlowline_after = len(aFlowline_basin_simplified) ptimer.stop() - sys.stdout.flush() + pVertex_outlet = aFlowline_basin_simplified[0].pVertex_end self.pVertex_outlet = pVertex_outlet if self.iFlag_debug ==1: @@ -535,27 +535,28 @@ def basin_flowline_simplification(self): export_flowline_to_geojson( aFlowline_basin_simplified, sFilename_out) except: print('Error in flow direction correction') - - - + + + #step 4: remove loops try: print('Basin ', self.sBasinID, 'started loop removal') - ptimer.start() - sys.stdout.flush() - aFlowline_basin_simplified = remove_flowline_loop(aFlowline_basin_simplified) - ptimer.stop() sys.stdout.flush() + ptimer.start() + aFlowline_basin_simplified = remove_flowline_loop(aFlowline_basin_simplified) + ptimer.stop() + if self.iFlag_debug ==1: sFilename_out = 'flowline_loop_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson( aFlowline_basin_simplified, sFilename_out) except: print('Error in loop removal') - - + + #at this stage, the stream order information is not available, but could be easily rebuild for speed up the small river removal algorithm print('Basin ', self.sBasinID, 'started update stream order initial') + sys.stdout.flush() ptimer.start() aFlowline_basin_simplified = update_head_water_stream_order(aFlowline_basin_simplified ) ptimer.stop() @@ -564,11 +565,12 @@ def basin_flowline_simplification(self): if self.iFlag_remove_small_river ==1: for i in np.arange(0, 3, 1): sStep = "{:02d}".format(i+1) - - dThreshold = self.dThreshold_small_river + + dThreshold = self.dThreshold_small_river print('Basin ', self.sBasinID, 'started small river removal', sStep, dThreshold) - ptimer.start() sys.stdout.flush() + ptimer.start() + aFlowline_basin_simplified = remove_small_river(aFlowline_basin_simplified, dThreshold ) if self.iFlag_debug ==1: sFilename_out = 'flowline_large_'+ sStep +'_before_intersect.geojson' @@ -576,7 +578,7 @@ def basin_flowline_simplification(self): export_flowline_to_geojson( aFlowline_basin_simplified, sFilename_out) #print(len(aFlowline_basin_simplified)) - #update stream order + #update stream order aFlowline_basin_simplified = update_head_water_stream_order(aFlowline_basin_simplified ) aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet = find_flowline_confluence(aFlowline_basin_simplified, pVertex_outlet) @@ -585,18 +587,18 @@ def basin_flowline_simplification(self): sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_vertex_to_geojson( aVertex, sFilename_out, aAttribute_data=aConnectivity) - aFlowline_basin_simplified = merge_flowline( aFlowline_basin_simplified, aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) + aFlowline_basin_simplified = merge_flowline( aFlowline_basin_simplified, aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) if self.iFlag_debug ==1: sFilename_out = 'flowline_merge_'+ sStep +'_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson( aFlowline_basin_simplified, sFilename_out) aFlowline_basin_simplified = update_head_water_stream_order(aFlowline_basin_simplified ) - + ptimer.stop() if len(aFlowline_basin_simplified) == 1: - break - + break + sys.stdout.flush() else: #if we dont remove small river, we still need to merge the flowline aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet = find_flowline_confluence(aFlowline_basin_simplified, pVertex_outlet) @@ -604,46 +606,48 @@ def basin_flowline_simplification(self): sFilename_out = 'flowline_vertex_with_confluence_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_vertex_to_geojson( aVertex, sFilename_out, aAttribute_data=aConnectivity) - aFlowline_basin_simplified = merge_flowline( aFlowline_basin_simplified, aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) + aFlowline_basin_simplified = merge_flowline( aFlowline_basin_simplified, aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) if self.iFlag_debug ==1: sFilename_out = 'flowline_merge_before_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson( aFlowline_basin_simplified, sFilename_out) aFlowline_basin_simplified = update_head_water_stream_order(aFlowline_basin_simplified ) pass - + #the final vertex info print('Basin ', self.sBasinID, 'find flowline confluence') + sys.stdout.flush() ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet = find_flowline_confluence(aFlowline_basin_simplified, pVertex_outlet) ptimer.stop() sFilename_out = 'vertex_simplified.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_vertex_to_geojson( aVertex, sFilename_out, aAttribute_data=aConnectivity) - + #starting here, the self object can be updated because no more edit (add/remove) will be made to the flowline #but attributes will be updated - + #build segment index, they are reversed print('Basin ', self.sBasinID, 'started stream segment definition') + sys.stdout.flush() ptimer.start() aFlowline_basin_simplified, aStream_segment = define_stream_segment_index(aFlowline_basin_simplified) ptimer.stop() if self.iFlag_debug ==1: - sFilename_out = self.sFilename_flowline_segment_index_before_intersect - export_flowline_to_geojson(aFlowline_basin_simplified, - sFilename_out, - aAttribute_data=[aStream_segment], - aAttribute_field=['stream_segment'], + sFilename_out = self.sFilename_flowline_segment_index_before_intersect + export_flowline_to_geojson(aFlowline_basin_simplified, + sFilename_out, + aAttribute_data=[aStream_segment], + aAttribute_field=['stream_segment'], aAttribute_dtype=['int']) aVertex = np.array(aVertex) aIndex_confluence = np.array(aIndex_confluence) - if aIndex_confluence.size > 0: + if aIndex_confluence.size > 0: print('Basin ', self.sBasinID, 'started confluence definition') ptimer.start() aVertex_confluence = aVertex[aIndex_confluence] - aConfluence_basin_simplified = self.basin_build_confluence(aFlowline_basin_simplified, aVertex_confluence) + aConfluence_basin_simplified = self.basin_build_confluence(aFlowline_basin_simplified, aVertex_confluence) ptimer.stop() #change added a new function to build stream topology @@ -651,25 +655,25 @@ def basin_flowline_simplification(self): ptimer.start() aFlowline_basin_simplified = define_stream_topology(aFlowline_basin_simplified, aConfluence_basin_simplified) ptimer.stop() - - #build stream order + + #build stream order print('Basin ', self.sBasinID, 'started stream order definition') ptimer.start() aFlowline_basin_simplified, aStream_order = define_stream_order(aFlowline_basin_simplified, aConfluence_basin_simplified) ptimer.stop() - sFilename_out = self.sFilename_flowline_simplified - export_flowline_to_geojson(aFlowline_basin_simplified, - sFilename_out, - aAttribute_data=[aStream_segment, aStream_order], - aAttribute_field=['stream_segment','stream_order'], + sFilename_out = self.sFilename_flowline_simplified + export_flowline_to_geojson(aFlowline_basin_simplified, + sFilename_out, + aAttribute_data=[aStream_segment, aStream_order], + aAttribute_field=['stream_segment','stream_order'], aAttribute_dtype=['int','int']) - + if self.iFlag_break_by_distance==1: print('Basin ', self.sBasinID, 'started flowline split by length') ptimer.start() aFlowline_basin_simplified_split = split_flowline_by_length(aFlowline_basin_simplified, self.dThreshold_break_by_distance) ptimer.stop() - + sFilename_out = self.sFilename_flowline_split export_flowline_to_geojson( aFlowline_basin_simplified_split, sFilename_out ) @@ -691,9 +695,9 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) list [pyflowline]: A list of intersected cells """ print('Basin ', self.sBasinID, 'Start topology reconstruction') - + ptimer = pytimer() - + sWorkspace_output_basin = self.sWorkspace_output_basin sFilename_flowline_in = self.sFilename_flowline_simplified sFilename_flowline_intersect_out = self.sFilename_flowline_intersect @@ -707,12 +711,12 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_intersect_flowline_with_mesh.geojson' - sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) + sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson(aFlowline_intersect_all, sFilename_out) except: print('Error in flowline and mesh intersection.') - - + + point= dict() point['dLongitude_degree'] = self.dLongitude_outlet_degree point['dLatitude_degree'] = self.dLatitude_outlet_degree @@ -728,15 +732,15 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_simplified_after_intersect.geojson' - sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) - export_flowline_to_geojson(aFlowline_basin_conceptual, sFilename_out) + sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) + export_flowline_to_geojson(aFlowline_basin_conceptual, sFilename_out) except: print('Error in remove_returning_flowline.') - + #edge based try: - print('Basin ', self.sBasinID, 'Start split flowline to edge') + print('Basin ', self.sBasinID, 'Start split flowline to edge') ptimer.start() aFlowline_basin_conceptual, aEdge = split_flowline_to_edge(aFlowline_basin_conceptual) ptimer.stop() @@ -749,7 +753,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Error in split_flowline_to_edge.') try: - print('Basin ', self.sBasinID, 'Start remove duplicate flowline') + print('Basin ', self.sBasinID, 'Start remove duplicate flowline') ptimer.start() aFlowline_basin_conceptual = remove_duplicate_flowline(aFlowline_basin_conceptual) ptimer.stop() @@ -762,7 +766,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Error in remove_duplicate_flowline.') try: - print('Basin ', self.sBasinID, 'Start flowline direction correction') + print('Basin ', self.sBasinID, 'Start flowline direction correction') ptimer.start() aFlowline_basin_conceptual = correct_flowline_direction(aFlowline_basin_conceptual, pVertex_outlet ) ptimer.stop() @@ -775,9 +779,9 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Error in correct_flowline_direction.') try: - print('Basin ', self.sBasinID, 'Start flowline direction correction') + print('Basin ', self.sBasinID, 'Start flowline direction correction') ptimer.start() - aFlowline_basin_conceptual = remove_flowline_loop(aFlowline_basin_conceptual ) + aFlowline_basin_conceptual = remove_flowline_loop(aFlowline_basin_conceptual ) ptimer.stop() sys.stdout.flush() if self.iFlag_debug ==1: @@ -786,14 +790,14 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) export_flowline_to_geojson( aFlowline_basin_conceptual, sFilename_out) except: print('Error in remove_flowline_loop.') - + try: aFlowline_basin_conceptual = update_head_water_stream_order(aFlowline_basin_conceptual ) except: print('Error in update_head_water_stream_order.') - + try: - print('Basin ', self.sBasinID, 'Start find flowline confluence') + print('Basin ', self.sBasinID, 'Start find flowline confluence') ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ = find_flowline_confluence(aFlowline_basin_conceptual, pVertex_outlet) @@ -805,37 +809,37 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) export_vertex_to_geojson( aVertex, sFilename_out, aAttribute_data=aConnectivity) except: print('Error in find_flowline_confluence.') - + #segment based try: - print('Basin ', self.sBasinID, 'Start merge flowline') + print('Basin ', self.sBasinID, 'Start merge flowline') ptimer.start() - aFlowline_basin_conceptual = merge_flowline( aFlowline_basin_conceptual,aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) + aFlowline_basin_conceptual = merge_flowline( aFlowline_basin_conceptual,aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) ptimer.stop() sys.stdout.flush() except: print('Error in merge_flowline.') - aFlowline_basin_conceptual = update_head_water_stream_order(aFlowline_basin_conceptual ) + aFlowline_basin_conceptual = update_head_water_stream_order(aFlowline_basin_conceptual ) try: - print('Basin ', self.sBasinID, 'Start find flowline confluence') + print('Basin ', self.sBasinID, 'Start find flowline confluence') ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ - = find_flowline_confluence(aFlowline_basin_conceptual, pVertex_outlet) + = find_flowline_confluence(aFlowline_basin_conceptual, pVertex_outlet) ptimer.stop() sys.stdout.flush() except: print('Error in find_flowline_confluence.') - + aFlowline_basin_conceptual, aStream_segment = define_stream_segment_index(aFlowline_basin_conceptual) #save confluence aVertex = np.array(aVertex) aIndex_confluence = np.array(aIndex_confluence) - if aIndex_confluence.size > 0: - aVertex_confluence = aVertex[aIndex_confluence] - aConfluence_basin_conceptual = self.basin_build_confluence(aFlowline_basin_conceptual, aVertex_confluence) + if aIndex_confluence.size > 0: + aVertex_confluence = aVertex[aIndex_confluence] + aConfluence_basin_conceptual = self.basin_build_confluence(aFlowline_basin_conceptual, aVertex_confluence) else: #there is no confluence pass @@ -851,41 +855,41 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) #edge based aFlowline_basin_edge, aEdge = split_flowline_to_edge(aFlowline_basin_conceptual) - sFilename_out = self.sFilename_flowline_edge + sFilename_out = self.sFilename_flowline_edge export_flowline_to_geojson( aFlowline_basin_edge, sFilename_out) - + sFilename_out = self.sFilename_flowline_conceptual - export_flowline_to_geojson( aFlowline_basin_conceptual, - sFilename_out, - aAttribute_data=[aStream_segment, aStream_order], - aAttribute_field=['stream_segment','stream_order'], + export_flowline_to_geojson( aFlowline_basin_conceptual, + sFilename_out, + aAttribute_data=[aStream_segment, aStream_order], + aAttribute_field=['stream_segment','stream_order'], aAttribute_dtype=['int','int']) self.aConfluence_basin_conceptual = aConfluence_basin_conceptual - self.aFlowline_basin_conceptual = aFlowline_basin_conceptual + self.aFlowline_basin_conceptual = aFlowline_basin_conceptual self.aFlowline_basin_edge = aFlowline_basin_edge - + self.lCellID_outlet = lCellID_outlet self.dLongitude_outlet_degree = pVertex_outlet.dLongitude_degree self.dLatitude_outlet_degree = pVertex_outlet.dLatitude_degree - + print('Finish topology reconstruction:', self.sBasinID) sys.stdout.flush() if iFlag_use_rtree ==1: interleaved = True self.pRTree_flowline = RTree(interleaved=interleaved, max_cap=5, min_cap=2) - for lFlowlineIndex in range(len(self.aFlowline_basin_conceptual)): - pBound = self.aFlowline_basin_conceptual[lFlowlineIndex].pBound + for lFlowlineIndex in range(len(self.aFlowline_basin_conceptual)): + pBound = self.aFlowline_basin_conceptual[lFlowlineIndex].pBound self.pRTree_flowline.insert(lFlowlineIndex, pBound) self.pRTree_edge = RTree(interleaved=interleaved, max_cap=5, min_cap=2) - for lEdgeIndex in range(len(self.aFlowline_basin_edge)): - pBound = self.aFlowline_basin_edge[lEdgeIndex].pBound + for lEdgeIndex in range(len(self.aFlowline_basin_edge)): + pBound = self.aFlowline_basin_edge[lEdgeIndex].pBound self.pRTree_edge.insert(lEdgeIndex, pBound) pass return aCell_intersect_basin - def basin_build_confluence(self, aFlowline_basin_in, aVertex_confluence_in): + def basin_build_confluence(self, aFlowline_basin_in, aVertex_confluence_in): """ Build the conflence @@ -920,83 +924,83 @@ def basin_build_confluence(self, aFlowline_basin_in, aVertex_confluence_in): aConfluence_basin.append(pConfluence) #aConfluence_basin=list() - #for pVertex in aVertex_confluence_in: + #for pVertex in aVertex_confluence_in: # aFlowline_upstream =list() # for pFlowline in aFlowline_basin_in: # pVertex_start = pFlowline.pVertex_start # pVertex_end = pFlowline.pVertex_end - # if pVertex_end == pVertex: + # if pVertex_end == pVertex: # aFlowline_upstream.append(pFlowline) # pass # if pVertex_start == pVertex: # pFlowline_downstream=pFlowline # pConfluence = pyconfluence(pVertex, aFlowline_upstream, pFlowline_downstream) - # aConfluence_basin.append(pConfluence) - + # aConfluence_basin.append(pConfluence) + return aConfluence_basin - + def basin_analyze(self): """ Analyze the basin results including length, sinuosity, and breaching angle """ - + if self.aFlowline_basin_filtered is None: sFilename_flowline_filter = self.sFilename_flowline_filter sFilename_flowline_filter_geojson = self.sFilename_flowline_filter_geojson - self.aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter_geojson ) + self.aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter_geojson ) self.dLength_flowline_filtered = self.calculate_flowline_length(self.aFlowline_basin_filtered) - + point= dict() point['dLongitude_degree'] = self.dLongitude_outlet_degree point['dLatitude_degree'] = self.dLatitude_outlet_degree pVertex_outlet_initial=pyvertex(point) - if self.aFlowline_basin_simplified is None: + if self.aFlowline_basin_simplified is None: sFilename_flowline_in = self.sFilename_flowline_simplified - aFlowline_simplified,pSpatial_reference = read_flowline_geojson( sFilename_flowline_in ) - + aFlowline_simplified,pSpatial_reference = read_flowline_geojson( sFilename_flowline_in ) + self.aFlowline_basin_simplified = aFlowline_simplified aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ - = find_flowline_confluence(self.aFlowline_basin_simplified, pVertex_outlet_initial) + = find_flowline_confluence(self.aFlowline_basin_simplified, pVertex_outlet_initial) aVertex = np.array(aVertex) aIndex_confluence = np.array(aIndex_confluence) - if aIndex_confluence.size > 0: - aVertex_confluence = aVertex[aIndex_confluence] + if aIndex_confluence.size > 0: + aVertex_confluence = aVertex[aIndex_confluence] self.aConfluence_basin_simplified = self.build_confluence(self.aFlowline_basin_simplified, aVertex_confluence) self.dLength_flowline_simplified = self.calculate_flowline_length(self.aFlowline_basin_simplified) if self.aFlowline_basin_conceptual is None: sFilename_flowline_in = self.sFilename_flowline_conceptual - aFlowline_conceptual, pSpatial_reference = read_flowline_geojson( sFilename_flowline_in ) + aFlowline_conceptual, pSpatial_reference = read_flowline_geojson( sFilename_flowline_in ) self.aFlowline_basin_conceptual = aFlowline_conceptual - + aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ - = find_flowline_confluence(self.aFlowline_basin_conceptual, pVertex_outlet_initial) + = find_flowline_confluence(self.aFlowline_basin_conceptual, pVertex_outlet_initial) aVertex = np.array(aVertex) aIndex_confluence = np.array(aIndex_confluence) - if aIndex_confluence.size > 0: - aVertex_confluence = aVertex[aIndex_confluence] + if aIndex_confluence.size > 0: + aVertex_confluence = aVertex[aIndex_confluence] self.aConfluence_basin_conceptual = self.build_confluence(self.aFlowline_basin_conceptual, aVertex_confluence) self.dLength_flowline_conceptual = self.calculate_flowline_length(self.aFlowline_basin_conceptual) self.calculate_river_sinuosity() self.calculate_confluence_branching_angle() - return - + return + def basin_export(self): """ Export the basin outputs in json format """ self.basin_export_basin_info_to_json() self.basin_export_flowline_info_to_json() - self.basin_export_confluence_info_to_json() + self.basin_export_confluence_info_to_json() if iFlag_kml is not None: #only convert final conceptual flowline to kml sFilename_conceptual = self.sFilename_flowline_conceptual sFilename_conceptual_kml = self.sFilename_flowline_conceptual_kml - + #convert_geojson_to_kml(sFilename_conceptual, sFilename_conceptual_kml) @@ -1013,9 +1017,9 @@ def basin_export_flowline(self, aFlowline_in, sFilename_json_in,iFlag_projected_ pSpatial_reference_in (object, optional): The spatial reference if re-projection is needed. Defaults to None. """ export_flowline_to_geojson(aFlowline_in, sFilename_json_in, - iFlag_projected_in= iFlag_projected_in, + iFlag_projected_in= iFlag_projected_in, pSpatial_reference_in = pSpatial_reference_in) - + return def basin_export_basin_info_to_json(self): @@ -1037,8 +1041,8 @@ def basin_export_basin_info_to_json(self): sort_keys=True, \ indent = 4, \ ensure_ascii=True, \ - cls=BasinClassEncoder) - f.write(sJson) + cls=BasinClassEncoder) + f.write(sJson) f.close() return @@ -1048,17 +1052,17 @@ def basin_export_flowline_info_to_json(self): """ iFlag_export_simplified=0 if iFlag_export_simplified==1: - sFilename_json = self.sFilename_flowline_simplified_info + sFilename_json = self.sFilename_flowline_simplified_info with open(sFilename_json, 'w', encoding='utf-8') as f: - sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aFlowline_basin_simplified], indent = 4) - f.write(sJson) + sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aFlowline_basin_simplified], indent = 4) + f.write(sJson) f.close() sFilename_json = self.sFilename_flowline_conceptual_info - + with open(sFilename_json, 'w', encoding='utf-8') as f: - sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aFlowline_basin_conceptual], indent = 4) - f.write(sJson) + sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aFlowline_basin_conceptual], indent = 4) + f.write(sJson) f.close() return @@ -1069,22 +1073,22 @@ def basin_export_confluence_info_to_json(self): #iFlag_export_confluence =0 if self.aConfluence_basin_simplified is not None: sFilename_json = self.sFilename_confluence_simplified_info - + with open(sFilename_json, 'w', encoding='utf-8') as f: - sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aConfluence_basin_simplified], indent = 4) - f.write(sJson) + sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aConfluence_basin_simplified], indent = 4) + f.write(sJson) f.close() if self.aConfluence_basin_conceptual is not None: sFilename_json = self.sFilename_confluence_conceptual_info - + with open(sFilename_json, 'w', encoding='utf-8') as f: - sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aConfluence_basin_conceptual], indent = 4) - f.write(sJson) + sJson = json.dumps([json.loads(ob.tojson()) for ob in self.aConfluence_basin_conceptual], indent = 4) + f.write(sJson) f.close() - - return + + return def tojson(self): """ @@ -1101,15 +1105,15 @@ def tojson(self): for sKey in aSkip: obj.pop(sKey, None) pass - - - sJson = json.dumps(obj, - sort_keys=True, - indent = 4, - ensure_ascii=True, + + + sJson = json.dumps(obj, + sort_keys=True, + indent = 4, + ensure_ascii=True, cls=BasinClassEncoder) return sJson - + def basin_export_config_to_json(self, sFilename_output_in = None): """ Export the basin object to json using the encoder @@ -1140,12 +1144,12 @@ def basin_convert_flowline_to_geojson(self): """ Convert the flowline to geojson """ - sFilename_raw = self.sFilename_flowline_filter + sFilename_raw = self.sFilename_flowline_filter sFilename_out = self.sFilename_flowline_filter_geojson print('Basin '+ self.sBasinID + ': initial flowline:', sFilename_raw ) convert_flowline_to_geojson(1, sFilename_raw, sFilename_out) - return - + return + def basin_calculate_flowline_length(self, aFlowline_in): """ Calculate the length of flowlines @@ -1161,7 +1165,7 @@ def basin_calculate_flowline_length(self, aFlowline_in): #for i in range(nflowline): # pFlowline= aFlowline_in[i] # pFlowline.calculate_length() - # dLength = dLength + pFlowline.dLength + # dLength = dLength + pFlowline.dLength #return dLength return sum(pFlowline.dLength for pFlowline in aFlowline_in) @@ -1170,10 +1174,10 @@ def basin_calculate_river_sinuosity(self): Calcualte the the river sinuosity """ for pFlowline in self.aFlowline_basin_simplified: - pFlowline.calculate_flowline_sinuosity() + pFlowline.calculate_flowline_sinuosity() for pFlowline in self.aFlowline_basin_conceptual: - pFlowline.calculate_flowline_sinuosity() + pFlowline.calculate_flowline_sinuosity() return @@ -1184,9 +1188,9 @@ def basin_calculate_confluence_branching_angle(self): for pConfluence in self.aConfluence_basin_simplified: pConfluence.calculate_branching_angle() for pConfluence in self.aConfluence_basin_conceptual: - pConfluence.calculate_branching_angle() + pConfluence.calculate_branching_angle() return - + def basin_evaluate(self, iMesh_type, sMesh_type): """ Evaluate the model performance @@ -1208,10 +1212,10 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): sMesh_type (str): The mesh type """ - + sFilename_simplified = self.sFilename_flowline_simplified - + sFilename_flowline_edge = self.sFilename_flowline_edge #intersect first @@ -1219,19 +1223,19 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): aVertex_intersect = intersect_flowline_with_flowline(sFilename_simplified, sFilename_flowline_edge, sFilename_output) #get confluence simple - point= dict() + point= dict() point['dLongitude_degree'] = self.dLongitude_outlet_degree point['dLatitude_degree'] = self.dLatitude_outlet_degree pVertex_outlet=pyvertex(point) - aFlowline_simplified,pSpatial_reference = read_flowline_geojson( sFilename_simplified ) + aFlowline_simplified,pSpatial_reference = read_flowline_geojson( sFilename_simplified ) aVertex_simplified, lIndex_outlet_simplified, \ aIndex_headwater_simplified, aIndex_middle, \ aIndex_confluence_simplified, aConnectivity, pVertex_outlet\ = find_flowline_confluence(aFlowline_simplified, pVertex_outlet) - - aFlowline_conceptual,pSpatial_reference = read_flowline_geojson( sFilename_flowline_edge ) + + aFlowline_conceptual,pSpatial_reference = read_flowline_geojson( sFilename_flowline_edge ) aVertex_conceptual, lIndex_outlet_conceptual, \ aIndex_headwater_conceptual, aIndex_middle_conceptual, \ aIndex_confluence_conceptual, aConnectivity, pVertex_outlet \ @@ -1246,7 +1250,7 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): f = list(np.array(aVertex_conceptual)[c] ) g = aVertex_intersect + d + e + f - + aVertex_all =list() for i in g: iFlag_exist, lIndex = find_vertex_in_list( aVertex_all, i) @@ -1255,7 +1259,7 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): else: aVertex_all.append(i) - h = aVertex_intersect + d + h = aVertex_intersect + d aVertex_all_simplified =list() for i in h: iFlag_exist, lIndex = find_vertex_in_list( aVertex_all_simplified, i) @@ -1264,7 +1268,7 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): else: aVertex_all_simplified.append(i) - j = aVertex_intersect + e + f + j = aVertex_intersect + e + f aVertex_all_conceptual =list() for i in j: iFlag_exist, lIndex = find_vertex_in_list( aVertex_all_conceptual, i) @@ -1272,27 +1276,27 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): pass else: aVertex_all_conceptual.append(i) - - #export + + #export self.iFlag_debug =1 if self.iFlag_debug ==1: sFilename_output= os.path.join(self.sWorkspace_output_basin, 'vertex_split_all.json') export_vertex_to_geojson( aVertex_all, sFilename_output) - - #split + + #split aFlowline_simplified_split = split_flowline(aFlowline_simplified, aVertex_all_simplified,iFlag_intersect =1) self.iFlag_debug =1 if self.iFlag_debug ==1: sFilename_out = 'flowline_split_simplified.json' sFilename_out = os.path.join(self.sWorkspace_output_basin, sFilename_out) - export_flowline_to_geojson(aFlowline_simplified_split, sFilename_out) - + export_flowline_to_geojson(aFlowline_simplified_split, sFilename_out) + aFlowline_conceptual_split = split_flowline(aFlowline_conceptual, aVertex_all_conceptual,\ iFlag_intersect =1, iFlag_use_id=1) self.iFlag_debug =1 if self.iFlag_debug ==1: sFilename_out = 'flowline_split_conceptual.json' - sFilename_out = os.path.join(self.sWorkspace_output_basin, sFilename_out) + sFilename_out = os.path.join(self.sWorkspace_output_basin, sFilename_out) export_flowline_to_geojson(aFlowline_conceptual_split, sFilename_out) #aFlowline_conceptual_split, dummy = read_flowline_geojson(sFilename_out) @@ -1304,7 +1308,6 @@ def basin_evaluate_area_of_difference(self, iMesh_type, sMesh_type): aPolygon_out, dArea = calculate_area_of_difference_simplified(aFlowline_all, aVertex_all, sFilename_output) print('Area of difference: ', dArea) self.dArea_of_difference = dArea - self.dDistance_displace = dArea / self.dLength_flowline_simplified + self.dDistance_displace = dArea / self.dLength_flowline_simplified return - \ No newline at end of file diff --git a/pyflowline/classes/vertex.py b/pyflowline/classes/vertex.py index 1d47c03..818a093 100644 --- a/pyflowline/classes/vertex.py +++ b/pyflowline/classes/vertex.py @@ -10,6 +10,8 @@ else: from pyearth.gis.geometry.calculate_distance_based_on_longitude_latitude import calculate_distance_based_on_longitude_latitude +iPrecision_default = 8 #used for comparison + class VertexClassEncoder(JSONEncoder): def default(self, obj): if isinstance(obj, np.integer): @@ -100,7 +102,7 @@ def toNvector(self): pNvector = pynvector(point) return pNvector - def __hash__(self, precision=6): + def __hash__(self, precision=iPrecision_default): #design a hash function that uses both dLongitude and dLatitude @@ -129,19 +131,15 @@ def __eq__(self, other): int: 1 if equivalent, 0 if not """ iFlag = False - dThreshold_in = 1.0E-10 - if isinstance(other, pyvertex): - + dThreshold_in = 10 ** (-1 * iPrecision_default) + if isinstance(other, pyvertex): if (self.dLongitude_degree == other.dLongitude_degree) and \ (self.dLatitude_degree == other.dLatitude_degree): iFlag = True else: #use absolute difference to check whether two vertices are the same if (abs(self.dLongitude_degree - other.dLongitude_degree) < dThreshold_in) and \ - (abs(self.dLatitude_degree - other.dLatitude_degree) < dThreshold_in): - #be careful - #print(self.dLongitude_degree ,self.dLatitude_degree , - #other.dLongitude_degree, other.dLatitude_degree) + (abs(self.dLatitude_degree - other.dLatitude_degree) < dThreshold_in): iFlag = True else: iFlag = False From 6d4c86c9ac17f062e7b1c8ffe7be67fd34403aa8 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Thu, 29 Feb 2024 08:10:29 -0800 Subject: [PATCH 10/15] performance speed up --- .../direction/correct_flowline_direction.py | 45 ++++++++++++++++- .../algorithms/index/define_stream_order.py | 1 - .../algorithms/loop/remove_flowline_loop.py | 29 ++++++----- pyflowline/algorithms/merge/merge_flowline.py | 6 +-- .../split/find_flowline_confluence.py | 9 ---- pyflowline/classes/basin.py | 48 ++++++++++--------- pyflowline/classes/flowline.py | 12 ++++- pyflowline/classes/pycase.py | 2 +- 8 files changed, 95 insertions(+), 57 deletions(-) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index e36b66c..02d0236 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -3,7 +3,50 @@ from pyflowline.algorithms.auxiliary.check_head_water import check_head_water sys.setrecursionlimit(100000) lFlowlineIndex=0 -def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): + +def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): + nFlowline = len(aFlowline_in) + dDiatance_min = float('inf') + unfinished_flowlines = set() + for i in range(nFlowline): + pFlowline = aFlowline_in[i] + pVertex_end = pFlowline.pVertex_end + dDiatance = pVertex_end.calculate_distance(pVertex_outlet_in) + if dDiatance < dDiatance_min: + dDiatance_min = dDiatance + lIndex_outlet = i + + unfinished_flowlines.add(aFlowline_in[i]) + + unfinished_flowlines.remove(aFlowline_in[lIndex_outlet]) + aVertex_downslope_table = [aFlowline_in[lIndex_outlet].pVertex_start] + aFlowline_out= [aFlowline_in[lIndex_outlet]] + while unfinished_flowlines: + aVertex_downslope_current= [] + for pVertex_dummy in aVertex_downslope_table: + to_remove = set() + for pFlowline in unfinished_flowlines: + if pFlowline.pVertex_end == pVertex_dummy : + aVertex_downslope_current.append(pFlowline.pVertex_start) + to_remove.add(pFlowline) + aFlowline_out.append(pFlowline) + else: + if pFlowline.pVertex_start == pVertex_dummy : + pFlowline.reverse() + aVertex_downslope_current.append(pFlowline.pVertex_start) + to_remove.add(pFlowline) + aFlowline_out.append(pFlowline) + + unfinished_flowlines -= to_remove + + if len(unfinished_flowlines)==0: + break + aVertex_downslope_table = aVertex_downslope_current + + return aFlowline_out + + +def correct_flowline_direction_old(aFlowline_in, pVertex_outlet_in): """_summary_ This function should expect the flowline may not be ordered, so the stream order info is not available. Args: diff --git a/pyflowline/algorithms/index/define_stream_order.py b/pyflowline/algorithms/index/define_stream_order.py index e16576d..a189f1f 100644 --- a/pyflowline/algorithms/index/define_stream_order.py +++ b/pyflowline/algorithms/index/define_stream_order.py @@ -18,7 +18,6 @@ def update_head_water_stream_order(aFlowline_in): pVertex_start = pFlowline.pVertex_start if check_head_water(aFlowline_in, pVertex_start)==1: pFlowline.iStream_order = 1 - pass else: pFlowline.iStream_order = -1 diff --git a/pyflowline/algorithms/loop/remove_flowline_loop.py b/pyflowline/algorithms/loop/remove_flowline_loop.py index 49f3852..6931928 100644 --- a/pyflowline/algorithms/loop/remove_flowline_loop.py +++ b/pyflowline/algorithms/loop/remove_flowline_loop.py @@ -20,20 +20,20 @@ def remove_flowline_loop(aFlowline_in): flowline_dict[pVertex_start] = [] flowline_dict[pVertex_start].append((i, pFlowline)) - def find_paralle_stream( pVertex_start_in): - ndownstream=0 - aDownstream=list() - aStream_order_out=list() - for j in range(nFlowline): - pFlowline = aFlowline_in[j] - pVertex_start = pFlowline.pVertex_start - #pVertex_end = pFlowline.pVertex_end - if pVertex_start == pVertex_start_in: - ndownstream= ndownstream+1 - aDownstream.append(j) - aStream_order_out.append( pFlowline.iStream_order ) - pass - return ndownstream, aDownstream, aStream_order_out + #old method + #def find_paralle_stream( pVertex_start_in): + # ndownstream=0 + # aDownstream=list() + # aStream_order_out=list() + # for j in range(nFlowline): + # pFlowline = aFlowline_in[j] + # pVertex_start = pFlowline.pVertex_start + # if pVertex_start == pVertex_start_in: + # ndownstream= ndownstream+1 + # aDownstream.append(j) + # aStream_order_out.append( pFlowline.iStream_order ) + # pass + # return ndownstream, aDownstream, aStream_order_out lID=0 aFlag = np.full(nFlowline, 0, dtype=int) @@ -43,7 +43,6 @@ def find_paralle_stream( pVertex_start_in): #pVertex_end = pFlowline.pVertex_end #iStream_order = pFlowline.iStream_order #ndownstream , aDownstream, aStream_order = find_paralle_stream( pVertex_start) - # Get all parallel streams parallel_streams = flowline_dict.get(pVertex_start, []) ndownstream = len(parallel_streams) diff --git a/pyflowline/algorithms/merge/merge_flowline.py b/pyflowline/algorithms/merge/merge_flowline.py index 5a78982..61683d8 100644 --- a/pyflowline/algorithms/merge/merge_flowline.py +++ b/pyflowline/algorithms/merge/merge_flowline.py @@ -29,7 +29,7 @@ def merge_flowline(aFlowline_in, List: The flowline are strictly ordered from outlet to headwater """ - nVertex=len(aVertex_in) + #nVertex=len(aVertex_in) nFlowline = len(aFlowline_in) aFlowline_out=list() aVertex = np.array(aVertex_in) @@ -47,8 +47,6 @@ def merge_flowline(aFlowline_in, #convert to set aVertex_headwater_set = set(aVertex[aIndex_headwater]) aVertex_middle_set = set(aVertex[aIndex_middle]) - if aVertex_middle_set.size == 0: - return aFlowline_in if aIndex_confluence.size > 0: iFlag_confluence = 1 @@ -128,8 +126,6 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in): if dDiatance < dDiatance_min: dDiatance_min = dDiatance lIndex_outlet = i - - pFlowline = aFlowline_in[lIndex_outlet] pVertex_start = pFlowline.pVertex_start diff --git a/pyflowline/algorithms/split/find_flowline_confluence.py b/pyflowline/algorithms/split/find_flowline_confluence.py index f5c8616..4e3ff3b 100644 --- a/pyflowline/algorithms/split/find_flowline_confluence.py +++ b/pyflowline/algorithms/split/find_flowline_confluence.py @@ -21,19 +21,13 @@ def find_flowline_confluence(aFlowline_in, pVertex_outlet_in): Returns: List: _description_ """ - - nFlowline = len(aFlowline_in) aVertex=list() aIndex_headwater=list() aIndex_confluence=list() aIndex_middle =list() lIndex_outlet = -1 - aVertex = find_flowline_vertex(aFlowline_in) - vertex_to_index = {vertex: index for index, vertex in enumerate(aVertex)} - - nVertex=len(aVertex) aConnectivity = np.full( nVertex , 0, dtype=int ) #iFlag_first=1 @@ -58,7 +52,6 @@ def find_flowline_confluence(aFlowline_in, pVertex_outlet_in): distances = [vertex.calculate_distance(pVertex_outlet_in) for vertex in aVertex] lIndex_outlet = np.argmin(distances) pVertex_outlet_out = aVertex[lIndex_outlet] - #a outlet can be a confluence, so we won't set it aConnectivity[lIndex_outlet] =0 @@ -97,7 +90,6 @@ def find_flowline_confluence(aFlowline_in, pVertex_outlet_in): pVertex_start = pFlowline.pVertex_start pVertex_end = pFlowline.pVertex_end lIndex_end = vertex_to_index.get(pVertex_end) - if lIndex_end != lIndex_outlet: if pFlowline.iStream_order == 1: lIndex_start = vertex_to_index.get(pVertex_start) @@ -116,7 +108,6 @@ def find_flowline_confluence(aFlowline_in, pVertex_outlet_in): if lIndex_end is not None: aConnectivity[lIndex_end] += 1 #reset outlet - #for i in range(0, nVertex): # if i == lIndex_outlet: # if (aConnectivity[i] >1): diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 6245985..120f2c5 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -37,6 +37,7 @@ from pyflowline.algorithms.intersect.intersect_flowline_with_flowline import intersect_flowline_with_flowline from pyflowline.algorithms.auxiliary.calculate_area_of_difference import calculate_area_of_difference_simplified +#cython for performance improvement iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -45,14 +46,15 @@ iFlag_use_rtree = 1 else: from pyflowline.algorithms.auxiliary.find_vertex_in_list import find_vertex_in_list - iFlag_use_rtree =0 + iFlag_use_rtree = 0 +#kml support for google earth visualization iFlag_kml = importlib.util.find_spec("simplekml") if iFlag_kml is not None: #from pyearth.gis.kml.convert_geojson_to_kml import convert_geojson_to_kml pass - +#change the default recursive call limit sys.setrecursionlimit(100000) class BasinClassEncoder(JSONEncoder): @@ -97,6 +99,7 @@ class pybasin(object): iFlag_disconnected =0 iFlag_remove_small_river = 0 iFlag_remove_low_order_river = 0 + iFlag_correct_flowline_direction = 0 iFlag_dam=0 iFlag_break_by_distance = 0 @@ -205,6 +208,11 @@ def __init__(self, aParameter): else: self.iFlag_remove_low_order_river = 0 + if 'iFlag_correct_flowline_direction' in aParameter: + self.iFlag_correct_flowline_direction = int(aParameter['iFlag_correct_flowline_direction']) + else: + self.iFlag_correct_flowline_direction = 0 + if 'iFlag_dam' in aParameter: self.iFlag_dam = int(aParameter['iFlag_dam']) else: @@ -371,7 +379,7 @@ def basin_flowline_simplification(self): ndam = len(aData_dam) aNHDPlusID_dams_headwater = list() aFlowline_dams_nonheadwater = list() - aVertex_dams_nonheadwater=list() + aVertex_dams_nonheadwater = list() n=0 for j in range(0, ndam): dLon = float(aData_dam[j][1]) @@ -515,18 +523,15 @@ def basin_flowline_simplification(self): point['dLatitude_degree'] = self.dLatitude_outlet_degree pVertex_outlet=pyvertex(point) - try: print('Basin ', self.sBasinID, 'started correction flow direction') sys.stdout.flush() ptimer.start() - nFlowline_before = len(aFlowline_basin_simplified) #this flowline is ordered from downstream to upstream aFlowline_basin_simplified = correct_flowline_direction(aFlowline_basin_simplified, pVertex_outlet ) nFlowline_after = len(aFlowline_basin_simplified) ptimer.stop() - pVertex_outlet = aFlowline_basin_simplified[0].pVertex_end self.pVertex_outlet = pVertex_outlet if self.iFlag_debug ==1: @@ -536,8 +541,6 @@ def basin_flowline_simplification(self): except: print('Error in flow direction correction') - - #step 4: remove loops try: print('Basin ', self.sBasinID, 'started loop removal') @@ -694,21 +697,20 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) Returns: list [pyflowline]: A list of intersected cells """ - print('Basin ', self.sBasinID, 'Start topology reconstruction') - + print('Basin ', self.sBasinID, 'Start topology reconstruction') ptimer = pytimer() - sWorkspace_output_basin = self.sWorkspace_output_basin sFilename_flowline_in = self.sFilename_flowline_simplified sFilename_flowline_intersect_out = self.sFilename_flowline_intersect try: print('Basin ', self.sBasinID, 'Start flowline and mesh intersection') + sys.stdout.flush() ptimer.start() aCell, aCell_intersect_basin, aFlowline_intersect_all = intersect_flowline_with_mesh(iMesh_type, sFilename_mesh, \ sFilename_flowline_in, sFilename_flowline_intersect_out) ptimer.stop() - sys.stdout.flush() + if self.iFlag_debug ==1: sFilename_out = 'flowline_intersect_flowline_with_mesh.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -726,10 +728,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) #segment based try: print('Basin ', self.sBasinID, 'Start return flowline removal') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual, lCellID_outlet, pVertex_outlet = remove_returning_flowline(iMesh_type, aCell_intersect_basin, pVertex_outlet_initial) - ptimer.stop() - sys.stdout.flush() + ptimer.stop() if self.iFlag_debug ==1: sFilename_out = 'flowline_simplified_after_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -741,10 +743,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) #edge based try: print('Basin ', self.sBasinID, 'Start split flowline to edge') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual, aEdge = split_flowline_to_edge(aFlowline_basin_conceptual) ptimer.stop() - sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_edge_split_flowline_to_edge.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -754,10 +756,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) try: print('Basin ', self.sBasinID, 'Start remove duplicate flowline') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = remove_duplicate_flowline(aFlowline_basin_conceptual) - ptimer.stop() - sys.stdout.flush() + ptimer.stop() if self.iFlag_debug ==1: sFilename_out = 'flowline_edge_remove_duplicate_flowline.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -767,10 +769,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) try: print('Basin ', self.sBasinID, 'Start flowline direction correction') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = correct_flowline_direction(aFlowline_basin_conceptual, pVertex_outlet ) ptimer.stop() - sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_edge_correct_flowline_direction.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -780,10 +782,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) try: print('Basin ', self.sBasinID, 'Start flowline direction correction') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = remove_flowline_loop(aFlowline_basin_conceptual ) ptimer.stop() - sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_edge_remove_flowline_loop.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -798,11 +800,11 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) try: print('Basin ', self.sBasinID, 'Start find flowline confluence') + sys.stdout.flush() ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ = find_flowline_confluence(aFlowline_basin_conceptual, pVertex_outlet) ptimer.stop() - sys.stdout.flush() if self.iFlag_debug ==1: sFilename_out = 'flowline_vertex_with_confluence_after_intersect.geojson' sFilename_out = os.path.join(sWorkspace_output_basin, sFilename_out) @@ -813,10 +815,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) #segment based try: print('Basin ', self.sBasinID, 'Start merge flowline') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = merge_flowline( aFlowline_basin_conceptual,aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) ptimer.stop() - sys.stdout.flush() except: print('Error in merge_flowline.') @@ -824,11 +826,11 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) try: print('Basin ', self.sBasinID, 'Start find flowline confluence') + sys.stdout.flush() ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet\ = find_flowline_confluence(aFlowline_basin_conceptual, pVertex_outlet) ptimer.stop() - sys.stdout.flush() except: print('Error in find_flowline_confluence.') @@ -846,10 +848,10 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) #change added a new function to build stream topology print('Basin ', self.sBasinID, 'started stream topology definition') + sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = define_stream_topology(aFlowline_basin_conceptual, aConfluence_basin_conceptual) ptimer.stop() - sys.stdout.flush() aFlowline_basin_conceptual, aStream_order = define_stream_order(aFlowline_basin_conceptual, aConfluence_basin_conceptual) diff --git a/pyflowline/classes/flowline.py b/pyflowline/classes/flowline.py index 5ded75b..1815cd1 100644 --- a/pyflowline/classes/flowline.py +++ b/pyflowline/classes/flowline.py @@ -76,7 +76,7 @@ def __init__(self, aEdge): aEdge (list [pyedge]): A list of edge objects """ self.aEdge = aEdge - nEdge = len(aEdge) + nEdge = len(aEdge) self.nEdge = nEdge self.pVertex_start = aEdge[0].pVertex_start self.pVertex_end = aEdge[ nEdge-1 ].pVertex_end @@ -97,7 +97,15 @@ def __init__(self, aEdge): self.calculate_flowline_bound() return - + + def __hash__(self): + return hash((self.pVertex_start, self.pVertex_end)) + + def __eq__(self, other): + if isinstance(other, pyflowline): + return self.pVertex_start == other.pVertex_start and self.pVertex_end == other.pVertex_end and self.aVertex == other.aVertex + return False + def calculate_length(self): """ Calcualte the length diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 7b84cb0..3109a48 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -877,7 +877,7 @@ def pyflowline_mesh_generation(self, iFlag_antarctic_in=None): return #no matter what type of mash, we will convert it to geoparquet for easy visualization - #convert_geojson_to_geoparquet(sFilename_mesh, sFilename_mesh.replace('.geojson','.parquet')) + convert_geojson_to_geoparquet(sFilename_mesh, sFilename_mesh.replace('.geojson','.parquet')) else: pass From e56f143c02493cf23d6a3933e306290ca615466f Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Thu, 29 Feb 2024 08:20:25 -0800 Subject: [PATCH 11/15] convert the O(n2) complexity to O(n) --- .../algorithms/direction/correct_flowline_direction.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index 02d0236..bc4dc68 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -8,6 +8,8 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): nFlowline = len(aFlowline_in) dDiatance_min = float('inf') unfinished_flowlines = set() + vertex_to_flowlines = {} # New dictionary to map each vertex to its flowlines + for i in range(nFlowline): pFlowline = aFlowline_in[i] pVertex_end = pFlowline.pVertex_end @@ -17,6 +19,10 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): lIndex_outlet = i unfinished_flowlines.add(aFlowline_in[i]) + # Update the dictionary + vertex_to_flowlines.setdefault(pFlowline.pVertex_start, []).append(pFlowline) + vertex_to_flowlines.setdefault(pFlowline.pVertex_end, []).append(pFlowline) + unfinished_flowlines.remove(aFlowline_in[lIndex_outlet]) aVertex_downslope_table = [aFlowline_in[lIndex_outlet].pVertex_start] @@ -25,7 +31,8 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): aVertex_downslope_current= [] for pVertex_dummy in aVertex_downslope_table: to_remove = set() - for pFlowline in unfinished_flowlines: + #for pFlowline in unfinished_flowlines: + for pFlowline in vertex_to_flowlines.get(pVertex_dummy, []): # Use the dictionary here if pFlowline.pVertex_end == pVertex_dummy : aVertex_downslope_current.append(pFlowline.pVertex_start) to_remove.add(pFlowline) From d2e73bb420ebfdf39beed38ae163fb03227d45a0 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Thu, 29 Feb 2024 21:32:22 -0800 Subject: [PATCH 12/15] convert O(n2) to O(n) for basin function --- .../algorithms/auxiliary/check_head_water.py | 15 ++--- .../direction/correct_flowline_direction.py | 44 ++++++++----- .../algorithms/index/define_stream_order.py | 63 +++++++----------- .../index/define_stream_segment_index.py | 2 +- .../intersect_flowline_with_flowline.py | 2 +- pyflowline/algorithms/merge/merge_flowline.py | 65 ++++++++---------- .../simplification/remove_small_river.py | 1 - pyflowline/classes/basin.py | 12 ++-- .../formats/convert_flowline_to_geojson.py | 11 ++-- pyflowline/formats/export_flowline.py | 16 ++--- pyflowline/formats/read_flowline.py | 66 ++++++++++++++++--- 11 files changed, 165 insertions(+), 132 deletions(-) diff --git a/pyflowline/algorithms/auxiliary/check_head_water.py b/pyflowline/algorithms/auxiliary/check_head_water.py index 456d7da..198e7cd 100644 --- a/pyflowline/algorithms/auxiliary/check_head_water.py +++ b/pyflowline/algorithms/auxiliary/check_head_water.py @@ -8,7 +8,13 @@ def check_head_water(aFlowline_in, pVertex_start_in): Returns: [int]: [0: not headwater; 1: is headwater] - """ + """ + start_vertices = {flowline.pVertex_start for flowline in aFlowline_in} + end_vertices = {flowline.pVertex_end for flowline in aFlowline_in} + # Check if the vertex is a headwater + is_headwater = pVertex_start_in in start_vertices and pVertex_start_in not in end_vertices + return int(is_headwater) + #nFlowline = len(aFlowline_in) #iFlag_head_water = -1 #iCount = 0 @@ -28,11 +34,4 @@ def check_head_water(aFlowline_in, pVertex_start_in): # #return iFlag_head_water #Create sets of all start and end vertices - start_vertices = {flowline.pVertex_start for flowline in aFlowline_in} - end_vertices = {flowline.pVertex_end for flowline in aFlowline_in} - - # Check if the vertex is a headwater - is_headwater = pVertex_start_in in start_vertices and pVertex_start_in not in end_vertices - - return int(is_headwater) diff --git a/pyflowline/algorithms/direction/correct_flowline_direction.py b/pyflowline/algorithms/direction/correct_flowline_direction.py index bc4dc68..9f5b176 100644 --- a/pyflowline/algorithms/direction/correct_flowline_direction.py +++ b/pyflowline/algorithms/direction/correct_flowline_direction.py @@ -18,33 +18,41 @@ def correct_flowline_direction(aFlowline_in, pVertex_outlet_in): dDiatance_min = dDiatance lIndex_outlet = i - unfinished_flowlines.add(aFlowline_in[i]) - # Update the dictionary - vertex_to_flowlines.setdefault(pFlowline.pVertex_start, []).append(pFlowline) - vertex_to_flowlines.setdefault(pFlowline.pVertex_end, []).append(pFlowline) + for i in range(nFlowline): + if i != lIndex_outlet: + pFlowline = aFlowline_in[i] + unfinished_flowlines.add(aFlowline_in[i]) + # Update the dictionary + vertex_to_flowlines.setdefault(pFlowline.pVertex_start, []).append(pFlowline) + vertex_to_flowlines.setdefault(pFlowline.pVertex_end, []).append(pFlowline) - - unfinished_flowlines.remove(aFlowline_in[lIndex_outlet]) aVertex_downslope_table = [aFlowline_in[lIndex_outlet].pVertex_start] aFlowline_out= [aFlowline_in[lIndex_outlet]] while unfinished_flowlines: - aVertex_downslope_current= [] + aVertex_downslope_current= [] + iCount = 0 for pVertex_dummy in aVertex_downslope_table: to_remove = set() - #for pFlowline in unfinished_flowlines: + #for pFlowline in unfinished_flowlines: for pFlowline in vertex_to_flowlines.get(pVertex_dummy, []): # Use the dictionary here - if pFlowline.pVertex_end == pVertex_dummy : - aVertex_downslope_current.append(pFlowline.pVertex_start) - to_remove.add(pFlowline) - aFlowline_out.append(pFlowline) - else: - if pFlowline.pVertex_start == pVertex_dummy : - pFlowline.reverse() - aVertex_downslope_current.append(pFlowline.pVertex_start) + if pFlowline in unfinished_flowlines: + if pFlowline.pVertex_end == pVertex_dummy : + aVertex_downslope_current.append(pFlowline.pVertex_start) to_remove.add(pFlowline) - aFlowline_out.append(pFlowline) + aFlowline_out.append(pFlowline) + iCount = iCount + 1 + else: + if pFlowline.pVertex_start == pVertex_dummy : + pFlowline.reverse() + aVertex_downslope_current.append(pFlowline.pVertex_start) + to_remove.add(pFlowline) + aFlowline_out.append(pFlowline) + iCount = iCount + 1 - unfinished_flowlines -= to_remove + unfinished_flowlines -= to_remove + + if iCount == 0: + break if len(unfinished_flowlines)==0: break diff --git a/pyflowline/algorithms/index/define_stream_order.py b/pyflowline/algorithms/index/define_stream_order.py index a189f1f..bea6fdc 100644 --- a/pyflowline/algorithms/index/define_stream_order.py +++ b/pyflowline/algorithms/index/define_stream_order.py @@ -11,19 +11,28 @@ pass def update_head_water_stream_order(aFlowline_in): - nFlowline = len(aFlowline_in) - aFlowline_out = list() - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - pVertex_start = pFlowline.pVertex_start - if check_head_water(aFlowline_in, pVertex_start)==1: - pFlowline.iStream_order = 1 - else: - pFlowline.iStream_order = -1 - - aFlowline_out.append(pFlowline) - - return aFlowline_out + start_vertices = {flowline.pVertex_start for flowline in aFlowline_in} + end_vertices = {flowline.pVertex_end for flowline in aFlowline_in} + + for flowline in aFlowline_in: + pVertex_start = flowline.pVertex_start + is_headwater = pVertex_start in start_vertices and pVertex_start not in end_vertices + flowline.iStream_order = 1 if is_headwater else -1 + + return aFlowline_in + + #nFlowline = len(aFlowline_in) + #aFlowline_out = list() + #for i in range(nFlowline): + # pFlowline = aFlowline_in[i] + # pVertex_start = pFlowline.pVertex_start + # if check_head_water(aFlowline_in, pVertex_start)==1: + # pFlowline.iStream_order = 1 + # else: + # pFlowline.iStream_order = -1 + # + # aFlowline_out.append(pFlowline) + #return aFlowline_out def define_stream_order(aFlowline_in, aConfluence_in): @@ -53,19 +62,7 @@ def define_stream_order(aFlowline_in, aConfluence_in): nConfleunce = len(aConfluence_in) aFlag_confluence_treated = np.full(nConfleunce, 0, dtype=int) #build rtree for confluence - index_confluence = RTree( max_cap=5, min_cap=2) - #for i in range(nConfleunce): - # lID = i - # pVertex_confluence = aConfluence_in[i].pVertex_confluence - # x = pVertex_confluence.dLongitude_degree - # y = pVertex_confluence.dLatitude_degree - # left = x - 1E-5 - # right = x + 1E-5 - # bottom = y - 1E-5 - # top = y + 1E-5 - # pBound= (left, bottom, right, top) - # index_confluence.insert(lID, pBound) # - + index_confluence = RTree( max_cap=5, min_cap=2) for i, confluence in enumerate(aConfluence_in): pVertex_confluence = confluence.pVertex_confluence x, y = pVertex_confluence.dLongitude_degree, pVertex_confluence.dLatitude_degree @@ -101,13 +98,7 @@ def define_stream_order(aFlowline_in, aConfluence_in): aFlag_confluence_treated[i] = 1 #now we can process the downstream #get unique value - iStream_order = max(aStrord) if len(set(aStrord)) > 1 else aStrord[0] + 1 - #dummy = np.array(aStrord) - #dummy1 = np.unique(dummy) - #if len(dummy1) == 1: #all upstreams have the same order - # iStream_order = aStrord[0] + 1 - #else: - # iStream_order = np.max(dummy) + iStream_order = max(aStrord) if len(set(aStrord)) > 1 else aStrord[0] + 1 #update pFlowline_downstream.iStream_order = iStream_order @@ -137,11 +128,7 @@ def define_stream_order(aFlowline_in, aConfluence_in): pass - #for i in range(nFlowline): - # pFlowline = aFlowline_in[i] - # pFlowline.iStream_order = aFlowline_in[i].iStream_order - # aFlowline_out.append(pFlowline) - # aStream_order[i] = pFlowline.iStream_order + for i, flowline in enumerate(aFlowline_in): aFlowline_out.append(flowline) aStream_order[i] = flowline.iStream_order diff --git a/pyflowline/algorithms/index/define_stream_segment_index.py b/pyflowline/algorithms/index/define_stream_segment_index.py index 949db3e..fdc35ec 100644 --- a/pyflowline/algorithms/index/define_stream_segment_index.py +++ b/pyflowline/algorithms/index/define_stream_segment_index.py @@ -1,4 +1,4 @@ -#from pyflowline.algorithms.auxiliary.check_head_water import check_head_water + def define_stream_segment_index(aFlowline_in): """build stream segment index, because they are ordered from outlet to headwater, so the index is from 1 to n diff --git a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py index 87ac5e6..55c3a64 100644 --- a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py +++ b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py @@ -90,7 +90,7 @@ def intersect_flowline_with_flowline( sFilename_flowline_a_in, sFilename_flowlin pGeometry_flowline_b = pFeature_flowline_b.GetGeometryRef() if iFlag_id ==1: - lFlowlineID = pFeature_flowline_b.GetField("id") + lFlowlineID = pFeature_flowline_b.GetField("lineid") else: lFlowlineID = -1 diff --git a/pyflowline/algorithms/merge/merge_flowline.py b/pyflowline/algorithms/merge/merge_flowline.py index 61683d8..8bc8aea 100644 --- a/pyflowline/algorithms/merge/merge_flowline.py +++ b/pyflowline/algorithms/merge/merge_flowline.py @@ -37,25 +37,21 @@ def merge_flowline(aFlowline_in, aIndex_middle = np.array(aIndex_middle_in) aIndex_confluence = np.array(aIndex_confluence_in) if aIndex_middle.size == 0: - return aFlowline_in - - #aVertex_headwater=aVertex[aIndex_headwater] - #aVertex_middle=aVertex[aIndex_middle] - #if aIndex_middle.size == 0: - # return aFlowline_in + return aFlowline_in #convert to set aVertex_headwater_set = set(aVertex[aIndex_headwater]) aVertex_middle_set = set(aVertex[aIndex_middle]) if aIndex_confluence.size > 0: - iFlag_confluence = 1 - #aVertex_confluence=aVertex[aIndex_confluence] + iFlag_confluence = 1 aVertex_confluence_set = set(aVertex[aIndex_confluence]) else: iFlag_confluence = 0 - pass + # Build the dictionary + vertex_to_flowline = {flowline.pVertex_end: flowline for flowline in aFlowline_in} + def merge_flowline_reach(lIndex_in, pVertex_start_in): global lID pFlowline = aFlowline_in[lIndex_in] @@ -64,15 +60,20 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in): #while (find_vertex_in_list(aVertex_middle.tolist(), pVertex_current)[0] ==1): while (pVertex_current in aVertex_middle_set): - for j in range(0, nFlowline): - pFlowline2 = aFlowline_in[j] - pVertex_start = pFlowline2.pVertex_start - pVertex_end = pFlowline2.pVertex_end - if pVertex_end == pVertex_current: - pFlowline = pFlowline.merge_upstream(pFlowline2) - pVertex_current = pVertex_start - break - + if pVertex_current in vertex_to_flowline: + pFlowline2 = vertex_to_flowline[pVertex_current] + pFlowline = pFlowline.merge_upstream(pFlowline2) + pVertex_current = pFlowline2.pVertex_start + + #old method + #for j in range(0, nFlowline): + # pFlowline2 = aFlowline_in[j] + # pVertex_start = pFlowline2.pVertex_start + # pVertex_end = pFlowline2.pVertex_end + # if pVertex_end == pVertex_current: + # pFlowline = pFlowline.merge_upstream(pFlowline2) + # pVertex_current = pVertex_start + # break #go to next #if find_vertex_in_list(aVertex_headwater.tolist(), pVertex_current)[0] ==1: @@ -97,26 +98,8 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in): pVertex_end = pFlowline3.pVertex_end if pVertex_end == pVertex_current: merge_flowline_reach(k, pVertex_start) - - - #find outlet - #iFlag_first=1 - #for i in range(nFlowline): - # pFlowline = aFlowline_in[i] - # pVertex_start = pFlowline.pVertex_start - # pVertex_end = pFlowline.pVertex_end - # dDiatance = pVertex_end.calculate_distance( pVertex_outlet_in) - # if iFlag_first ==1: - # dDiatance_min = dDiatance - # lIndex_outlet = i - # iFlag_first=0 - # else: - # if dDiatance < dDiatance_min: - # dDiatance_min = dDiatance - # lIndex_outlet = i - # pass - # else: - # pass + + #find outlet dDiatance_min = float('inf') for i in range(nFlowline): @@ -131,11 +114,15 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in): pVertex_start = pFlowline.pVertex_start pVertex_end = pFlowline.pVertex_end + + #now start from outlet if iFlag_confluence == 1: #check whether outlet is a confluence #if (find_vertex_in_list(aVertex_confluence.tolist(), pVertex_end)[0] ==1): if pVertex_end in aVertex_confluence_set: + #if pVertex_end in end_vertex_to_flowline: + # merge_flowline_reach(end_vertex_to_flowline[pVertex_end], pVertex_start_dummy) for i in range(nFlowline): pFlowline = aFlowline_in[i] pVertex_start_dummy = pFlowline.pVertex_start @@ -143,7 +130,7 @@ def merge_flowline_reach(lIndex_in, pVertex_start_in): if pVertex_end == pVertex_end_dummy: #this is merge_flowline_reach(i, pVertex_start_dummy) - pass + else: merge_flowline_reach(lIndex_outlet, pVertex_start) else: diff --git a/pyflowline/algorithms/simplification/remove_small_river.py b/pyflowline/algorithms/simplification/remove_small_river.py index 6e782bc..0ff1278 100644 --- a/pyflowline/algorithms/simplification/remove_small_river.py +++ b/pyflowline/algorithms/simplification/remove_small_river.py @@ -1,4 +1,3 @@ -from pyflowline.algorithms.auxiliary.check_head_water import check_head_water def remove_small_river(aFlowline_in, dThreshold_in): """Remove small river that meet the threshold and headwater requirement, also dam flowline are reserved diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 120f2c5..70f143c 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -359,7 +359,8 @@ def basin_flowline_simplification(self): ptimer = pytimer() if self.iFlag_dam == 1: - sFilename_flowline_filter = self.sFilename_flowline_filter + #sFilename_flowline_filter = self.sFilename_flowline_filter + sFilename_flowline_filter = self.sFilename_flowline_filter_geojson aFlowline_basin_filtered_raw, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) aVertex_filtered = find_flowline_vertex(aFlowline_basin_filtered_raw) @@ -460,8 +461,8 @@ def basin_flowline_simplification(self): print('Basin ', self.sBasinID, ' has dam', nFlowline_before, nFlowline_after) ptimer.stop() else: - print('Basin ', self.sBasinID, ' has no dam') - sFilename_flowline_filter = self.sFilename_flowline_filter + print('Basin ', self.sBasinID, ' has no dam') + sFilename_flowline_filter = self.sFilename_flowline_filter_geojson #sFilename_flowline_filter = self.sFilename_flowline_filter aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter ) #aVertex_filtered = find_flowline_vertex(aFlowline_basin_filtered) @@ -618,7 +619,7 @@ def basin_flowline_simplification(self): pass #the final vertex info - print('Basin ', self.sBasinID, 'find flowline confluence') + print('Basin ', self.sBasinID, 'find flowline confluence') sys.stdout.flush() ptimer.start() aVertex, lIndex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence, aConnectivity, pVertex_outlet = find_flowline_confluence(aFlowline_basin_simplified, pVertex_outlet) @@ -941,7 +942,6 @@ def basin_build_confluence(self, aFlowline_basin_in, aVertex_confluence_in): return aConfluence_basin - def basin_analyze(self): """ Analyze the basin results including length, sinuosity, and breaching angle @@ -1101,7 +1101,7 @@ def tojson(self): """ aSkip = ['aFlowline_basin_filtered', \ 'aFlowline_basin_simplified','aFlowline_basin_conceptual','aConfluence_basin_simplified', - 'aConfluence_basin_conceptual','pRTree_flowline', 'pRTree_edge'] + 'aConfluence_basin_conceptual','pRTree_flowline', 'pRTree_edge','aFlowline_basin_edge'] obj = self.__dict__.copy() for sKey in aSkip: diff --git a/pyflowline/formats/convert_flowline_to_geojson.py b/pyflowline/formats/convert_flowline_to_geojson.py index f7e81bf..74cfe9b 100644 --- a/pyflowline/formats/convert_flowline_to_geojson.py +++ b/pyflowline/formats/convert_flowline_to_geojson.py @@ -22,11 +22,15 @@ def convert_flowline_to_geojson(iFlag_type_in, sFilename_geojson_in, sFilename_g pass else: if iFlag_type_in == 1: - - aFlowline_basin, pSpatial_reference = read_flowline_geojson( sFilename_geojson_in ) + sFilename_dummy = sFilename_geojson_out + sFilename_out = sFilename_dummy.replace('.geojson', '_withID.geojson') + aFlowline_basin, pSpatial_reference = read_flowline_geojson( sFilename_geojson_in , sFilename_out = sFilename_out) + #get lineid + aFlowlineID = [pFlowline.lFlowlineID for pFlowline in aFlowline_basin] #convert it iFlag_projected = 0 - export_flowline_to_geojson(aFlowline_basin, sFilename_geojson_out) + export_flowline_to_geojson(aFlowline_basin, sFilename_geojson_out, aAttribute_field=['lineid'], + aAttribute_dtype=['int'], aAttribute_data=[aFlowlineID]) else: if iFlag_type_in == 2: #polygon @@ -56,7 +60,6 @@ def convert_shapefile_to_geojson(iFlag_type_in, sFilename_shapefile_in, sFilenam else: if iFlag_type_in == 1: aFlowline_basin, pSpatial_reference = read_flowline_shapefile( sFilename_shapefile_in ) - #aFlowline_basin, pSpatial_reference = read_flowline_geojson( sFilename_shapefile_in ) #convert it iFlag_projected = 0 diff --git a/pyflowline/formats/export_flowline.py b/pyflowline/formats/export_flowline.py index 5c99293..0bd297b 100644 --- a/pyflowline/formats/export_flowline.py +++ b/pyflowline/formats/export_flowline.py @@ -53,8 +53,8 @@ def export_flowline_to_geojson( aFlowline_in, # pass if iFlag_attribute: - nAttribute1, nAttribute2, nAttribute3, nAttribute4 = map(len, [aAttribute_field, aAttribute_data, aAttribute_dtype, aAttribute_data[0]]) - if not nAttribute1 == nAttribute2 == nAttribute3 == nFlowline == nAttribute4: + nAttribute1, nAttribute2, nAttribute3 = map(len, [aAttribute_field, aAttribute_data, aAttribute_dtype]) + if not nAttribute1 == nAttribute2 == nAttribute3 and nFlowline != len(aAttribute_data[0]): print('The attribute is not correct, please check!') return @@ -112,20 +112,20 @@ def export_flowline_to_geojson( aFlowline_in, pGeometry_out = ogr.CreateGeometryFromWkb(pLine.ExportToWkb()) pFeature_out.SetGeometry(pGeometry_out) pFeature_out.SetField("lineid", lID) + #if iFlag_attribute == 1: # for k in range(nAttribute1): # sField = aAttribute_field[k] # dtype = aAttribute_dtype[k] # dummy = aAttribute_data[k] # if dtype == 'int': - # pFeature_out.SetField(sField, int(dummy[i])) + # pFeature_out.SetField(sField, int(dummy[lID])) # else: - # pFeature_out.SetField(sField, float(dummy[i])) + # pFeature_out.SetField(sField, float(dummy[lID])) - - if iFlag_attribute: - for field, dtype, data in zip(aAttribute_field, aAttribute_dtype, aAttribute_data): - pFeature_out.SetField(field, dtype_to_ogr[dtype](data[lID])) + if iFlag_attribute == 1: + for sField, dtype, dummy in zip(aAttribute_field, aAttribute_dtype, aAttribute_data): + pFeature_out.SetField(sField, int(dummy[lID]) if dtype == 'int' else float(dummy[lID])) # Add new pFeature_shapefile to output Layer pLayer_json.CreateFeature(pFeature_out) diff --git a/pyflowline/formats/read_flowline.py b/pyflowline/formats/read_flowline.py index 8405847..5ecab91 100644 --- a/pyflowline/formats/read_flowline.py +++ b/pyflowline/formats/read_flowline.py @@ -1,4 +1,5 @@ import os +import json import numpy as np from osgeo import ogr, osr, gdal from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_flowline @@ -147,12 +148,11 @@ def read_flowline_shapefile_swat(sFilename_shapefile_in): return aFlowline, pSpatialRef_shapefile -def read_flowline_geojson(sFilename_geojson_in): +def read_flowline_geojson(sFilename_geojson_in, sFilename_out = None): """ read a geojson flowline This function should be used for stream flowline only. """ - aFlowline=list() pDriver_geojson = ogr.GetDriverByName('GeoJSON') if os.path.isfile(sFilename_geojson_in): @@ -161,11 +161,51 @@ def read_flowline_geojson(sFilename_geojson_in): else: print('This geojson file does not exist: ', sFilename_geojson_in ) exit() + + if sFilename_out is not None: + # Open the GeoJSON file + dataSource = pDriver_geojson.Open(sFilename_geojson_in, 1) # 1 means writable + # Get the layer + layer = dataSource.GetLayer() + if os.path.exists(sFilename_out): + os.remove(sFilename_out) + + # Create a new GeoJSON file + new_dataSource = pDriver_geojson.CreateDataSource(sFilename_out) + + # Create a new layer with the same definition as the original layer + new_layer = new_dataSource.CreateLayer(layer.GetName(), layer.GetSpatialRef(), ogr.wkbMultiLineString) + + # Add fields to the new layer + layer_defn = layer.GetLayerDefn() + for i in range(layer_defn.GetFieldCount()): + new_layer.CreateField(layer_defn.GetFieldDefn(i)) + + # Check if the field exists + field_names = [field.name for field in new_layer.schema] + + if "lineid" not in field_names: + # Add a new field + new_field = ogr.FieldDefn("lineid", ogr.OFTInteger) + new_layer.CreateField(new_field) + + # Copy features from the original layer to the new layer and assign an ID to each feature + for i, feature in enumerate(layer): + new_feature = ogr.Feature(new_layer.GetLayerDefn()) + new_feature.SetFrom(feature) + new_feature.SetField("lineid", i + 1) + new_layer.CreateFeature(new_feature) + + # Save and close the data sources + dataSource = None + new_dataSource = None + sFilename_geojson_in = sFilename_out #use this dataset because it has lineid + pDataset_geojson = pDriver_geojson.Open(sFilename_geojson_in, gdal.GA_ReadOnly) pLayer_geojson = pDataset_geojson.GetLayer(0) pSpatialRef_geojson = pLayer_geojson.GetSpatialRef() ldefn = pLayer_geojson.GetLayerDefn() - schema =list() + schema = list() for n in range(ldefn.GetFieldCount()): fdefn = ldefn.GetFieldDefn(n) schema.append(fdefn.name) @@ -190,8 +230,11 @@ def read_flowline_geojson(sFilename_geojson_in): lFlowlineIndex = 0 lFlowlineID = 1 lVertexID = 1 - for pFeature_geojson in pLayer_geojson: - #pGeometry_geojson = pFeature_geojson.GetGeometryRef() + nFeature = pLayer_geojson.GetFeatureCount() + #for pFeature_geojson in pLayer_geojson: + #pGeometry_geojson = pFeature_geojson.GetGeometryRef() + for iFeature in range(nFeature): + pFeature_geojson = pLayer_geojson.GetFeature(iFeature) pGeometry_in = pFeature_geojson.GetGeometryRef() sGeometry_type = pGeometry_in.GetGeometryName() if iFlag_segment ==1: @@ -207,6 +250,7 @@ def read_flowline_geojson(sFilename_geojson_in): if iFlag_id ==1: lFlowlineID = pFeature_geojson.GetField("lineid") else: + lFlowlineID=-1 pass if iFlag_NHDPlusID ==1: @@ -226,7 +270,10 @@ def read_flowline_geojson(sFilename_geojson_in): pFlowline.lNHDPlusID= lNHDPlusID aFlowline.append(pFlowline) lFlowlineIndex = lFlowlineIndex + 1 - lFlowlineID = lFlowlineID + 1 #careful + if iFlag_id !=1: + lFlowlineID = lFlowlineID + 1 #careful + else: + print('Error in reading multi flowline: ', iFeature, i, aCoords) else: if sGeometry_type =='LINESTRING': @@ -240,10 +287,13 @@ def read_flowline_geojson(sFilename_geojson_in): pFlowline.lNHDPlusID = lNHDPlusID aFlowline.append(pFlowline) lFlowlineIndex = lFlowlineIndex + 1 - lFlowlineID = lFlowlineID + 1 #careful + if iFlag_id !=1: + lFlowlineID = lFlowlineID + 1 #careful + else: + print('Error in reading single flowline: ', iFeature) else: print(sGeometry_type) pass - return aFlowline, pSpatialRef_geojson \ No newline at end of file + return aFlowline, pSpatialRef_geojson From ffbc4603566d3c3f46a122027bb4fa9d5d4d4e82 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Fri, 1 Mar 2024 09:57:49 -0800 Subject: [PATCH 13/15] optimize the reconstruct algorithm --- .../auxiliary/find_index_in_list.py | 50 +++----- .../remove_duplicate_flowline.py | 21 ++- .../remove_returning_flowline.py | 121 ++++-------------- pyflowline/classes/basin.py | 43 +++++-- pyflowline/classes/edge.py | 4 +- pyflowline/classes/flowline.py | 30 +---- pyflowline/classes/pycase.py | 7 +- .../mesh/hexagon/create_hexagon_mesh.py | 11 +- 8 files changed, 94 insertions(+), 193 deletions(-) diff --git a/pyflowline/algorithms/auxiliary/find_index_in_list.py b/pyflowline/algorithms/auxiliary/find_index_in_list.py index 601c0f2..4bb2489 100644 --- a/pyflowline/algorithms/auxiliary/find_index_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_index_in_list.py @@ -1,7 +1,5 @@ import copy import numpy as np - - import importlib iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: @@ -27,10 +25,10 @@ def find_vertex_on_edge(aVertex_in, pEdge_in): lID = i x = aVertex_in[i].dLongitude_degree y = aVertex_in[i].dLatitude_degree - left= x - 1E-5 - right= x + 1E-5 - bottom= y-1E-5 - top= y+1E-5 + left = x - 1E-5 + right = x + 1E-5 + bottom = y - 1E-5 + top = y + 1E-5 pBound= (left, bottom, right, top) index_vertex.insert(lID, pBound) # pass @@ -111,13 +109,7 @@ def find_edge_in_list(aEdge_in, pEdge_in): iFlag_exist = 1 lIndex = i break - else: - pass - - pass - - else: - pass + return iFlag_exist, lIndex @@ -142,14 +134,7 @@ def find_flowline_in_list(aFlowline_in, pFlowline_in): if pFlowline == pFlowline_in: iFlag_exist = 1 lIndex = i - break - else: - pass - - pass - - else: - pass + break return iFlag_exist, lIndex @@ -169,10 +154,7 @@ def find_hexagon_through_edge(aHexagon_in, pEdge_in): for i in range(nHexagon): pHexagon = aHexagon_in[i] if pHexagon.has_this_edge(pEdge_in) ==1: - aHexagon_out.append(pHexagon) - pass - else: - pass + aHexagon_out.append(pHexagon) return aHexagon_out @@ -182,15 +164,15 @@ def check_if_duplicates(aList_in): Returns: [type]: [description] """ - iFlag_unique = 1 - for elem in aList_in: - if aList_in.count(elem) > 1: - iFlag_unique = 0 - break - else: - pass - - return iFlag_unique + #iFlag_unique = 1 + #for elem in aList_in: + # if aList_in.count(elem) > 1: + # iFlag_unique = 0 + # break + # else: + # pass + #return iFlag_unique + return int(len(aList_in) == len(set(aList_in))) def add_unique_vertex(aVertex_in, pVertex_in, dThreshold_in = 1.0E-6): diff --git a/pyflowline/algorithms/simplification/remove_duplicate_flowline.py b/pyflowline/algorithms/simplification/remove_duplicate_flowline.py index efabb17..bebe2af 100644 --- a/pyflowline/algorithms/simplification/remove_duplicate_flowline.py +++ b/pyflowline/algorithms/simplification/remove_duplicate_flowline.py @@ -1,16 +1,13 @@ +#from pyflowline.algorithms.auxiliary.find_index_in_list import find_flowline_in_list -from pyflowline.algorithms.auxiliary.find_index_in_list import find_flowline_in_list def remove_duplicate_flowline(aFlowline_in): - aFlowline_out = list() - nFlowline = len(aFlowline_in) - for i in range(nFlowline): - pFlowline = aFlowline_in[i] - iFlag_exist, lIndex = find_flowline_in_list( aFlowline_out, pFlowline) - if iFlag_exist ==1: - pass - else: - aFlowline_out.append(pFlowline) - pass - return aFlowline_out \ No newline at end of file + aFlowline_out = set(aFlowline_in) + return list(aFlowline_out) + #aFlowline_out = [] + #for pFlowline in aFlowline_in: + # iFlag_exist, _ = find_flowline_in_list(aFlowline_out, pFlowline) + # if iFlag_exist == 0: + # aFlowline_out.append(pFlowline) + #return aFlowline_out \ No newline at end of file diff --git a/pyflowline/algorithms/simplification/remove_returning_flowline.py b/pyflowline/algorithms/simplification/remove_returning_flowline.py index 94da824..57d62c0 100644 --- a/pyflowline/algorithms/simplification/remove_returning_flowline.py +++ b/pyflowline/algorithms/simplification/remove_returning_flowline.py @@ -1,7 +1,6 @@ import copy import numpy as np from pyflowline.formats.convert_coordinates import convert_gcs_coordinates_to_flowline -from pyflowline.algorithms.auxiliary.find_index_in_list import check_if_duplicates def remove_returning_flowline(iMesh_type_in, aCell_intersect_in, pVertex_outlet_in): aFlowline_out=list() @@ -9,8 +8,8 @@ def remove_returning_flowline(iMesh_type_in, aCell_intersect_in, pVertex_outlet_ def simplify_list(aCell_flowline_in): aCell_flowline_out = copy.deepcopy(aCell_flowline_in) nCell2 = len(aCell_flowline_out) - iFlag_unique = check_if_duplicates(aCell_flowline_out) - if iFlag_unique == 1: + #iFlag_unique = check_if_duplicates(aCell_flowline_out) + if int(len(aCell_flowline_out) == len(set(aCell_flowline_out))) : return aCell_flowline_out else: for i in range(nCell2): @@ -20,47 +19,13 @@ def simplify_list(aCell_flowline_in): start = dummy[0] end = dummy[-1] del aCell_flowline_out[start: end] - break - else: - pass - - pass + break aCell_flowline_out = simplify_list(aCell_flowline_out) return aCell_flowline_out - - def simplify_list2(aCell_flowline_in): - aCell_flowline_out = copy.deepcopy(aCell_flowline_in) - nCell = len(aCell_flowline_out) - - # Check if list contains duplicates - iFlag_unique = check_if_duplicates(aCell_flowline_out) - if iFlag_unique == 1: - return aCell_flowline_out - - # Create a dictionary to store counts of elements - elem_counts = {} - for elem in aCell_flowline_out: - elem_counts[elem] = elem_counts.get(elem, 0) + 1 - - i = 0 - while i < nCell - 1: - elem = aCell_flowline_out[i] - if elem_counts[elem] > 1: - indices = [j for j, x in enumerate(aCell_flowline_out) if x == elem] - start = indices[0] - end = indices[-1] - del aCell_flowline_out[start + 1 : end] - nCell = len(aCell_flowline_out) - else: - i += 1 - - return aCell_flowline_out - + def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end_in): - lCellID =-1 - if iSegment_in == 608: - print('here') + lCellID =-1 iFlag_found = 1 pVertex_end_current = pVertex_end_in aCell_flowline=list() @@ -70,15 +35,10 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end iFlag_skip = 0 iFlag_previous_overlap=0 while iFlag_found == 1: - iFlag_found = 0 - #if lCellID == 110191: - # print('here') - # pass + iFlag_found = 0 for j in range(nCell): pCell = aCell_intersect_in[j] - lCellID = pCell.lCellID - #if lCellID == 110921: - # print('here') + lCellID = pCell.lCellID aFlowline= pCell.aFlowline nFlowline = len(aFlowline) for i in range(nFlowline): @@ -92,13 +52,11 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end dLength = pFlowline.dLength iFlag_found2, dummy2 = pCell.which_edge_cross_this_vertex(pVertex_start) iFlag_found3, dummy3 = pCell.which_edge_cross_this_vertex(pVertex_end) - if iFlag_found2 == 1 and iFlag_found3 == 1: #on the edge #same edge if dummy2.is_overlap(dummy3) ==1: pVertex_end_current = pVertex_start - aCell_flowline.append(lCellID) - #print(lCellID) + aCell_flowline.append(lCellID) iFlag_found = 1 iFlag_previous_overlap =1 @@ -108,8 +66,7 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end pVertex_end_current = pVertex_start iFlag_found = 1 if iFlag_previous_overlap ==1: - aCell_flowline.append(lCellID) - #print(lCellID) + aCell_flowline.append(lCellID) iFlag_previous_overlap=0 pass else: @@ -119,20 +76,14 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end else: pVertex_end_current = pVertex_start aCell_flowline.append(lCellID) - #print(lCellID) - iFlag_found = 1 - pass - - pass - - pass + iFlag_found = 1 + else: pVertex_end_current = pVertex_start aCell_flowline.append(lCellID) iFlag_found = 1 - iFlag_previous_overlap=0 - pass + iFlag_previous_overlap=0 break @@ -159,11 +110,7 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end #should have finished search if iFlag_found == 0: #reverse - aCell_flowline = aCell_flowline[::-1] - #if 112378 in aCell_flowline: - # print(aCell_flowline) - # print('here') - # pass + aCell_flowline = aCell_flowline[::-1] #simplify list aCell_simple = simplify_list(aCell_flowline) #save the output @@ -177,7 +124,7 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end x = aCell_intersect_in[j].dLongitude_center_degree y = aCell_intersect_in[j].dLatitude_center_degree aCoordinates.append([x,y]) - pass + pFlowline = convert_gcs_coordinates_to_flowline(aCoordinates) pFlowline.iStream_segment = iSegment_in pFlowline.iStream_order=iStream_order_in @@ -192,36 +139,17 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end pass return - - #starting from the outlet - dDiatance_min=0.0 - iFlag_first=1 - for j in range(nCell): - pCell = aCell_intersect_in[j] - aFlowline= pCell.aFlowline - nFlowline = len(aFlowline) - for i in range(nFlowline): - pFlowline = aFlowline[i] - pVertex_start = pFlowline.pVertex_start - pVertex_end = pFlowline.pVertex_end - dDiatance = pVertex_end.calculate_distance( pVertex_outlet_in) - if iFlag_first ==1: - dDiatance_min = dDiatance - lCellID_outlet = pCell.lCellID + + dDiatance_min = float('inf') + lCellID_outlet = lCellID_outlet2 = lCellID_outlet3 = None + for j, pCell in enumerate(aCell_intersect_in): + for i, pFlowline in enumerate(pCell.aFlowline): + dDiatance = pFlowline.pVertex_end.calculate_distance(pVertex_outlet_in) + if dDiatance < dDiatance_min: + dDiatance_min = dDiatance + lCellID_outlet = pCell.lCellID lCellID_outlet2 = j lCellID_outlet3 = i - iFlag_first=0 - else: - if dDiatance < dDiatance_min: - dDiatance_min = dDiatance - lCellID_outlet = pCell.lCellID - lCellID_outlet2 = j - lCellID_outlet3 = i - pass - else: - pass - - pass #loop through pFlowline = aCell_intersect_in[lCellID_outlet2].aFlowline[lCellID_outlet3] @@ -231,4 +159,7 @@ def retrieve_flowline_intersect_index(iSegment_in, iStream_order_in, pVertex_end retrieve_flowline_intersect_index(iStream_segment, iStream_order, pVertex_outlet) + #update outlet location since the conceptual flowline use center + pVertex_outlet = aFlowline_out[0].pVertex_end + return aFlowline_out, lCellID_outlet, pVertex_outlet diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 70f143c..d955743 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -96,6 +96,7 @@ class pybasin(object): sBasinID='' lCellID_outlet=-1 iFlag_debug = 0 + iFlag_simplification_done = 0 iFlag_disconnected =0 iFlag_remove_small_river = 0 iFlag_remove_low_order_river = 0 @@ -533,7 +534,9 @@ def basin_flowline_simplification(self): aFlowline_basin_simplified = correct_flowline_direction(aFlowline_basin_simplified, pVertex_outlet ) nFlowline_after = len(aFlowline_basin_simplified) ptimer.stop() + #update outlet pVertex_outlet = aFlowline_basin_simplified[0].pVertex_end + print(pVertex_outlet.dLongitude_degree, pVertex_outlet.dLatitude_degree) self.pVertex_outlet = pVertex_outlet if self.iFlag_debug ==1: sFilename_out = 'flowline_direction_before_intersect.geojson' @@ -685,6 +688,8 @@ def basin_flowline_simplification(self): self.aFlowline_basin_simplified= aFlowline_basin_simplified print('Finish flowline simplification:', self.sBasinID) sys.stdout.flush() + + self.iFlag_simplification_done = 1 return aFlowline_basin_simplified def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh): @@ -719,19 +724,25 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) except: print('Error in flowline and mesh intersection.') - - point= dict() - point['dLongitude_degree'] = self.dLongitude_outlet_degree - point['dLatitude_degree'] = self.dLatitude_outlet_degree - pVertex_outlet_initial=pyvertex(point) + #not an ideal setup, but it could be improved + if self.iFlag_simplification_done ==1: + pVertex_outlet_initial = self.pVertex_outlet + else: + point= dict() + point['dLongitude_degree'] = self.dLongitude_outlet_degree + point['dLatitude_degree'] = self.dLatitude_outlet_degree + pVertex_outlet_initial=pyvertex(point) #from this point, aFlowline_basin is conceptual #segment based try: - print('Basin ', self.sBasinID, 'Start return flowline removal') + print('Basin ', self.sBasinID, 'Start return flowline removal') sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual, lCellID_outlet, pVertex_outlet = remove_returning_flowline(iMesh_type, aCell_intersect_basin, pVertex_outlet_initial) + print('Outlet ID', lCellID_outlet) + #this outlet is the one intersect outlet cell, not cell center + print('Outlet location', pVertex_outlet.dLongitude_degree, pVertex_outlet.dLatitude_degree) ptimer.stop() if self.iFlag_debug ==1: sFilename_out = 'flowline_simplified_after_intersect.geojson' @@ -772,7 +783,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Basin ', self.sBasinID, 'Start flowline direction correction') sys.stdout.flush() ptimer.start() - aFlowline_basin_conceptual = correct_flowline_direction(aFlowline_basin_conceptual, pVertex_outlet ) + aFlowline_basin_conceptual = correct_flowline_direction(aFlowline_basin_conceptual, pVertex_outlet) ptimer.stop() if self.iFlag_debug ==1: sFilename_out = 'flowline_edge_correct_flowline_direction.geojson' @@ -818,7 +829,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Basin ', self.sBasinID, 'Start merge flowline') sys.stdout.flush() ptimer.start() - aFlowline_basin_conceptual = merge_flowline( aFlowline_basin_conceptual,aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) + aFlowline_basin_conceptual = merge_flowline( aFlowline_basin_conceptual, aVertex, pVertex_outlet, aIndex_headwater,aIndex_middle, aIndex_confluence ) ptimer.stop() except: print('Error in merge_flowline.') @@ -872,9 +883,13 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) self.aFlowline_basin_conceptual = aFlowline_basin_conceptual self.aFlowline_basin_edge = aFlowline_basin_edge + #check whether they are changed or not + self.pVertex_outlet = pVertex_outlet self.lCellID_outlet = lCellID_outlet self.dLongitude_outlet_degree = pVertex_outlet.dLongitude_degree self.dLatitude_outlet_degree = pVertex_outlet.dLatitude_degree + print('Outlet ID', lCellID_outlet) + print('Outlet location', pVertex_outlet.dLongitude_degree, pVertex_outlet.dLatitude_degree) print('Finish topology reconstruction:', self.sBasinID) sys.stdout.flush() @@ -951,12 +966,14 @@ def basin_analyze(self): sFilename_flowline_filter = self.sFilename_flowline_filter sFilename_flowline_filter_geojson = self.sFilename_flowline_filter_geojson self.aFlowline_basin_filtered, pSpatial_reference = read_flowline_geojson( sFilename_flowline_filter_geojson ) - self.dLength_flowline_filtered = self.calculate_flowline_length(self.aFlowline_basin_filtered) + self.dLength_flowline_filtered = self.basin_calculate_flowline_length(self.aFlowline_basin_filtered) + #maybe we should use the exisitng result point= dict() point['dLongitude_degree'] = self.dLongitude_outlet_degree point['dLatitude_degree'] = self.dLatitude_outlet_degree pVertex_outlet_initial=pyvertex(point) + if self.aFlowline_basin_simplified is None: sFilename_flowline_in = self.sFilename_flowline_simplified aFlowline_simplified,pSpatial_reference = read_flowline_geojson( sFilename_flowline_in ) @@ -970,7 +987,7 @@ def basin_analyze(self): aVertex_confluence = aVertex[aIndex_confluence] self.aConfluence_basin_simplified = self.build_confluence(self.aFlowline_basin_simplified, aVertex_confluence) - self.dLength_flowline_simplified = self.calculate_flowline_length(self.aFlowline_basin_simplified) + self.dLength_flowline_simplified = self.basin_calculate_flowline_length(self.aFlowline_basin_simplified) if self.aFlowline_basin_conceptual is None: sFilename_flowline_in = self.sFilename_flowline_conceptual @@ -985,9 +1002,9 @@ def basin_analyze(self): aVertex_confluence = aVertex[aIndex_confluence] self.aConfluence_basin_conceptual = self.build_confluence(self.aFlowline_basin_conceptual, aVertex_confluence) - self.dLength_flowline_conceptual = self.calculate_flowline_length(self.aFlowline_basin_conceptual) - self.calculate_river_sinuosity() - self.calculate_confluence_branching_angle() + self.dLength_flowline_conceptual = self.basin_calculate_flowline_length(self.aFlowline_basin_conceptual) + self.basin_calculate_river_sinuosity() + self.basin_calculate_confluence_branching_angle() return def basin_export(self): diff --git a/pyflowline/classes/edge.py b/pyflowline/classes/edge.py index 932aaaa..77cc731 100644 --- a/pyflowline/classes/edge.py +++ b/pyflowline/classes/edge.py @@ -263,12 +263,12 @@ def __eq__(self, other): Args: other (pyedge): The other edge + how about direction? Returns: int: 1 if equivalent; 0 if not """ - iFlag_overlap = self.is_overlap(other) - return iFlag_overlap + return int( self.pVertex_start == other.pVertex_start and self.pVertex_end == other.pVertex_end ) def __ne__(self, other): """ diff --git a/pyflowline/classes/flowline.py b/pyflowline/classes/flowline.py index 1815cd1..d7f4e86 100644 --- a/pyflowline/classes/flowline.py +++ b/pyflowline/classes/flowline.py @@ -101,11 +101,6 @@ def __init__(self, aEdge): def __hash__(self): return hash((self.pVertex_start, self.pVertex_end)) - def __eq__(self, other): - if isinstance(other, pyflowline): - return self.pVertex_start == other.pVertex_start and self.pVertex_end == other.pVertex_end and self.aVertex == other.aVertex - return False - def calculate_length(self): """ Calcualte the length @@ -306,30 +301,17 @@ def calculate_flowline_sinuosity(self): def __eq__(self, other): """ Check whether two flowline are equivalent - + Args: other (pyflowline): The other flowline - + Returns: int: 1 if equivalent, 0 if not """ - iFlag_overlap = 0 - nEdge1 = self.nEdge - nEdge2 = other.nEdge - if nEdge1 == nEdge2: - for i in np.arange( nEdge1): - pEdge1 = self.aEdge[i] - pEdge2 = other.aEdge[i] - if pEdge1 == pEdge2: - iFlag_overlap =1 - else: - iFlag_overlap =0 - break - - else: - iFlag_overlap = 0 - - return iFlag_overlap + if len(self.aEdge) != len(other.aEdge): + return 0 + + return int(all(edge1 == edge2 for edge1, edge2 in zip(self.aEdge, other.aEdge))) def __ne__(self, other): """ diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 3109a48..23032af 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -913,8 +913,7 @@ def pyflowline_reconstruct_topological_relationship(self): aBasin = list() aCell_intersect=list() ncell=len(self.aCell) - #there is a one-to-one match between cell id and cell center because each cell has only one center - + #there is a one-to-one match between cell id and cell center because each cell has only one center for pBasin in self.aBasin: aCell_intersect_basin = pBasin.basin_reconstruct_topological_relationship(iMesh_type,sFilename_mesh) @@ -922,7 +921,6 @@ def pyflowline_reconstruct_topological_relationship(self): aBasin.append(pBasin) aCellID_outlet.append(pBasin.lCellID_outlet) aCell_intersect = aCell_intersect + aCell_intersect_basin - if iFlag_use_rtree == 1: #use rtree to update topology and length for pFlowline in pBasin.aFlowline_basin_conceptual: @@ -1041,7 +1039,8 @@ def pyflowline_analyze(self): """ if self.iFlag_flowline == 1: for pBasin in self.aBasin: - pBasin.analyze() + #pBasin.basin_analyze() + pass return def pyflowline_setup(self): diff --git a/pyflowline/mesh/hexagon/create_hexagon_mesh.py b/pyflowline/mesh/hexagon/create_hexagon_mesh.py index 0d42bca..d00038e 100644 --- a/pyflowline/mesh/hexagon/create_hexagon_mesh.py +++ b/pyflowline/mesh/hexagon/create_hexagon_mesh.py @@ -156,10 +156,7 @@ def add_cell_into_list1(aList, lCellID, iRow, iColumn, dLongitude_center, dLatit iColumn_dummy = iColumn - 1 lCellID6 = (iRow_dummy-1) * ncolumn_in + iColumn_dummy aNeighbor.append(lCellID6) - - if check_if_duplicates(aNeighbor) == 0: - print('error') - + pHexagon.aNeighbor = aNeighbor pHexagon.nNeighbor = len(aNeighbor) pHexagon.aNeighbor_land= aNeighbor @@ -235,11 +232,7 @@ def add_cell_into_list2(aList, lCellID, iRow, iColumn, dLongitude_center, dLatit iColumn_dummy = iColumn - 1 lCellID6 = (iRow_dummy-1) * ncolumn_in + iColumn_dummy aNeighbor.append(lCellID6) - - - if check_if_duplicates(aNeighbor) == 0: - print('error') - + pHexagon.aNeighbor = aNeighbor pHexagon.nNeighbor = len(aNeighbor) pHexagon.aNeighbor_land= aNeighbor From 6164077098e92405a022ec89402f2b392e6985ff Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Fri, 12 Apr 2024 21:21:14 -0700 Subject: [PATCH 14/15] fix various small issues --- notebooks/mpas_example.ipynb | 2 +- .../auxiliary/calculate_area_of_difference.py | 2 +- .../auxiliary/find_index_in_list.py | 2 +- .../auxiliary/find_vertex_in_list.py | 2 +- .../algorithms/index/define_stream_order.py | 2 +- .../intersect_flowline_with_flowline.py | 2 +- .../intersect/intersect_flowline_with_mesh.py | 2 +- pyflowline/algorithms/merge/merge_flowline.py | 2 +- .../remove_returning_flowline.py | 1 + .../split/find_flowline_confluence.py | 2 +- .../algorithms/split/find_flowline_vertex.py | 2 +- pyflowline/algorithms/split/split_flowline.py | 2 +- pyflowline/classes/_visual_basin.py | 214 ++++++++++++------ pyflowline/classes/basin.py | 32 ++- pyflowline/classes/confluence.py | 2 +- pyflowline/classes/edge.py | 2 +- pyflowline/classes/pycase.py | 2 +- pyflowline/classes/vertex.py | 2 +- pyflowline/formats/convert_coordinates.py | 2 +- pyflowline/mesh/dggrid/create_dggrid_mesh.py | 42 ++-- .../mesh/hexagon/create_hexagon_mesh.py | 4 +- pyflowline/mesh/mpas/create_mpas_mesh.py | 9 +- 22 files changed, 218 insertions(+), 116 deletions(-) diff --git a/notebooks/mpas_example.ipynb b/notebooks/mpas_example.ipynb index 5ba8c90..982c873 100644 --- a/notebooks/mpas_example.ipynb +++ b/notebooks/mpas_example.ipynb @@ -40,7 +40,7 @@ "import sys\n", "from pathlib import Path\n", "from os.path import realpath\n", - "import importlib\n", + "import importlib.util\n", "#check dependencies\n", "\n", "iFlag_numpy = importlib.util.find_spec(\"numpy\")\n", diff --git a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py index 7fbdcb6..ae4df08 100644 --- a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py +++ b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py @@ -1,7 +1,7 @@ import os import numpy as np from osgeo import ogr, osr -import importlib +import importlib.util from pyflowline.algorithms.auxiliary.find_index_in_list import find_list_in_list diff --git a/pyflowline/algorithms/auxiliary/find_index_in_list.py b/pyflowline/algorithms/auxiliary/find_index_in_list.py index 4bb2489..a6fdd9d 100644 --- a/pyflowline/algorithms/auxiliary/find_index_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_index_in_list.py @@ -1,6 +1,6 @@ import copy import numpy as np -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import find_vertex_in_list diff --git a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py index 89b0c7b..99dec2e 100644 --- a/pyflowline/algorithms/auxiliary/find_vertex_in_list.py +++ b/pyflowline/algorithms/auxiliary/find_vertex_in_list.py @@ -1,5 +1,5 @@ -import importlib +import importlib.util import numpy as np iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: diff --git a/pyflowline/algorithms/index/define_stream_order.py b/pyflowline/algorithms/index/define_stream_order.py index bea6fdc..749f2a5 100644 --- a/pyflowline/algorithms/index/define_stream_order.py +++ b/pyflowline/algorithms/index/define_stream_order.py @@ -1,6 +1,6 @@ import numpy as np -import importlib +import importlib.util from pyflowline.algorithms.auxiliary.check_head_water import check_head_water #this function should not be used since stream order of headwater is available iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: diff --git a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py index 55c3a64..f32f945 100644 --- a/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py +++ b/pyflowline/algorithms/intersect/intersect_flowline_with_flowline.py @@ -4,7 +4,7 @@ #from shapely.wkt import loads from pyflowline.classes.vertex import pyvertex -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import find_vertex_in_list diff --git a/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py b/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py index 0b21e0b..263054a 100644 --- a/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py +++ b/pyflowline/algorithms/intersect/intersect_flowline_with_mesh.py @@ -1,6 +1,6 @@ import os -import importlib +import importlib.util import numpy as np from osgeo import ogr, osr #from shapely.wkt import loads diff --git a/pyflowline/algorithms/merge/merge_flowline.py b/pyflowline/algorithms/merge/merge_flowline.py index 8bc8aea..91bfe89 100644 --- a/pyflowline/algorithms/merge/merge_flowline.py +++ b/pyflowline/algorithms/merge/merge_flowline.py @@ -1,6 +1,6 @@ import numpy as np -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import find_vertex_in_list diff --git a/pyflowline/algorithms/simplification/remove_returning_flowline.py b/pyflowline/algorithms/simplification/remove_returning_flowline.py index 57d62c0..ec61319 100644 --- a/pyflowline/algorithms/simplification/remove_returning_flowline.py +++ b/pyflowline/algorithms/simplification/remove_returning_flowline.py @@ -5,6 +5,7 @@ def remove_returning_flowline(iMesh_type_in, aCell_intersect_in, pVertex_outlet_in): aFlowline_out=list() nCell = len(aCell_intersect_in) + #lCellID_to_cell = {cell.lCellID: cell for cell in aCell_intersect_in} def simplify_list(aCell_flowline_in): aCell_flowline_out = copy.deepcopy(aCell_flowline_in) nCell2 = len(aCell_flowline_out) diff --git a/pyflowline/algorithms/split/find_flowline_confluence.py b/pyflowline/algorithms/split/find_flowline_confluence.py index 4e3ff3b..0832066 100644 --- a/pyflowline/algorithms/split/find_flowline_confluence.py +++ b/pyflowline/algorithms/split/find_flowline_confluence.py @@ -1,6 +1,6 @@ import numpy as np -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") from pyflowline.algorithms.split.find_flowline_vertex import find_flowline_vertex diff --git a/pyflowline/algorithms/split/find_flowline_vertex.py b/pyflowline/algorithms/split/find_flowline_vertex.py index e6387ba..864e0be 100644 --- a/pyflowline/algorithms/split/find_flowline_vertex.py +++ b/pyflowline/algorithms/split/find_flowline_vertex.py @@ -1,4 +1,4 @@ -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import add_unique_vertex diff --git a/pyflowline/algorithms/split/split_flowline.py b/pyflowline/algorithms/split/split_flowline.py index 91c3871..21bc477 100644 --- a/pyflowline/algorithms/split/split_flowline.py +++ b/pyflowline/algorithms/split/split_flowline.py @@ -3,7 +3,7 @@ from pyflowline.classes.edge import pyedge from pyflowline.classes.flowline import pyflowline -import importlib +import importlib.util iFlag_cython = importlib.util.find_spec("cython") if iFlag_cython is not None: from pyflowline.algorithms.cython.kernel import find_vertex_on_edge diff --git a/pyflowline/classes/_visual_basin.py b/pyflowline/classes/_visual_basin.py index 7e33956..cd8b33c 100644 --- a/pyflowline/classes/_visual_basin.py +++ b/pyflowline/classes/_visual_basin.py @@ -22,7 +22,7 @@ def basin_plot(self, sFilename_mesh_in = None, iFont_size_in = None, iFlag_title_in=None, - iFlag_colorbar_in=None, + iFlag_colorbar_in=None, iFlag_scientific_notation_colorbar_in=None, iFlag_openstreetmap_in = None, dData_min_in = None, @@ -67,7 +67,7 @@ def basin_plot(self, self._plot_polygon_variable( sVariable_in, iFlag_title_in= iFlag_title_in, iFont_size_in=iFont_size_in, - iFlag_colorbar_in=iFlag_colorbar_in, + iFlag_colorbar_in=iFlag_colorbar_in, iFlag_scientific_notation_colorbar_in=iFlag_scientific_notation_colorbar_in, dData_min_in = dData_min_in, dData_max_in = dData_max_in, @@ -116,10 +116,34 @@ def basin_plot(self, aLegend_in = aLegend_in, aFlag_color_in = [0, 0, 1], aFlag_fill_in = [0, 0, 0], + aFlag_discrete_in = [0, 0, 1], + aExtent_in = aExtent_in, + pProjection_map_in = pProjection_map_in) + else: + if sVariable_in == "hillslope_with_flow_direction": + sFilename0 = self.sFilename_hillslope_parquet + sFilename1 = self.sFilename_flow_direction + aFiletype_in = [3, 2] + aFilename_in = [sFilename0, sFilename1] + map_multiple_vector_data(aFiletype_in, + aFilename_in, + iFlag_title_in=iFlag_title_in, + iFont_size_in=iFont_size_in, + iFlag_openstreetmap_in=iFlag_openstreetmap_in, + sFilename_output_in=sFilename_output_in, + sTitle_in= 'Flow direction with hillslope', + aData_min_in=[1, 1], + aFlag_thickness_in= [0, 1], + aFlag_discrete_in = [1,0], + aVariable_in= ['hillslope', 'drainage_area'], + aLegend_in = aLegend_in, + aFlag_color_in = [1, 0], + aFlag_fill_in = [1, 0], aExtent_in = aExtent_in, pProjection_map_in = pProjection_map_in) - else: - print('Unsupported variable: ', sVariable_in, ' in basin_plot.') + + else: + print('Unsupported variable: ', sVariable_in, ' in basin_plot.') return pass @@ -237,6 +261,7 @@ def _plot_polygon_variable(self, iFigwidth_in=None, iFigheight_in=None, iFlag_colorbar_in=None, + iFlag_discrete_in= None, iFlag_title_in=None, iFont_size_in=None, iFlag_scientific_notation_colorbar_in = None, @@ -260,92 +285,144 @@ def _plot_polygon_variable(self, """ sMesh_type = self.sMesh_type + iFiletype = 1 #most file are geojson, but some are parquet + iFlag_integer_in = 0 #most variable are real, if not, it will be set to 1 if sMesh_type == 'mpas': - if sVariable_in == 'elevation': - sVariable='elevation' #Elevation_profile' - sTitle = 'Surface elevation' - sUnit = 'Unit: m' - sColormap ='terrain' - dData_min = dData_min_in + #start with integer + if sVariable_in == 'subbasin': + iFlag_integer_in = 1 + iFiletype = 3 + sVariable='subbasin' + sTitle = 'Subbasin' + sUnit = 'ID' + sColormap='Spectral_r' + dData_min = 1 dData_max = dData_max_in - sFilename = self.sFilename_elevation - sFilename = self.sFilename_variable_polygon + sFilename = self.sFilename_subbasin_parquet else: - if sVariable_in == 'drainage_area': - sVariable='drainage_area' - sTitle = 'Drainage area' - sUnit = r'Units: $m^{2}$' - dData_min = dData_min_in + if sVariable_in == 'hillslope': + sVariable='hillslope' + iFlag_integer_in = 1 + iFiletype = 3 + sTitle = 'Hillslope' + sUnit = 'ID' + sColormap='Spectral_r' + dData_min = 1 dData_max = dData_max_in - sColormap ='Spectral_r' - sFilename = self.sFilename_variable_polygon + sFilename = self.sFilename_hillslope_parquet else: - if sVariable_in == 'travel_distance': - sVariable='travel_distance' - sTitle = 'Distance to outlet' - sUnit = r'Unit: m' - dData_min = 0.0 - dData_max = dData_max_in - sColormap ='Spectral_r' + #then with real + if sVariable_in == 'elevation': + sVariable='elevation' #Elevation_profile' + sTitle = 'Surface elevation' + sUnit = 'Unit: m' + sColormap ='terrain' + dData_min = dData_min_in + dData_max = dData_max_in sFilename = self.sFilename_variable_polygon else: - sVariable='slope' - sTitle = 'Surface slope' - sUnit = 'Unit: percent' - sColormap='Spectral_r' - dData_min = 0.0 - dData_max = dData_max_in - sFilename = self.sFilename_variable_polygon + if sVariable_in == 'drainage_area': + sVariable='drainage_area' + sTitle = 'Drainage area' + sUnit = r'Units: $m^{2}$' + dData_min = dData_min_in + dData_max = dData_max_in + sColormap ='Spectral_r' + sFilename = self.sFilename_variable_polygon + else: + if sVariable_in == 'travel_distance': + sVariable='travel_distance' + sTitle = 'Distance to outlet' + sUnit = r'Unit: m' + dData_min = 0.0 + dData_max = dData_max_in + sColormap ='Spectral_r' + sFilename = self.sFilename_variable_polygon + else: + if sVariable=='slope': + sTitle = 'Surface slope' + sUnit = 'Unit: percent' + sColormap='Spectral_r' + dData_min = 0.0 + dData_max = dData_max_in + sFilename = self.sFilename_variable_polygon + else: + pass + else: - if sVariable_in == 'area': - sVariable='area' - sTitle = 'Area' - sUnit = r'Units: $m^{2}$' - sColormap ='terrain' - dData_min = dData_min_in + if sVariable_in == 'subbasin': + iFlag_integer_in = 1 + iFiletype = 3 + sVariable='subbasin' + sTitle = 'Subbasin' + sUnit = 'ID' + sColormap='Spectral_r' + dData_min = 1 dData_max = dData_max_in - sFilename = self.sFilename_variable_polygon - pass + sFilename = self.sFilename_subbasin_parquet else: - if sVariable_in == 'elevation': - sVariable='elevation' - sTitle = 'Surface elevation' - sUnit = r'Unit: m' - sColormap ='terrain' - dData_min = dData_min_in + if sVariable_in == 'hillslope': + sVariable='hillslope' + iFlag_integer_in = 1 + iFiletype = 3 + sTitle = 'Hillslope' + sUnit = 'ID' + sColormap='Spectral_r' + dData_min = 1 dData_max = dData_max_in - sFilename = self.sFilename_variable_polygon + sFilename = self.sFilename_hillslope_parquet else: - if sVariable_in == 'drainage_area': - sVariable='drainage_area' - sTitle = 'Drainage area' + if sVariable_in == 'area': + sVariable='area' + sTitle = 'Area' sUnit = r'Units: $m^{2}$' + sColormap ='terrain' dData_min = dData_min_in dData_max = dData_max_in - sColormap ='Spectral_r' sFilename = self.sFilename_variable_polygon - + pass else: - if sVariable_in == 'travel_distance': - sVariable='travel_distance' - sTitle = 'Travel distance' + if sVariable_in == 'elevation': + sVariable='elevation' + sTitle = 'Surface elevation' sUnit = r'Unit: m' - dData_min = 0.0 - dData_max = dData_max_in - sColormap ='Spectral_r' - iFlag_subbasin = 1 - sFilename = self.sFilename_variable_polygon - else: - sVariable='slope' - sTitle = 'Surface slope' - sUnit = r'Unit: percent' - sColormap='Spectral_r' + sColormap ='terrain' dData_min = dData_min_in dData_max = dData_max_in sFilename = self.sFilename_variable_polygon - pass + else: + if sVariable_in == 'drainage_area': + sVariable='drainage_area' + sTitle = 'Drainage area' + sUnit = r'Units: $m^{2}$' + dData_min = dData_min_in + dData_max = dData_max_in + sColormap ='Spectral_r' + sFilename = self.sFilename_variable_polygon + + else: + if sVariable_in == 'travel_distance': + sVariable='travel_distance' + sTitle = 'Travel distance' + sUnit = r'Unit: m' + dData_min = 0.0 + dData_max = dData_max_in + sColormap ='Spectral_r' + sFilename = self.sFilename_variable_polygon + else: + if sVariable_in=='slope': + sVariable = 'slope' + sTitle = 'Surface slope' + sUnit = r'Unit: percent' + sColormap='Spectral_r' + dData_min = dData_min_in + dData_max = dData_max_in + sFilename = self.sFilename_variable_polygon + else: + pass + pass if iFlag_title_in is not None: if iFlag_title_in == 0: @@ -356,11 +433,12 @@ def _plot_polygon_variable(self, sTitle='' pass - map_vector_polygon_data(1,sFilename, + map_vector_polygon_data(iFiletype, sFilename, iFlag_color_in = 1, iFlag_colorbar_in = iFlag_colorbar_in, iFont_size_in = iFont_size_in, iFlag_scientific_notation_colorbar_in = iFlag_scientific_notation_colorbar_in, + iFlag_discrete_in = iFlag_integer_in, dData_max_in = dData_max, dData_min_in = dData_min, sFilename_output_in=sFilename_output_in, diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index d955743..235b5b5 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -2,7 +2,7 @@ from pathlib import Path import json from json import JSONEncoder -import importlib +import importlib.util import numpy as np from pyflowline.classes.timer import pytimer @@ -150,6 +150,11 @@ class pybasin(object): sFilename_stream_edge_json ='' #geojson for hexwatershed compatibility + #parquet for integer + sFilename_subbasin_parquet='' + sFilename_hillslope_parquet='' + + #real data type sFilename_elevation='' sFilename_slope='' sFilename_drainage_area='' @@ -158,9 +163,17 @@ class pybasin(object): sFilename_stream_segment='' sFilename_stream_edge='' + + sFilename_variable_polygon='' sFilename_variable_polyline='' + #txt for characteristics + sFilename_watershed_characteristics_txt = '' + sFilename_segment_characteristics_txt = '' + sFilename_subbasin_characteristics_txt = '' + sFilename_hillslope_characteristics_txt = '' + pRTree_flowline = None pRTree_edge = None @@ -323,8 +336,7 @@ def __init__(self, aParameter): self.sFilename_confluence_simplified_info = os.path.join(str(self.sWorkspace_output_basin ),'confluence_simplified_info.json') #geojson, full path of the file - #full paths are required for the following files - #for hexwatershed compatibility, the geojson files will be generated by the pyhexwatershed front end + #full paths are required for the following files self.sFilename_flowline_segment_index_before_intersect = os.path.join(str(self.sWorkspace_output_basin ),'flowline_segment_index_before_intersect.geojson') self.sFilename_flowline_simplified = os.path.join(str(self.sWorkspace_output_basin ),'flowline_simplified.geojson') self.sFilename_flowline_split = os.path.join(str(self.sWorkspace_output_basin ),'flowline_split.geojson') @@ -333,6 +345,12 @@ def __init__(self, aParameter): self.sFilename_flowline_edge = os.path.join(str(self.sWorkspace_output_basin ),'flowline_edge.geojson') self.sFilename_area_of_difference = os.path.join(str(self.sWorkspace_output_basin ),'area_of_difference.geojson') + #for hexwatershed compatibility, the geojson files will be generated by the pyhexwatershed front end + #parquet is often converted from geojson instead of directly generated + self.sFilename_subbasin_parquet = os.path.join(str(self.sWorkspace_output_basin ), "subbasin.parquet" ) + self.sFilename_hillslope_parquet = os.path.join(str(self.sWorkspace_output_basin ), "hillslope.parquet" ) + + #geojson, some of these can also to convert to parquet for speed up self.sFilename_elevation = os.path.join(str(self.sWorkspace_output_basin ), "elevation.geojson" ) self.sFilename_slope = os.path.join(str(self.sWorkspace_output_basin ), "slope.geojson" ) self.sFilename_drainage_area = os.path.join(str(self.sWorkspace_output_basin ), "drainage_area.geojson" ) @@ -343,6 +361,12 @@ def __init__(self, aParameter): self.sFilename_variable_polygon = os.path.join(str(self.sWorkspace_output_basin ), "variable_polygon.geojson" ) self.sFilename_variable_polyline = os.path.join(str(self.sWorkspace_output_basin ), "variable_polyline.geojson" ) + #txt + self.sFilename_watershed_characteristics_txt = os.path.join(str(self.sWorkspace_output_basin ), "watershed.txt" ) + self.sFilename_segment_characteristics_txt = os.path.join(str(self.sWorkspace_output_basin ), "segment.txt" ) + self.sFilename_subbasin_characteristics_txt = os.path.join(str(self.sWorkspace_output_basin ), "subbasin.txt" ) + self.sFilename_hillslope_characteristics_txt = os.path.join(str(self.sWorkspace_output_basin ), "hillslope.txt" ) + #kml self.sFilename_flowline_conceptual_kml = os.path.join(str(self.sWorkspace_output_basin ),'flowline_conceptual.kml') return @@ -793,7 +817,7 @@ def basin_reconstruct_topological_relationship(self, iMesh_type, sFilename_mesh) print('Error in correct_flowline_direction.') try: - print('Basin ', self.sBasinID, 'Start flowline direction correction') + print('Basin ', self.sBasinID, 'Start flowline loop removal') sys.stdout.flush() ptimer.start() aFlowline_basin_conceptual = remove_flowline_loop(aFlowline_basin_conceptual ) diff --git a/pyflowline/classes/confluence.py b/pyflowline/classes/confluence.py index 21b80b9..5c887ef 100644 --- a/pyflowline/classes/confluence.py +++ b/pyflowline/classes/confluence.py @@ -1,4 +1,4 @@ -import importlib +import importlib.util import json from json import JSONEncoder import numpy as np diff --git a/pyflowline/classes/edge.py b/pyflowline/classes/edge.py index 77cc731..ae3f10b 100644 --- a/pyflowline/classes/edge.py +++ b/pyflowline/classes/edge.py @@ -1,7 +1,7 @@ import json from json import JSONEncoder -import importlib +import importlib.util import numpy as np from pyflowline.classes.vertex import pyvertex from pyflowline.algorithms.split.split_by_length import split_edge_by_length diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 23032af..fb36f62 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -4,7 +4,7 @@ import json from json import JSONEncoder import datetime -import importlib +import importlib.util from shutil import copy2 import numpy as np from osgeo import ogr, osr, gdal diff --git a/pyflowline/classes/vertex.py b/pyflowline/classes/vertex.py index 818a093..9873507 100644 --- a/pyflowline/classes/vertex.py +++ b/pyflowline/classes/vertex.py @@ -1,7 +1,7 @@ import json from json import JSONEncoder -import importlib +import importlib.util import numpy as np iFlag_cython = importlib.util.find_spec("cython") diff --git a/pyflowline/formats/convert_coordinates.py b/pyflowline/formats/convert_coordinates.py index a7ab4db..bc1dec8 100644 --- a/pyflowline/formats/convert_coordinates.py +++ b/pyflowline/formats/convert_coordinates.py @@ -1,4 +1,4 @@ -import importlib +import importlib.util from pyflowline.classes.vertex import pyvertex from pyflowline.classes.edge import pyedge from pyflowline.classes.flowline import pyflowline diff --git a/pyflowline/mesh/dggrid/create_dggrid_mesh.py b/pyflowline/mesh/dggrid/create_dggrid_mesh.py index 8c65edb..c4c8fed 100644 --- a/pyflowline/mesh/dggrid/create_dggrid_mesh.py +++ b/pyflowline/mesh/dggrid/create_dggrid_mesh.py @@ -129,7 +129,8 @@ def dggrid_find_resolution_by_index(sDggrid_type, iResolution_index): return dResolution -def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh_pyflowline): +def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh_pyflowline, + iFlag_global_in = None): iReturn_code = 1 if os.path.isfile(sFilename_dggrid_mesh): @@ -140,6 +141,11 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh iReturn_code = 0 return iReturn_code + if iFlag_global_in is not None: + iFlag_global = iFlag_global_in + else: + iFlag_global = 0 + if os.path.isfile(sFilename_mesh_pyflowline): print('This mesh file already exists: ', sFilename_mesh_pyflowline ) os.remove(sFilename_mesh_pyflowline) @@ -147,7 +153,6 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh aDggrid=list() aDggrid_dict = dict() lCellIndex = 0 - pDriver_geojson = ogr.GetDriverByName('GeoJSON') pDataset_mesh = pDriver_geojson.Open(sFilename_dggrid_mesh, gdal.GA_ReadOnly) pLayer_mesh = pDataset_mesh.GetLayer(0) @@ -171,21 +176,16 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh #we also need to spatial reference for pFeature_mesh in pLayer_mesh: - pGeometry_mesh = pFeature_mesh.GetGeometryRef() - #dummy0 = loads( pGeometry_mesh.ExportToWkt() ) - #aCoords_gcs = dummy0.exterior.coords - #aCoords_gcs= np.array(aCoords_gcs) + pGeometry_mesh = pFeature_mesh.GetGeometryRef() aCoords_gcs = get_geometry_coordinates(pGeometry_mesh) dLongitude_center = np.mean(aCoords_gcs[:-1,0]) dLatitude_center = np.mean(aCoords_gcs[:-1,1]) - lCellID = int(pFeature_mesh.GetField("name") ) pdggrid = convert_gcs_coordinates_to_cell(5, dLongitude_center, dLatitude_center, aCoords_gcs) dArea = pdggrid.calculate_cell_area() pdggrid.calculate_edge_length() pdggrid.dLength_flowline = pdggrid.dLength #Default pdggrid.lCellID = lCellID - aNeighbor = pFeature_mesh.GetField("neighbors") pdggrid.nNeighbor = len(aNeighbor) pdggrid.aNeighbor = list() @@ -217,11 +217,7 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh pLayer.CreateFeature(pFeature) #rebuild neighbor list - aDggrid_out = list() - - ncell = len(aDggrid) - aCellID = list() - + aDggrid_middle = list() for pCell in aDggrid: aNeighbor = pCell.aNeighbor aNeighbor_new = list() @@ -234,20 +230,24 @@ def convert_dggrid_mesh_to_pyflowline_mesh(sFilename_dggrid_mesh, sFilename_mesh pCell.nNeighbor_land= len(aNeighbor_new) pCell.aNeighbor_land = aNeighbor_new pCell.nNeighbor_ocean = pCell.nVertex - pCell.nNeighbor_land - aDggrid_out.append(pCell) + aDggrid_middle.append(pCell) #calculate neighbor distance - for pDggrid in aDggrid_out: + for pDggrid in aDggrid_middle: aNeighbor = pDggrid.aNeighbor pDggrid.aNeighbor_distance=list() for lCellID1 in aNeighbor: lIndex = aDggrid_dict[lCellID1] - pDggrid1 = aDggrid_out[lIndex] + pDggrid1 = aDggrid_middle[lIndex] dDistance = pDggrid.pVertex_center.calculate_distance( pDggrid1.pVertex_center ) pDggrid.aNeighbor_distance.append(dDistance) pDataset = pLayer = pFeature = None - return aDggrid_out + + #currently we do not fill the holes in dggrid, it is recommended to modify the input data directly. + + + return aDggrid_middle def create_dggrid_mesh(iFlag_global, iFlag_save_mesh, @@ -278,10 +278,13 @@ def create_dggrid_mesh(iFlag_global, if sFilename_boundary_in is not None: if os.path.isfile(sFilename_boundary_in): - iFlag_crop =1 + iFlag_crop = 1 + iFlag_global = 0 sFilename_crop_geojson = sFilename_boundary_in else: iFlag_crop = 0 + iFlag_global = 1 + else: iFlag_crop = 0 @@ -331,7 +334,8 @@ def create_dggrid_mesh(iFlag_global, #convert the pyflowline mesh format - aDggrid = convert_dggrid_mesh_to_pyflowline_mesh(sFilename_cell, sFilename_mesh) + aDggrid = convert_dggrid_mesh_to_pyflowline_mesh(sFilename_cell, sFilename_mesh, + iFlag_global_in = iFlag_global) return aDggrid diff --git a/pyflowline/mesh/hexagon/create_hexagon_mesh.py b/pyflowline/mesh/hexagon/create_hexagon_mesh.py index d00038e..56f6237 100644 --- a/pyflowline/mesh/hexagon/create_hexagon_mesh.py +++ b/pyflowline/mesh/hexagon/create_hexagon_mesh.py @@ -430,12 +430,10 @@ def add_cell_into_list2(aList, lCellID, iRow, iColumn, dLongitude_center, dLatit iFlag_fill_hole = 0 aHexagon_out = list() - if iFlag_fill_hole ==1: - + if iFlag_fill_hole ==1: #find the virtual neighbors for pCell in aHexagon: aNeighbor_land = pCell.aNeighbor_land #including both holes and maps land cutoff by boundary - nNeighbor_land = pCell.nNeighbor aNeighbor_land_update = list() aNeighbor_land_virtual = list() nNeighbor_land_update = 0 diff --git a/pyflowline/mesh/mpas/create_mpas_mesh.py b/pyflowline/mesh/mpas/create_mpas_mesh.py index 70522ab..8bb34d2 100644 --- a/pyflowline/mesh/mpas/create_mpas_mesh.py +++ b/pyflowline/mesh/mpas/create_mpas_mesh.py @@ -1,6 +1,6 @@ import os import math -import importlib +import importlib.util import numpy as np from osgeo import ogr, osr, gdal from pyflowline.formats.convert_attributes import convert_gcs_attributes_to_cell @@ -328,9 +328,7 @@ def add_cell_into_list(aList, i, lCellID, dArea, dElevation_mean, dElevation_pro else: iFlag_remove_ice = 1 - for i in range(ncell): - #center - + for i in range(ncell): #vertex aVertexOnCellIndex = np.array(aVertexOnCell[i,:]) dummy0 = np.where(aVertexOnCellIndex > 0) @@ -421,8 +419,7 @@ def add_cell_into_list(aList, i, lCellID, dArea, dElevation_mean, dElevation_pro aMpas_out = list() ncell = len(aMpas) #generate the list of cell ID that are already certain - if iFlag_fill_hole == 1: - + if iFlag_fill_hole == 1: #first update neighbor information because some cell should have vitual land neighbor (not present in the mesh) #this operation does not increase the number of cells, but it update the neighbor information #specifically, it divided the land neighbor into two parts: land and virtual land From 178874c88b2bd3b486063acb5f6d7eb1c6be3f74 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 16 Apr 2024 08:35:22 -0700 Subject: [PATCH 15/15] update version --- conda-recipe/conda_build_config.yaml | 2 +- conda-recipe/meta.yaml | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index fac97e8..e532873 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -23,7 +23,7 @@ metadata: # Package name name: pyflowline # Package version - version: "0.3.4" + version: "0.3.5" # Package summary summary: A mesh-independent river network generator for hydrologic models. # Package homepage diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 7e537bc..0dc2149 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,6 +1,6 @@ {% set name = "hexwatershed" %} {% set git_rev = "main" %} -{% set version = "0.3.4" %} +{% set version = "0.3.5" %} package: name: {{ name|lower }} diff --git a/setup.py b/setup.py index 9ebbf16..01d21b2 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ AUTHOR = "Chang Liao" AUTHOR_EMAIL = "chang.liao@pnnl.gov" URL = "https://github.com/changliao1025/pyflowline" -VERSION = "0.3.4" +VERSION = "0.3.5" REQUIRES_PYTHON = ">=3.8.0" KEYWORDS = "Earth Science"