<commit_before>/*******************************************************************************
 ** Copyright <NAME> 2014
 ** Picker routines
 *******************************************************************************/

#include <Python.h> // includes stdio.h, string.h, errno.h, stdlib.h
#include <numpy/arrayobject.h>
#include <math.h>
#include "boxeslib.h"
#include "utilities.h"
#include "array_utils.h"


static PyObject* pickObject(PyObject*, PyObject*);


/*******************************************************************************
 ** List of python methods available in this module
 *******************************************************************************/
static struct PyMethodDef methods[] = {
    {"pickObject", pickObject, METH_VARARGS, "Check if an object has been pickeds"},
    {NULL, NULL, 0, NULL}
};

/*******************************************************************************
 ** Module initialisation function
 *******************************************************************************/
PyMODINIT_FUNC
initpicker(void)
{
    (void)Py_InitModule("picker", methods);
    import_array();
}

/*******************************************************************************
 ** Check if an object has been picked
 *******************************************************************************/
static PyObject*
pickObject(PyObject *self, PyObject *args)
{
    int visibleAtomsDim, *visibleAtoms, vacsDim, *vacs, intsDim, *ints, onAntsDim, *onAnts, splitsDim, *splits;
    int *PBC, *specie, *refSpecie;
    double *pickPos, *pos, *refPos, *cellDims, *minPos, *maxPos, *specieCovRad, *refSpecieCovRad, *result;  
    PyArrayObject *visibleAtomsIn=NULL;
    PyArrayObject *vacsIn=NULL;
    PyArrayObject *intsIn=NULL;
    PyArrayObject *onAntsIn=NULL;
    PyArrayObject *splitsIn=NULL;
    PyArrayObject *pickPosIn=NULL;
    PyArrayObject *posIn=NULL;
    PyArrayObject *refPosIn=NULL;
    PyArrayObject *PBCIn=NULL;
    PyArrayObject *cellDimsIn=NULL;
    PyArrayObject *minPosIn=NULL;
    PyArrayObject *maxPosIn=NULL;
    PyArrayObject *specieIn=NULL;
    PyArrayObject *refSpecieIn=NULL;
    PyArrayObject *specieCovRadIn=NULL;
    PyArrayObject *refSpecieCovRadIn=NULL;
    PyArrayObject *resultIn=NULL;
    
//def pickObject(visibleAtoms, vacs, ints, onAnts, splits, pickPos, pos, refPos, PBC, cellDims, minPos, maxPos, specie, refSpecie,
//               specieCovRad, refSpecieCovRad, result):
//int pickObject(int visibleAtomsDim, int *visibleAtoms, int vacsDim, int *vacs, int intsDim, int *ints, 
//               int onAntsDim, int *onAnts, int splitsDim, int *splits, int pickPosDim, double *pickPos,
//               int posDim, double *pos, int refPosDim, double *refPos, int PBCDim, int *PBC, 
//               int cellDimsDim, double *cellDims, int minPosDim, double *minPos, int maxPosDim, double *maxPos,
//               int specieDim, int* specie, int refSpecieDim, int *refSpecie, int specieCovRadDim, double* specieCovRad,
//               int refSpecieCovRadDim, double* refSpecieCovRad, int resultDim, double *result)
//{
    int i, k, index, boxIndex;
    int boxNebList[27], realIndex;
    int minSepIndex, NVis, count;
    int minSepType;
    double approxBoxWidth, *visPos;
    double sep2, minSep, rad, sep;
    double *visCovRad;
    struct Boxes *boxes;<commit_msg>Tidy up some code<commit_after>/*******************************************************************************
 ** Copyright <NAME> 2014
 ** Picker routines
 *******************************************************************************/

#include <Python.h> // includes stdio.h, string.h, errno.h, stdlib.h
#include <numpy/arrayobject.h>
#include <math.h>
#include "boxeslib.h"
#include "utilities.h"
#include "array_utils.h"


static PyObject* pickObject(PyObject*, PyObject*);


/*******************************************************************************
 ** List of python methods available in this module
 *******************************************************************************/
static struct PyMethodDef methods[] = {
    {"pickObject", pickObject, METH_VARARGS, "Check if an object has been pickeds"},
    {NULL, NULL, 0, NULL}
};

/*******************************************************************************
 ** Module initialisation function
 *******************************************************************************/
PyMODINIT_FUNC
initpicker(void)
{
    (void)Py_InitModule("picker", methods);
    import_array();
}

/*******************************************************************************
 ** Check if an object has been picked
 *******************************************************************************/
static PyObject*
pickObject(PyObject *self, PyObject *args)
{
    int visibleAtomsDim, *visibleAtoms, vacsDim, *vacs, intsDim, *ints, onAntsDim, *onAnts, splitsDim, *splits;
    int *PBC, *specie, *refSpecie;
    double *pickPos, *pos, *refPos, *cellDims, *minPos, *maxPos, *specieCovRad, *refSpecieCovRad, *result;  
    PyArrayObject *visibleAtomsIn=NULL;
    PyArrayObject *vacsIn=NULL;
    PyArrayObject *intsIn=NULL;
    PyArrayObject *onAntsIn=NULL;
    PyArrayObject *splitsIn=NULL;
    PyArrayObject *pickPosIn=NULL;
    PyArrayObject *posIn=NULL;
    PyArrayObject *refPosIn=NULL;
    PyArrayObject *PBCIn=NULL;
    PyArrayObject *cellDimsIn=NULL;
    PyArrayObject *minPosIn=NULL;
    PyArrayObject *maxPosIn=NULL;
    PyArrayObject *specieIn=NULL;
    PyArrayObject *refSpecieIn=NULL;
    PyArrayObject *specieCovRadIn=NULL;
    PyArrayObject *refSpecieCovRadIn=NULL;
    PyArrayObject *resultIn=NULL;
    
    int i, k, index, boxIndex;
    int boxNebList[27], realIndex;
    int minSepIndex, NVis, count;
    int minSepType;
    double approxBoxWidth, *visPos;
    double sep2, minSep, rad, sep;
    double *visCovRad;
    struct Boxes *boxes;
{'fraction_non_alphanumeric': 0.3066142539736797, 'fraction_numerical': 0.00273457528627585, 'mean_word_length': 5.487804878048781, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6232394', 'n_tokens_mistral': 1730, 'n_tokens_neox': 1655, 'n_words': 409}