Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print('')
print('\nTIMES for ', N, type_of_points)
print('tzwhere:', his_time)
print('timezonefinder:', my_time)
try:
print(round(his_time / my_time, 2), 'times faster')
except TypeError:
pass
# assert his_time > my_time
print('\n\n')
if SHAPELY:
print('shapely: ON (tzwhere)')
else:
print('shapely: OFF (tzwhere)')
if TimezoneFinder.using_numba():
print('Numba: ON (timezonefinder)')
else:
print('Numba: OFF (timezonefinder)')
print_speed_test('realistic points', self.realistic_points)
print_speed_test('random points', list_of_random_points(length=N))
def random_point():
# tzwhere does not work for points with more latitude!
return random.uniform(-180, 180), random.uniform(-84, 84)
def list_of_random_points(length):
return [random_point() for i in range(length)]
duration_idle_mem_test = 20
duration_in_use_mem_test = 20
if __name__ == '__main__':
if TimezoneFinder.using_numba():
print('Numba: ON (timezonefinder)')
else:
print('Numba: OFF (timezonefinder)')
start_time = datetime.now()
timezone_finder = TimezoneFinder()
end_time = datetime.now()
my_time = end_time - start_time
print('\nStartup time:')
print('timezonefinder:', my_time)
print("Check the memory usage of python in your process list (Task Manager, Activity Manager...)")
print("time remaining:")
while duration_idle_mem_test > 0:
print(duration_idle_mem_test, 's')
def print_tf_class_props(self):
print("in memory mode:", self.in_memory_mode)
if TimezoneFinder.using_numba():
print('Numba: ON (JIT compiled functions in use)')
else:
print('Numba: OFF (JIT compiled functions NOT in use)')