Skip to content

Commit

Permalink
MAINT: observable: move cdef extern from into pxd
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-br committed Jul 31, 2021
1 parent 0ca1bdd commit 4aece2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 7 additions & 0 deletions mc_lib/observable.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ cdef class RealObservable():

cpdef void add_measurement(self, double value)


# needed to work around cython not understanding std::tuple
cdef extern from "_observable/observable.h" namespace "mc_stats":
void trampoline_mrg(const ScalarObservable[double]& obs,
vector[double] v_av,
vector[double] v_err,
vector[double] v_size)
6 changes: 1 addition & 5 deletions mc_lib/observable.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

# hack to make cythonize detect c++
#from libcpp.vector cimport vector
cdef extern from "_observable/observable.h" namespace "mc_stats":
void trampoline_mrg(const ScalarObservable[double]& obs,
vector[double] v_av,
vector[double] v_err,
vector[double] v_size)

import numpy as np

from .observable cimport ScalarObservable
from .observable cimport trampoline_mrg

cdef class RealObservable():

Expand Down

0 comments on commit 4aece2a

Please sign in to comment.