Oops, I meant '"Cython" is its own language,' not "Python" (although Python
qualifies, too, just not in context).
Also, Pyrex, listed in the c-info.python-as-glue.html page, was the pre-cursor
to Cython.
-Bill
On Oct 27, 2014, at 10:20 AM, Bill Spotz wrote:
>
age, right? So, if I want to
> interactively call C++ functions from say ipython, then is cython really an
> option?
>
> Thanks for the feedback --
> Glen
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.
very happy to hear
> about what I'm missing.
>
> I'm sure there's a documented way to submit this file to the git repo, but
> let me simultaneously ask whether list subscribers think this is worthwhile
> and ask someone to add+push it for me …
>
> Thanks,
>
unused" has the
> correct value before you pass the numpy array data on to your
> function.
>
> The only point where the check could be made would be in the run
> function which should not be run with a value longer than the array
> length.
>
>
> On 22 November 2013
; ++i) $2 *= array_size(array,i);
> }
>
> which I tried to apply with:
>
>
> %apply (LilvInstance* instance, uint32_t port_index, float* INPLACE_ARRAY1,
> int DIM1) {(LilvInstance* instance, uint32_t port_index, float*
> data_location, int unused)}
>
> But it doesn’t
lly want to wrap,
> as they don’t have a dimension argument.
>
> Is it not possible to use INPLACE_ARRAY1 without a dimension?
>
> Thanks for any help,
>
> Kaspar
>
>
> ___
> NumPy-
;>
>>> Thanks
>>> Burlen
>>> ___
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>> _
https://github.com/wfspotz/numpy/compare/numpy-swig
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-0370Email: wfsp...@sandia.gov
Is there documentation for the new C API for numpy?
Thanks,
Bill
On Feb 26, 2013, at 2:04 PM, Bill Spotz wrote:
> So the difference is that I was wanting to make changes in the git repository
> that is at version 1.8. I would expect it to still work, though.
>
> I can take a
So the difference is that I was wanting to make changes in the git repository
that is at version 1.8. I would expect it to still work, though.
I can take a look at the scipy issue.
-Bill
On Feb 26, 2013, at 1:41 PM, Ralf Gommers wrote:
> On Mon, Feb 25, 2013 at 6:12 AM, Bill Spotz wr
something simple
> that has the same issue. I'll post something here when I can get to it.
> - Tom
>
>
> On Tue, Oct 9, 2012 at 10:52 AM, Bill Spotz wrote:
> Tom, Charles,
>
> If you discuss this further, be sure to CC me.
>
> -Bill Spotz
>
> On Oct 9,
Tom, Charles,
If you discuss this further, be sure to CC me.
-Bill Spotz
On Oct 9, 2012, at 8:50 AM, Charles R Harris wrote:
> Hi Tom,
>
> On Tue, Oct 9, 2012 at 8:30 AM, Tom Krauss wrote:
> Hi,
>
> I've been happy to use numpy.i for generating SWIG interfaces to C++.
2-D
> array. Any help on why this error is happening would be great!
>
>
> Thank you,
> Dylan Temple
>
> --
> Dylan Temple
> Graduate Student, University of Michigan NA&ME Department
> B.E. Naval Architecture
>
rray) {
>>
>> int j;
>> for(j=0;jnd;j++) {
>> printf("Ok array dim %i has length: %i\n",j,nparray->dimensions[j]);
>> }
>>}
** Bill Spotz **
** Sandia National Laboratories Voice: (505)8
lp you are able to give. (I spent the whole afternoon
> trying to get this bloomin thing to work).
>
> cheers,
> Andrew.
>
> --
> _
> Dr. Andrew Nelson
>
>
> _
> ___
> NumPy-Discussion mailing list
&g
> but I'd be happy to have anything right now. I'm also quite comfortable with
> the idea of packing z as a column array and reshaping it as necessary.
>
>
> -gideon
>
> _____
of
> boost.python so far.
>
> Regards Holger
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
** Bill Spotz **
** S
Chuck,
I provided a little more context in another email. The user is using numpy
1.6.1 with python 2.6. I asked him to try an earlier version -- we'll see how
it goes. This is code that has worked for a long time. It still works on my
laptop and on our test platforms.
The behavior on the
ect, and what I typically get, is
> a numpy scalar array of type C long. I had my user print the result using
> PyObject_Print() and what he got was
>
> array([0:00:00], dtype=timedelta64[us])
>
> I am stuck as to why this might be happening. Any ideas?
>
> Thanks
>
When you download numpy, it should be in doc/swig/numpy.i
On Feb 26, 2011, at 6:15 PM, Brandt Belson wrote:
> I just want to know exactly how to get the file numpy.i (for SWIG), I've come
> across links that seem to take me nowhere.
> Thank you.
tex.py.
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-0370Email: wfsp...@sand
> %include "numpy.i"
>
> %init %{
> import_array();
> %}
>
> %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na), (float
> *b, int nb)};
>
> %include "example.h"
>
>
>
>
** Bill Spotz
bug ?
>
>
> Likely.
>
> Now, if I use the typemaps of numpy.i I can choose between NPY_LONG
> and NPY_INT.
> But those are sometimes 32 sometimes 64 bit, depending on the system.
>
> Any ideas ... ?
>
> npy_intp.
>
> Chuck
** Bill Spotz
t;
> matrix.vecOut([1,2,3])
> Traceback (most recent call last):
> TypeError: vecOut() takes exactly 4 arguments (1 given)
>
> I expected to get [1,2,3]...
>
>
> Is it possible to do this with SWIG? Or should I use something else?
> Any advice?
>
> I thank
t; PyObject* obj = PyArray_SimpleNewFromData (1,dims,PyArray_UINT,
> $1.ptr());
> $result = obj;
> }
>
> template navlib::array getContainer();
> %template(getContainerN ) getContainer;
** Bill Spotz
It ends up after the fragment code in the wrapper so
> the compiler is complaining.
>
> thanks,
> ross
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
**
cipy.org/mailman/listinfo/numpy-discussion
>>
>
>
>
> --
> Rohit Garg
>
> http://rpg-314.blogspot.com/
>
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay
> ___
> Nu
k;
>default:
>PyErr_Format(PyExc_Exception, "Unknown exception");
> }
>SWIG_fail;
>}
> }
>
> Cheers,
> Egor
>
> On Sun, Aug 9, 2009 at 2:30 PM, Bill Spotz wrote:
>> Egor,
>>
>> This looks about ri
t;case ENOMEM:
>PyErr_Format(PyExc_MemoryError, "Failed malloc()");
>break;
>default:
>PyErr_Format(PyExc_Exception, "Unknown exception");
>}
>return NULL;
>}
> }
>
>
}
>
> %include "numpy.i"
>
> %init %{
> import_array();
> %}
>
> %ignore Array2D();
> %ignore Array2D(long nrow, long ncol);
> %apply (int DIM1, int DIM2, double* IN_ARRAY2) {(int nrow, int ncol,
> double *data)}
> %include "Array2D.h&quo
gt; to do it ?
>
> Thanks
>
> ---
> Kevin Françoisse
> Ph.D. at Machine Learning Group at UCL
> Belgium
> kevin.francoi...@uclouvain.be
>
> On Tue, Mar 24, 2009 at 6:13 PM, Bill Spotz
> wrote:
> Kevin,
>
> You need to declare vecSum() *after* you %inc
wrapped module in
> python with an small NumPy array, here what I get :
>
> >>> import matrix
> >>> from numpy import *
> >>> a = arange(10)
> >>> matrix.vecSum(a,a.shape[0])
> Traceback (most recent call last):
> File &quo
, at 2:16 AM, Stéfan van der Walt wrote:
> Hi all,
>
> I've given ticket #750 a shot. Since I was not previously familiar
> with SWIG, I would appreciate it if those of you who know it could
> take a look at the proposed patch:
>
> http://codereview.appspot.com/2890
>
On May 21, 2008, at 5:15 PM, Robert Kern wrote:
> On Wed, May 21, 2008 at 3:34 PM, Bill Spotz <[EMAIL PROTECTED]>
> wrote:
>> I am running into a problem with a numpy-compatible extension module
>> that I develop, and I believe it has to do with
>> PY_AR
ave access to.
Any ideas on what I should be looking for?
Thanks
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-0370
> copies of it, because speed will be an important factor.
>
> Thanks in advance!
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 F
break would be indexing the extracted row/
column with two indexes. Multiplication with the extracted row/column
would still work as expected (and that sounded to me like what the
application typically was . . . maybe I'm wrong).
** Bill Spotz **
P) and an Epetra_MultiVector for b and x. The most
common way to call them is with an Epetra_CrsMatrix and an
Epetra_Vector, but the flexibility is there.
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800
On Apr 28, 2008, at 10:47 PM, Bill Spotz wrote:
> As for this example, my version should work with a properly
> implemented sparse_matrix A, but the array approach precludes that.
> That is to say, I could convert A to a matrix if it is provided as an
> array, but you could n
On Apr 28, 2008, at 10:15 PM, Alan G Isaac wrote:
> On Mon, 28 Apr 2008, Bill Spotz apparently wrote:
>> http://www.scipy.org/ConjugateGradientExample ... provides
>> one small area where the vector classes would be useful.
>
> Maybe not.
> I posted an alternate version o
On Apr 24, 2008, at 8:52 PM, Bill Spotz wrote:
On Apr 24, 2008, at 5:45 PM, Timothy Hochberg wrote:
Bill Spotz wrote:
> I have generally thought about this in the context of, say, a
> Krylov-space iterative method, and what that type of interface
would
> lead to the most readable c
On Apr 24, 2008, at 5:45 PM, Timothy Hochberg wrote:
Bill Spotz wrote:
> I have generally thought about this in the context of, say, a
> Krylov-space iterative method, and what that type of interface would
> lead to the most readable code.
Can you whip up a small example, starting
g this discussion have been
> examples
> of iterating and indexing -- not one has actually been linear
> algebra --
> perhaps we should see some of those before making any decisions.
Right. I have generally thought about this in the context of, say, a
Krylov-space iterative metho
;, referenced from:
> ___gxx_personality_v0$non_lazy_ptr in cct0CmDB.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
> Anyone have any idea what I am doing wrong?
These "personality" errors indicate a version mismatch with the gcc
compiilers.
**
ample of the additional capabilities Alan has
been asking about.
(I am assuming here a compressed-row or compressed-column storage
format, but I think it could apply to other sparse matrix formats as
well.)
** Bill Spotz **
** Sandi
float64 works...
>
> I can see why one could argue for returning False, but then the
> converter might be too zealous
> things that used to work like:
> if type(item) in [types.IntType, types.FloatType]:
>
> or:
>
> isinstance(item, types.FloatType)
>
to look at. I also
built in quite a bit of compatibility with numpy.
On Apr 7, 2008, at 8:14 AM, lan haiping wrote:
> Dear Guys @list :
> I wanna do some application with mulgrid method for electrostatic
> problems,
> is there some python package available for my purpose ?
*
phrase "masked_where" :-(
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-
Numeric, and *talk* of upgrading
them to numpy, but it hasn't happened yet, to my knowledge.
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerq
g interface file for numpy in numpy/doc/swig,
along with documentation on how to use it. It is largely geared
towards generating wrappers to C/C++ functions that take pointers to
arrays. If your data is encapsulated within a C++ class, then it
gets more complicated.
**
ively, make this the default behavior if NPY_FORCECAST is
false?)
Thanks
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-0370Ema
so write about 1D FORTRAN ARGOUTVIEW
> wrappers:
>
> ( DATA_TYPE** ARGOUTVIEW_FARRAY1, DIM_TYPE* DIM1 )
> ( DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_FARRAY1 )
>
> which of course do not exist.
** Bill Spotz **
** Sandia National Laboratori
.
> corresponding, delete[] or free() [respectively], de-allocation
> function is called.
>
> When is the memory being freed ?
> Is (or can !) python taking ownership of the memory and calls the
> correct "free"/"delete[]" function ?
** Bill Spotz
all of these changes.
On Nov 26, 2007, at 3:52 PM, Christopher Barker wrote:
> Bill Spotz wrote:
>> First, my plan is to add to numpy.i, typemaps for signatures like the
>> following:
>>
>> %typemap(argout) (double** ARGOUT_ARRAY1, int* DIM1)
>>
>> It is
example:
> class_example.h: the C++ code
> class_example.i: the SWIG interface file
> class_example_usage.py: example usage in python
>
>
> And some comments:
>
> Bill Spotz schrieb:
>> Here is what I am proposing you do: in your interface file, add
>> something l
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170
on :-)
Travis may be able to better explain.
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-0154 **
** Albuquerque, NM 87185-0370Email: [E
to the data. This has to be useless to the function. After
the function returns, you access this pointer as if it points to
meaningful data. How is this possible? The address of t1 isn't
going to change, and only a single element is allocated.
** Bill Spotz
face. So your experience is that the flags and strides are
all that have to be set differently?
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax:
ere own wrappers and tune them to
> their needs.
In the end, though, I think it would be far better to add new
capabilities to numpy.i rather than duplicate effort. This will
never be as big as the Numeric/numarray split, but still
Let me know what you are trying to do. If numpy.i can do
, communicator and domain decomposition classes. The
PyTrilinos interface to Epetra has been designed with a high degree
of compatibility with numpy, with the hope of complementing the SciPy
development efforts.
** Bill Spotz **
** Sandia National
cxx file that won't build. Do I have to do
> something different in the setup.py?
I use numpy.i with C++ all the time. Let me know the specific nature
of your problem and I'll look into it.
** Bill Spotz **
** Sandia National Labo
mailman/listinfo/numpy-discussion
>>>>>
>>>>>
>>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>>
>>>> ___
>>>> Numpy-discussion mailing list
>>>> N
On Sep 5, 2007, at 11:38 AM, Christopher Barker wrote:
> Of course, it should be possible to write C++ wrappers around the core
> ND-array object, if anyone wants to take that on!
boost::python has done this for Numeric, but last I checked, they
have not upgraded to numpy.
** Bill
On Sep 5, 2007, at 11:19 AM, Christopher Barker wrote:
> Bill Spotz wrote:
>> I have been considering adding some C++ STL support to numpy/doc/
>> swig/
>> numpy.i. Probably std::vector <=> PyArrayObject (and some
>> std::complex support as well). Is this wh
org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800 Fax: (505)284-5451 **
** Al
On Mar 29, 2007, at 6:48 PM, Alan G Isaac wrote:
> On Thu, 29 Mar 2007, Bill Spotz apparently wrote:
>> What I envisioned was that M[i,:] would return
>> a row_vector and M[:,j] would return a column_vector,
>> because this would be symmetric behavior. M[i], by
>> c
] and M[0,:] would
> have to be different things? Or would you then want even
> such numpy indexing not to produce matrices??
>
> Cheers,
> Alan Isaac
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
**
the matrix need to have the same behaviors
> and should be able to interoperate with each other.
>
> So, if you would like to help with that project all input is welcome.
** Bill Spotz **
** Sandia National Laboratorie
aces where the more sophisticated
PyArray_Descr approach would be beneficial, such as for bools and
complex types (as well as a bunch of others, I'm assuming), so I'm
open to it, but it would take some work.
On Mar 24, 2007, at 12:39 PM, Sebastian Haase wrote:
> On 3/24/07, Bill
t
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
** Bill Spotz **
** Sandia National Laboratories Voice: (505)845-0170 **
** P.O. Box 5800
OK, I looked at the varin, varout descriptions in the online manual,
and they specifically mention global variables, but WOW is that
documentation minimal. I would suggest asking Swig-
[EMAIL PROTECTED] for some assistance.
On Feb 16, 2007, at 1:10 PM, Bill Spotz wrote:
> Andrea,
>
&
e is destroyed, but I'll leave that as an exercise...
On Feb 16, 2007, at 10:59 AM, Andrea Tomadin wrote:
> Il giorno 15/feb/07, alle ore 22:26, Bill Spotz ha scritto:
>
>> It seems to me you would need to %ignore vec, so that it is not
>> wrapped as a raw pointe
gain by Swig...
>
> Any practical example is highly appreciated!
>
> Regards,
> Andrea
>
> ___
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
I believe the person most qualified to answer that question would be
Mary Haley, (haley at ucar.edu).
On Feb 9, 2007, at 10:33 AM, Christopher Barker wrote:
> Has anyone done a review of these to see where effort would best be
> put
> into upgrading?
** B
to fix.
>
> Am I attempting the impossible here or am I just doing something
> fundamentally and obviously wrong?
>
> David
>
> --
> David Bogen :: (608) 263-0168
> Unix SysAdmin :: IceCube Project
> [EMAIL PROTECTED]
> _
76 matches
Mail list logo