Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions pisa/utils/vbwkde.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

# TODO : accuracy tests for fbwkde and vbwkde

# FIXME: renamed test_* functions -> run_* functions to exclude from unit testing
# due to failures ("division by zero", with numba 0.66.0: hanging)


from __future__ import absolute_import, division

Expand All @@ -43,7 +46,8 @@


__all__ = ['OPT_TYPE', 'FIXED_POINT_IMPL',
'fbwkde', 'vbwkde', 'isj_bandwidth', 'test_fbwkde', 'test_vbwkde']
'fbwkde', 'vbwkde', 'isj_bandwidth',
'run_fbwkde', 'run_vbwkde', 'run_weighted_vbwkde']

__author__ = 'Z. Botev, J.L. Lanfranchi'

Expand Down Expand Up @@ -82,7 +86,7 @@

All other code in this module is under the following copyright/license:

Copyright (c) 2014-2017, The IceCube Collaboration
Copyright (c) 2014-2026, The IceCube Collaboration

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -623,8 +627,8 @@ def fixed_point_numba_orig(t, n_datapoints, i_range, a2):

return t - (2.0 * n_datapoints * _SQRTPI * eff)**-0.4

# tests failing with numba 0.62.1
def test_fbwkde():
# all three tests slow/hanging with numba 0.66.0
def run_fbwkde():
"""Test speed of fbwkde implementation"""
try:
n_samp = int(1e4)
Expand All @@ -648,7 +652,7 @@ def test_fbwkde():
logging.error("test_fbwkde failed: '%s'. This is under investigation..." % str(e))


def test_vbwkde():
def run_vbwkde():
"""Test speed of unweighted vbwkde implementation"""
try:
n_samp = int(1e4)
Expand All @@ -673,7 +677,7 @@ def test_vbwkde():
logging.error("test_vbwkde failed: '%s'. This is under investigation..." % str(e))


def test_weighted_vbwkde():
def run_weighted_vbwkde():
"""Test speed of vbwkde implementation using weights"""
try:
n_samp = int(1e4)
Expand Down Expand Up @@ -703,7 +707,7 @@ def test_weighted_vbwkde():

if __name__ == "__main__":
set_verbosity(2)
test_fbwkde()
test_vbwkde()
test_weighted_vbwkde()
run_fbwkde()
run_vbwkde()
run_weighted_vbwkde()