Skip to content
Snippets Groups Projects
Commit dbfd7366 authored by simply-nicky's avatar simply-nicky
Browse files

Bug fix

parent 94b2791f
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
#cython: language_level=3, boundscheck=False, wraparound=False, initializedcheck=False, cdivision=True, embedsignature=True
#cython: language_level=3, boundscheck=True, wraparound=False, initializedcheck=False, cdivision=True, embedsignature=True, linetrace=True, profile=True
cdef extern from "Python.h":
int Py_AtExit(void(*func)())
......
This diff is collapsed.
......@@ -17,4 +17,5 @@ def make_ext(modname, pyxfilename):
include_dirs=[numpy.get_include(),
os.path.join(sys.prefix, 'include'),
os.path.join(os.path.dirname(__file__),
'pyrost/include')])
\ No newline at end of file
'pyrost/include')],
define_macros=[('CYTHON_TRACE', '1'), ('CYTHON_TRACE_NOGIL', '1')])
\ No newline at end of file
......@@ -649,6 +649,8 @@ def pm_gsearch(uint_t[:, :, ::1] I_n not None, float_t[:, ::1] W not None, float
"""
if ds_y <= 0.0 or ds_x <= 0.0:
raise ValueError('Sampling intervals must be positive')
if grid_size <= 1:
raise ValueError('grid_size must be more than 1')
cdef loss_func f = choose_loss(loss)
......@@ -752,6 +754,8 @@ def pm_rsearch(uint_t[:, :, ::1] I_n not None, float_t[:, ::1] W not None, float
"""
if ds_y <= 0.0 or ds_x <= 0.0:
raise ValueError('Sampling intervals must be positive')
if n_trials <= 1:
raise ValueError('n_tirals must be more than 1')
cdef loss_func f = choose_loss(loss)
......@@ -1038,6 +1042,8 @@ def tr_gsearch(uint_t[:, :, ::1] I_n not None, float_t[:, ::1] W not None, float
"""
if ds_y <= 0.0 or ds_x <= 0.0:
raise ValueError('Sampling intervals must be positive')
if grid_size <= 1:
raise ValueError('grid_size must be more than 1')
cdef loss_func f = choose_loss(loss)
......
......@@ -204,8 +204,8 @@ class SpeckleTracking(DataContainer):
if self.reference_image is None:
raise AttributeError('The reference image has not been generated')
grid_size = extra_args.get('grid_size', int(0.5 * sw_x + sw_y))
n_trials = extra_args.get('n_trials', int(0.25 * (sw_x + sw_y)**2))
grid_size = extra_args.get('grid_size', max(int(0.5 * sw_x + sw_y), 2))
n_trials = extra_args.get('n_trials', max(int(0.25 * (sw_x + sw_y)**2), 2))
n_iter = extra_args.get('n_iter', 5)
pop_size = extra_args.get('pop_size', max(int(0.25 * (sw_x + sw_y)**2) / n_iter, 4))
mutation = extra_args.get('mutation', 0.75)
......
......@@ -13,7 +13,8 @@ else:
ext = '.pyx' if USE_CYTHON else '.c'
extension_args = {'language': 'c',
'extra_compile_args': ['-fopenmp', '-std=c99', '-Wno-unreachable-code', '-Wno-sometimes-uninitialized', '-Wno-unused-variable'],
'extra_compile_args': ['-fopenmp', '-std=c99', '-Wno-unreachable-code', '-Wno-maybe-uninitialized',
'-Wno-sometimes-uninitialized', '-Wno-unused-variable'],
'extra_link_args': ['-lgomp', '-Wl,-rpath,/usr/local/lib'],
'libraries': ['gsl', 'gslcblas', 'fftw3', 'fftw3_omp'],
'library_dirs': ['/usr/local/lib',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment