Skip to content

Commit

Permalink
fixed higher-level again
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfrantz committed Nov 28, 2024
1 parent 9373970 commit c2587a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion misc/force-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.12-dev:::2024-10-31_11:57:59
3.7.12-dev:::2024-11-28_07:52:29
13 changes: 4 additions & 9 deletions src/modules/higher-level/py-udf-hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int date_from_bandname(date_t *date, char *bandname);
--- phl: HL parameters
+++ Return: void
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**/
void register_python(par_hl_t *phl){
int register_python(par_hl_t *phl){
par_udf_t *udf;


Expand All @@ -75,17 +75,12 @@ par_udf_t *udf;
} else if (phl->udf.pyp.out){
udf = &phl->udf.pyp;
} else {
exit(FAILURE);
return(CANCEL);
}


Py_Initialize();

if (_import_array() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
exit(FAILURE);
}
import_array();

PyRun_SimpleString("from multiprocessing.pool import Pool");
PyRun_SimpleString("import numpy as np");
Expand Down Expand Up @@ -185,7 +180,7 @@ par_udf_t *udf;
printf("finished to register python interface\n");
#endif

return;
return SUCCESS;
}


Expand Down
2 changes: 1 addition & 1 deletion src/modules/higher-level/py-udf-hl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Python UDF plug-in header
extern "C" {
#endif

void register_python(par_hl_t *phl);
int register_python(par_hl_t *phl);
void deregister_python(par_hl_t *phl);
void init_pyp(ard_t *ard, tsa_t *ts, int submodule, char *idx_name, int nb, int nt, par_udf_t *udf);
void term_pyp(par_udf_t *udf);
Expand Down

0 comments on commit c2587a9

Please sign in to comment.