change in revision -> 0.7.5

This commit is contained in:
Jerome Kieffer 2012-10-15 10:48:40 +02:00
parent 904743dea0
commit f7c434c5cc
6 changed files with 1732 additions and 1741 deletions

View File

@ -1,4 +1,4 @@
version = "0.7.4"
version = "0.7.5"
import sys, logging
logging.basicConfig()

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* Generated by Cython 0.17 on Sun Sep 16 21:30:35 2012 */
/* Generated by Cython 0.17 on Tue Sep 18 21:16:40 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@ -9685,7 +9685,7 @@ PyMODINIT_FUNC PyInit_splitBBox(void)
* cimport numpy
* import numpy # <<<<<<<<<<<<<<
*
* from libc.math cimport floor, fabs
* from libc.math cimport fabs
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);

View File

@ -1,4 +1,4 @@
<!-- Generated by Cython 0.17 on Sun Sep 16 21:30:35 2012 -->
<!-- Generated by Cython 0.17 on Tue Sep 18 21:16:40 2012 -->
<html>
<head>
@ -38,7 +38,7 @@ function toggleDiv(id) {
</script>
</head>
<body>
<p>Generated by Cython 0.17 on Sun Sep 16 21:30:35 2012
<p>Generated by Cython 0.17 on Tue Sep 18 21:16:40 2012
<p>Raw output: <a href="splitBBox.c">splitBBox.c</a>
<pre class='line' style='background-color: #FFFF79' onclick='toggleDiv("line1")'> 1: #!/usr/bin/env python</pre>
<pre id='line1' class='code' style='background-color: #FFFF79'>
@ -86,14 +86,14 @@ function toggleDiv(id) {
* cimport numpy
* import numpy # <code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code><code><</code>
*
* from libc.math cimport floor, fabs
* from libc.math cimport fabs
*/
__pyx_t_1 = <span class='pyx_c_api'>__Pyx_Import</span>(((PyObject *)__pyx_n_s__numpy), 0, -1);<span class='error_goto'> if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}</span>
<span class='pyx_macro_api'><span class='refnanny'>__Pyx_GOTREF</span></span>(__pyx_t_1);
if (<span class='py_c_api'>PyObject_SetAttr</span>(__pyx_m, __pyx_n_s__numpy, __pyx_t_1) <code><</code> 0)<span class='error_goto'> {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
</pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line31")'> 31: </pre>
<pre id='line31' class='code' style='background-color: #FFFFff'></pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line32")'> 32: from libc.math cimport floor, fabs</pre>
<pre id='line31' class='code' style='background-color: #FFFFff'></pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line32")'> 32: from libc.math cimport fabs</pre>
<pre id='line32' class='code' style='background-color: #FFFFff'></pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line33")'> 33: </pre>
<pre id='line33' class='code' style='background-color: #FFFFff'></pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line34")'> 34: @cython.cdivision(True)</pre>
<pre id='line34' class='code' style='background-color: #FFFFff'></pre><pre class='line' style='background-color: #FFFFff' onclick='toggleDiv("line35")'> 35: cdef float getBinNr(float x0, float pos0_min, float delta) nogil:</pre>

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ class HistoBBox1d(object):
allow_pos0_neg=False
):
cdef float delta,pos0_min, min0
cdef double delta, pos0_min, min0
self.size = pos0.size
assert delta_pos0.size == self.size
@ -95,20 +95,18 @@ class HistoBBox1d(object):
else:
self.check_mask = 0
delta = (< float > self.pos0_max - pos0_min) / (bins)
delta = (self.pos0_max - pos0_min) / (bins)
self.delta = delta
self.lut_max_idx, self.lut_idx, self.lut_coef = self.calc_lut()
self.outPos = numpy.linspace(self.pos0_min+0.5*delta,self.pos0_max-0.5*delta, self.bins)
# sefl.outPos = numpy.zeros(self.bins, dtype=numpy.float32)
# for i in range(bins):
# self.outPos[i] = pos0_min + (< float > 0.5 + < float > i) * delta
@cython.cdivision(True)
@cython.boundscheck(False)
@cython.wraparound(False)
def calc_lut(self):
'calculate the max number of elements in the LUT'
cdef float delta=self.delta, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
cdef double delta=self.delta, pos0_min=self.pos0_min, min0, max0, fbin0_min, fbin0_max, deltaL, deltaR, deltaA
cdef int bin0_min, bin0_max, bins = self.bins, lut_size, i
cdef numpy.uint32_t k,idx #same as numpy.uint32
cdef bint check_mask, check_pos1