How to use the timezonefinder.helpers_numba function in timezonefinder

To help you get started, we’ve selected a few timezonefinder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
            "distance_to_point_on_equator": None,
            "distance_to_polygon": None,
            "distance_to_polygon_exact": None,
            "haversine": None,
            "inside_polygon": None,
            "coord2shortcut": None,
            "rectify_coordinates": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
assert km2deg(distance_exact) == 0.5
        # print('=====')
        distance = distance_to_polygon(x_rad, y_rad, len(x_coords), np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY))
        # print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
# print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
            "distance_to_point_on_equator": None,
            "distance_to_polygon": None,
            "distance_to_polygon_exact": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
# print('=====')
        distance = distance_to_polygon(x_rad, y_rad, len(x_coords), np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY))
        # print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
            "distance_to_point_on_equator": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
distance = distance_to_polygon(x_rad, y_rad, len(x_coords), np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY))
        # print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
            "distance_to_point_on_equator": None,
            "distance_to_polygon": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY),
                                                   np.array(trans_points, dtype=DTYPE_FORMAT_F_NUMPY))
        # print(km2deg(distance_exact))
        assert km2deg(distance_exact) == 0.5
        # print('=====')
        distance = distance_to_polygon(x_rad, y_rad, len(x_coords), np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY))
        # print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
# print(km2deg(distance_exact))
        assert km2deg(distance_exact) == 0.5
        # print('=====')
        distance = distance_to_polygon(x_rad, y_rad, len(x_coords), np.array(points, dtype=DTYPE_FORMAT_SIGNED_I_NUMPY))
        # print(km2deg(distance))
        assert abs(km2deg(distance) - sqrt(2) / 2) < 0.00001


class HelperTestNumba(HelperTest):
    # all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
github MrMinimal64 / timezonefinder / test / test_helpers.py View on Github external
# all Numba compiled functions have to receive their arguments in the proper data type (and numpy array shape)
    try:
        import timezonefinder.helpers_numba as helpers
        fct_dict = {
            "all_the_same": helpers.all_the_same,
            "coord2int": helpers.coord2int,
            "int2coord": helpers.int2coord,
            "distance_to_point_on_equator": helpers.distance_to_point_on_equator,
            "distance_to_polygon": helpers.distance_to_polygon,
            "distance_to_polygon_exact": helpers.distance_to_polygon_exact,
            "haversine": helpers.haversine,
            "inside_polygon": helpers.inside_polygon,
            "coord2shortcut": helpers.coord2shortcut,
            "rectify_coordinates": helpers.rectify_coordinates,
            'convert2coords': helpers.convert2coords,
            'convert2coord_pairs': helpers.convert2coord_pairs,
        }
        print('\nNumba installation found.\ntesting helpers_numba.py functions...')

    except ImportError:
        fct_dict = {
            "all_the_same": None,
            "coord2int": None,
            "int2coord": None,
            "distance_to_point_on_equator": None,
            "distance_to_polygon": None,
            "distance_to_polygon_exact": None,
            "haversine": None,
            "inside_polygon": None,
            "coord2shortcut": None,
            "rectify_coordinates": None,
            'convert2coords': None,