Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.ap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.ap
Commits
2838af4b
Commit
2838af4b
authored
Feb 26, 2015
by
Manuel Günther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced mal-functioning PyArray_IsAnyScalar with novel PyBob_NumberCheck.
parent
c3dc3c25
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
11 deletions
+15
-11
bob/ap/ceps.cpp
bob/ap/ceps.cpp
+3
-2
bob/ap/energy.cpp
bob/ap/energy.cpp
+2
-1
bob/ap/frame_extractor.cpp
bob/ap/frame_extractor.cpp
+4
-3
bob/ap/spectrogram.cpp
bob/ap/spectrogram.cpp
+5
-4
requirements.txt
requirements.txt
+1
-1
No files found.
bob/ap/ceps.cpp
View file @
2838af4b
...
...
@@ -7,6 +7,7 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include "types.h"
PyDoc_STRVAR
(
s_ceps_str
,
BOB_EXT_MODULE_PREFIX
".Ceps"
);
...
...
@@ -278,7 +279,7 @@ static PyObject* PyBobApCeps_GetNCeps
static
int
PyBobApCeps_SetNCeps
(
PyBobApCepsObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' n_ceps can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -316,7 +317,7 @@ static PyObject* PyBobApCeps_GetDeltaWin
static
int
PyBobApCeps_SetDeltaWin
(
PyBobApCepsObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' delta_win can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
bob/ap/energy.cpp
View file @
2838af4b
...
...
@@ -7,6 +7,7 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include "types.h"
PyDoc_STRVAR
(
s_energy_str
,
BOB_EXT_MODULE_PREFIX
".Energy"
);
...
...
@@ -217,7 +218,7 @@ static PyObject* PyBobApEnergy_GetEnergyFloor
static
int
PyBobApEnergy_SetEnergyFloor
(
PyBobApEnergyObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' energy floor can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
bob/ap/frame_extractor.cpp
View file @
2838af4b
...
...
@@ -7,6 +7,7 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include "types.h"
PyDoc_STRVAR
(
s_frame_extractor_str
,
BOB_EXT_MODULE_PREFIX
".FrameExtractor"
);
...
...
@@ -219,7 +220,7 @@ static PyObject* PyBobApFrameExtractor_GetSamplingFrequency
static
int
PyBobApFrameExtractor_SetSamplingFrequency
(
PyBobApFrameExtractorObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' sampling frequency can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -256,7 +257,7 @@ static PyObject* PyBobApFrameExtractor_GetWinLengthMs
static
int
PyBobApFrameExtractor_SetWinLengthMs
(
PyBobApFrameExtractorObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' windows length can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -293,7 +294,7 @@ static PyObject* PyBobApFrameExtractor_GetWinShiftMs
static
int
PyBobApFrameExtractor_SetWinShiftMs
(
PyBobApFrameExtractorObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' windows shift can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
bob/ap/spectrogram.cpp
View file @
2838af4b
...
...
@@ -7,6 +7,7 @@
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.extension/defines.h>
#include "types.h"
PyDoc_STRVAR
(
s_spectrogram_str
,
BOB_EXT_MODULE_PREFIX
".Spectrogram"
);
...
...
@@ -254,7 +255,7 @@ static PyObject* PyBobApSpectrogram_GetNFilters
static
int
PyBobApSpectrogram_SetNFilters
(
PyBobApSpectrogramObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' n_filters can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -291,7 +292,7 @@ static PyObject* PyBobApSpectrogram_GetFMin
static
int
PyBobApSpectrogram_SetFMin
(
PyBobApSpectrogramObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' f_min can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -328,7 +329,7 @@ static PyObject* PyBobApSpectrogram_GetFMax
static
int
PyBobApSpectrogram_SetFMax
(
PyBobApSpectrogramObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' f_max can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
@@ -365,7 +366,7 @@ static PyObject* PyBobApSpectrogram_GetPreEmphasisCoeff
static
int
PyBobApSpectrogram_SetPreEmphasisCoeff
(
PyBobApSpectrogramObject
*
self
,
PyObject
*
o
,
void
*
/*closure*/
)
{
if
(
!
Py
Array_IsAnyScalar
(
o
))
{
if
(
!
Py
Bob_NumberCheck
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"`%s' pre_emphasis_coeff can only be set using a number, not `%s'"
,
Py_TYPE
(
self
)
->
tp_name
,
Py_TYPE
(
o
)
->
tp_name
);
return
-
1
;
}
...
...
requirements.txt
View file @
2838af4b
setuptools
bob.extension
bob.extension
>2.0.4
bob.blitz
bob.core
bob.sp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment