You can subscribe to this list here.
2000 |
Jan
(8) |
Feb
(49) |
Mar
(48) |
Apr
(28) |
May
(37) |
Jun
(28) |
Jul
(16) |
Aug
(16) |
Sep
(44) |
Oct
(61) |
Nov
(31) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(56) |
Feb
(54) |
Mar
(41) |
Apr
(71) |
May
(48) |
Jun
(32) |
Jul
(53) |
Aug
(91) |
Sep
(56) |
Oct
(33) |
Nov
(81) |
Dec
(54) |
2002 |
Jan
(72) |
Feb
(37) |
Mar
(126) |
Apr
(62) |
May
(34) |
Jun
(124) |
Jul
(36) |
Aug
(34) |
Sep
(60) |
Oct
(37) |
Nov
(23) |
Dec
(104) |
2003 |
Jan
(110) |
Feb
(73) |
Mar
(42) |
Apr
(8) |
May
(76) |
Jun
(14) |
Jul
(52) |
Aug
(26) |
Sep
(108) |
Oct
(82) |
Nov
(89) |
Dec
(94) |
2004 |
Jan
(117) |
Feb
(86) |
Mar
(75) |
Apr
(55) |
May
(75) |
Jun
(160) |
Jul
(152) |
Aug
(86) |
Sep
(75) |
Oct
(134) |
Nov
(62) |
Dec
(60) |
2005 |
Jan
(187) |
Feb
(318) |
Mar
(296) |
Apr
(205) |
May
(84) |
Jun
(63) |
Jul
(122) |
Aug
(59) |
Sep
(66) |
Oct
(148) |
Nov
(120) |
Dec
(70) |
2006 |
Jan
(460) |
Feb
(683) |
Mar
(589) |
Apr
(559) |
May
(445) |
Jun
(712) |
Jul
(815) |
Aug
(663) |
Sep
(559) |
Oct
(930) |
Nov
(373) |
Dec
|
From: Marc P. <Mar...@on...> - 2002-11-19 12:24:39
|
Konrad Hinsen wrote: > > If I understand you correctly, you want NumPy to create an array > object and allocate the data space, but make sure that the data space > is not freed before you "allow" it. In that case, just create an > ordinary array and keep an additional reference to it. When the data > space may be destroyed, you remove the reference. However, there is no > guarantee that the data space will be freed immediately, as there > might still be other references around. > No. I want to set the memory zone of the array but once this zone is set, I want numpy to manage it as if it was owner of the memory. I have an external lib which allocates the returned memory zone. I put this memory zone into a PyArrayObject using PyArray_FromDimsAndData in order to avoid memory copy. But I want now this array to be the owner of the allocated zone. I mean I want this zone to be released if the Python object is deleted. The ref count of Python is ok for me, as long as an array is sharing the data, python won't release it. But I want Python to delete the memory zone if the last reference is removed. Marcvs [alias I'll have a try with myarray->flags |= OWN_DATA; and I'll let you know about my experiments...] |
From: Konrad H. <hi...@cn...> - 2002-11-19 11:29:58
|
Marc Poinot <Mar...@on...> writes: > That's what I want. Or more exactly, I want "global data that will never be > freed by Numpy, until I tell it to do so !" That option does not exist. The options are: 1) NumPy manages the data space of your array. It gets freed when the last array object referencing it is destroyed. 2) NumPy assumes that the data space is already allocated and is not freed as long as any array object might reference it (which, in practice, is until the end of the process). PyArray_FromDimsAndData is used for allocating arrays that choose the second option. If I understand you correctly, you want NumPy to create an array object and allocate the data space, but make sure that the data space is not freed before you "allow" it. In that case, just create an ordinary array and keep an additional reference to it. When the data space may be destroyed, you remove the reference. However, there is no guarantee that the data space will be freed immediately, as there might still be other references around. > [2] Can I use the PyArrayObject.flags bit "owns the data area" to set it > after the PyArray_FromDimsAndData call ? In the case of "yes", which Whatever this does, it is not documented. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |
From: Marc P. <Mar...@on...> - 2002-11-19 08:57:32
|
Hi all, I use the Numpy C API to produce/use some PyArrayObjects. To set the allocated memory zone, I use the PyArray_FromDimsAndData function, which is described to "be used to access global data that will never be freed". That's what I want. Or more exactly, I want "global data that will never be freed by Numpy, until I tell it to do so !" I mean some of my arrays are allocated and used as PyArrayObject data, but I want some of them to be seen by Numpy as its own data. I want it to deallocate the data at delete time. My questions are : [1] Is PyArray_FromDimsAndData the right function or should I use another way ? [2] Can I use the PyArrayObject.flags bit "owns the data area" to set it after the PyArray_FromDimsAndData call ? In the case of "yes", which is the bit rank ? The fourth starting from right ? Any macro already doing this ? Will I break the PyArrayObject consistency ? Marcvs [alias yes I can go into the code... I though OO was reading docs and using interfaces ;] |
From: Paul F D. <pa...@pf...> - 2002-11-08 01:14:18
|
Please note that the numpy-developers list is no longer active. Do not send mail to this address; it will be discarded. Use numpy-discussion for questions and problems and the bug list at Source Forge for actual bugs only. Thanks! |
From: Travis O. <oli...@ee...> - 2002-11-07 18:31:44
|
> > Hello, > > I'm have both Python 1.5 and Python2.2.1 on a Redhat 7.3 system, and > when I try to install Numerical Python (v. 22), I get an error telling > me that it cannot find the file /usr/lib/python2.2/config/Makefile. The > command I use for the install is: python2 install.py build. The > Python2.2 install comes directly from the RPMs on the python.org web > site. Does anyone know how I might resolve this? You probably need the python-devel package also. -Travis O. |
From: Francesc A. <fa...@op...> - 2002-11-07 18:13:40
|
On Thu, Nov 07, 2002 at 10:37:31AM -0700, bondpaper wrote: > I'm have both Python 1.5 and Python2.2.1 on a Redhat 7.3 system, and > when I try to install Numerical Python (v. 22), I get an error telling > me that it cannot find the file /usr/lib/python2.2/config/Makefile. The > command I use for the install is: python2 install.py build. The > Python2.2 install comes directly from the RPMs on the python.org web > site. Does anyone know how I might resolve this? It should be. Maybe you need to install the development version packages of python. For 2.2.1 you can find it at: http://www.python.org/ftp/python/2.2.1/rpms/rh7.3/python2-devel-2.2.1-2.i386.rpm Bye, -- Francesc Alted PGP KeyID: 0x61C8C11F Scientific aplications developer Public PGP key available: http://www.openlc.org/falted_at_openlc.asc Key fingerprint = 1518 38FE 3A3D 8BE8 24A0 3E5B 1328 32CC 61C8 C11F |
From: bondpaper <bon...@ea...> - 2002-11-07 17:32:18
|
Hello, I'm have both Python 1.5 and Python2.2.1 on a Redhat 7.3 system, and when I try to install Numerical Python (v. 22), I get an error telling me that it cannot find the file /usr/lib/python2.2/config/Makefile. The command I use for the install is: python2 install.py build. The Python2.2 install comes directly from the RPMs on the python.org web site. Does anyone know how I might resolve this? Thanks. Tom |
From: <in...@ws...> - 2002-11-07 11:57:26
|
=3Chtml=3E =3Chead=3E =3Cmeta http-equiv=3D=22content-type=22 content=3D=22text=2Fhtml=3B charset=3Deuc-kr=22=3E =3Ctitle=3EThis is one time email campaign for WSNTV100 =3C=2Ftitle=3E =3C=2Fhead=3E =3Cbody bgcolor=3D=22white=22 text=3D=22black=22 link=3D=22blue=22 vlink=3D=22purple=22 alink=3D=22red=22=3E =3Cdiv align=3D=22left=22=3E =3Ctable cellpadding=3D=220=22 cellspacing=3D=220=22 width=3D=22650=22 bordercolor=3D=22white=22=3E =3Ctr=3E =3Ctd width=3D=22749=22=3E =3Cp=3E=3Cimg src=3D=22http=3A=2F=2Fwsn100=2Ecom=2Fimages=2Ftop-mail100=2Ejpg=22 width=3D=22700=22 height=3D=2281=22 border=3D=220=22=3E=3C=2Fp=3E =3C=2Ftd=3E =3C=2Ftr=3E =3Ctr=3E =3Ctd width=3D=22749=22=3E =3Cp align=3D=22right=22=3E=3Cfont face=3D=22Arial=22=3E=3Cspan style=3D=22font-size=3A10pt=3B=22=3E=3Cb=3ELooking for creative and talented managers and producers =3Cbr=3Ewho can work and earn on a part time basi=3C=2Fb=3E=3C=2Fspan=3E=3C=2Ffont=3E=3Cspan style=3D=22font-size=3A10pt=3B=22=3E=3Cfont face=3D=22Arial=22=3E=3Cb=3Es=3C=2Fb=3E=3C=2Ffont=3E=3C=2Fspan=3E=3C=2Fp=3E =3C=2Ftd=3E =3C=2Ftr=3E =3Ctr=3E =3Ctd width=3D=22749=22=3E =3Cp=3E=3Cfont face=3D=22Arial=22=3E=3Cspan style=3D=22font-size=3A10pt=3B=22=3E=3Cbr=3EWorld Server Network TV =28WSN TV=29 is a global education=2C entertainment and media organization=2E Our goals are to bring low-cost higher education and entertainment to the worldwide population=2C and to promote the spread of broadband internet access that will make it possible to achieve those goals=2E=3Cbr=3E=3Cbr=3EWould you like to work in teams to develop online business=2C produce videos=2C television shows=2C and wide range of multimedia content on a part-time basis in an online environment=3F =3Cbr=3E=3Cbr=3EIdeal candidates for both WSN University and WSNTV have practical experience teaching at a college=2C consulting in business=2C managing in a corporation=2C and=2For working as an entrepreneur=2E  =3BAll participants share in the profit and=2For part-ownership of our companies=2E Help us create a university and multimedia studio like no other=2E  =3B=3Cbr=3E=3Cbr=3EWe are looking for creative=2C highly motivated individuals who either wish to work as executives=2C managers=2C executive producers=2C professors=2C members and students and to develop our ground-breaking online business on a part-time basis=2E =3Cbr=3E=3Cbr=3EMore information is available by clicking the links below=3A=3Cbr=3EIour Membership Remuneration Package at =3Ca href=3D=22http=3A=2F=2Fwsntv100=2Ecom=2Findex=2Ephp=3Fcontent=3Dcorp=5Fprofile=2Ehtm=22 target=3D=22=5Fself=22=3Ehttp=3A=2F=2Fwsntv100=2Ecom=2Fcorp=5Fprofile=2Ehtm=2C=3C=2Fa=3E =3Cbr=3Eour Ph=2CD=2FMBA curriculum and reward at =3Ca href=3D=22http=3A=2F=2Fwsntv100=2Ecom=2Findex=2Ephp=3Fcontent=3Dreward=2Ehtm=22 target=3D=22=5Fself=22=3Ehttp=3A=2F=2Fwsntv100=2Ecom=2Freward=2Ehtm=3C=2Fa=3E=2C =3Cbr=3Eour co-ownership opportunities at =3Ca href=3D=22http=3A=2F=2Fwsntv100=2Ecom=2Findex=2Ephp=3Fcontent=3Dwsntvemp=2Ehtm=22 target=3D=22=5Fself=22=3Ehttp=3A=2F=2Fwsntv100=2Ecom=2Fwsntvemp=2Ehtm=3C=2Fa=3E=2C and=3Cbr=3EEvaluation Methodology at =3Ca href=3D=22http=3A=2F=2Fwsntv100=2Ecom=2Findex=2Ephp=3Fcontent=3Devaluation=2Ehtm=22 target=3D=22=5Fself=22=3Ehttp=3A=2F=2Fwsntv100=2Ecom=2Fevaluation=2Ehtm=3C=2Fa=3E=2E=3Cbr=3E=3Cbr=3EShould you have specific questions about WSNTV or what your role with us could be=2C please do not hesitate to contact us at=3Ca href=3D=22mailto=3Ainfo=40wsntv100=2Ecom=3Fsubject=3Dmore info=22 target=3D=22=5Fself=22=3E info=40wsntv100=2Ecom=3C=2Fa=3E=2E=3Cbr=3E=3Cbr=3EWe look forward to hearing from you=2E=3Cbr=3E=3Cbr=3EBest wishes=3Cbr=3E=3Cbr=3EChris YH Kim=2C Chairman=3Cbr=3EWSNTV 100 Inc=2E=3Cbr=3E=3Ca href=3D=22http=3A=2F=2Fwsntv100=2Ecom=22 target=3D=22=5Fself=22=3Ehttp=3A=2F=2Fwsntv100=2Ecom=3C=2Fa=3E=3Cbr=3E =3B=3C=2Fspan=3E=3C=2Ffont=3E=3C=2Fp=3E =3C=2Ftd=3E =3C=2Ftr=3E =3Ctr=3E =3Ctd width=3D=22749=22 bgcolor=3D=22#CCCCCC=22=3E =3Cp=3E=3Cfont face=3D=22Arial=22=3E=3Cspan style=3D=22font-size=3A10pt=3B=22=3E=3Ca href=3D=22mailto=3Ainfo=40wsntv100=2Ecom=3Fsubject=3Dremove=22 target=3D=22=5Fself=22=3ERemove=3C=2Fa=3E=3Cbr=3EE-mail based commercial communication avoids unnecessary spending on catalogs and paper=2C and helps to preserve valuable natural resources such as forests and oil=2E We do not wish to share our valuable information about broadband business with those who are not interested=3B only those who want to participate in our projects=2E Should you not wish to receive information from us in the future=2C please click =3Ca href=3D=22mailto=3Ainfo=40wsntv100=2Ecom=3Fsubject=3Dremove=22 target=3D=22=5Fself=22=3ERemove=3C=2Fa=3E=2E=3Cbr=3E=3Cbr=3EEven though our database cleansing might be subject to delay or error=2C we will remove your e-mail address permanently from our database=2E However=2C please realise that removal from our database does not guarantee that your e-mail address will be deleted from the many other e-mail marketers who construct databases themselves by harvesting from web sites=2C or by buying any of the thousands of lists of e-mail addresses that are openly for sale on the internet=2E=3C=2Fspan=3E=3C=2Ffont=3E=3C=2Fp=3E =3C=2Ftd=3E =3C=2Ftr=3E =3C=2Ftable=3E =3C=2Fdiv=3E =3Cp=3E =3B=3C=2Fp=3E =3C=2Fbody=3E =3C=2Fhtml=3E |
From: Francesc A. <fa...@op...> - 2002-11-06 16:15:37
|
Hi, I'm having some segmentation faults when dealing with large rank arrays in Numeric. You can see some examples in the following: >>> zeros((1,) * 21) == zeros((1,) * 21) Segmentation fault Of course, this kind of usage is quite unusual, but I'm interested on it because I'm developing tests for a package based on Numerical and wanted to check the larger rank supported. >>> ones((1,) * 41) Segmentation fault In this case, I know that Numeric supports array ranks until 40, but in opinion, an error should be raised instead of merely givin a "Segmentation fault". I'm having these problems using Numeric 20.2.1, 21.0 and 22.0 in both Python 2.1.x and 2.2.x. My platform is Intel under Linux Debian 3.0. Thank you, -- Francesc Alted PGP KeyID: 0x61C8C11F Scientific aplications developer Public PGP key available: http://www.openlc.org/falted_at_openlc.asc Key fingerprint = 1518 38FE 3A3D 8BE8 24A0 3E5B 1328 32CC 61C8 C11F |
From: Nobody <no...@ma...> - 2002-10-30 01:33:12
|
<html> <head> <title>Untitled</title> </head> <body> <h1 align="center"><font size="+3"><font color="red">Hello all E-Gold and EVOcash account holders!</font></font></h1> <P align=justify><b> We here at Your Gold Chance are honest, reliable and willing to help you achieve what you want most..... A larger e-gold balance! We have developed a program to give you a smart return without the usual wait of hyip's. For speed and convenience we utilize online digital currencies. We accept E-Gold and EVOcash.</b></P><B> <P align=justify> All investments are based on a 33 week plan. We pay you 10% per week for a total of 33 weeks. You first payment starts 7 days after you invest and your capital is returned to you at the end of the 33th week.</P> <P align=justify> The minimum Investment is $25.00USD and the maximum Investment is $25,000 USD. Do not send us any amount outside these parameters otherwise your investment will be returned without profit.<br></P></B> <p align="left"><font size="+1"><font color="Red">If you are interested in this program visit site:</font></font></p> <a href="http://www.yourgoldchance.net/invest.html"><font color="Blue">http://www.yourgoldchance.net/invest.html</font></a> <p align="left"><font size="+1"><font color="Red">All additional information you can get here:</font></font></p> <a href="http://www.yourgoldchance.net/"><font color="Blue">http://www.yourgoldchance.net/</font></a> <p align="left"><font size="+1"><font color="Red">If you would like to contact us, please send us an email:</font></font></p> <A href="mailto:you...@yo..."><font color="Blue">you...@yo...</font></A> <p align="justify"><b>Our company will continue its best efforts to make good on every payments on our program without any delay.</b></p> <p><b>Thanks for choosing Your Gold Chance!<br> Karen Andreozzi,<br> President<br> Yor Gold Chance, Inc.</b></p> </body> </html> |
From: Don B. <bla...@ll...> - 2002-10-16 20:32:53
|
Hello, I sent the following email to Paul Dubois. Since he is not familiar with MS WINDOWS, he suggested that I send my problem to this list. In short, I am unable to get the pyfdemo to work in pyfort_8_.2 using python2.2 because my FORTRAN compiler, COMPAQ/DEC Visual FORTRAN uses NMAKE.EXE rather than make. When I try to run the demo, I get an error message saying that make is not recognized. What file or file(s) should I change. I cannot run under LINUX, it must be WINDOWS2000. Thanks for your assistance, Don >From: pa...@pf... >Date: Wed, 16 Oct 2002 13:26:27 -0700 >Subject: RE: Problem with pyfort >To: "Don Blackfield" <bla...@ll...> > >There is a subdirectory of the source that is devoted to how to do things >on Microsoft. I don't have any experience of it myself. You can try the >num...@li... list if you want to contact other users. > > >-- Original Message -- > >Date: Wed, 16 Oct 2002 12:10:54 -0700 > >To: "Paul F Dubois" <pa...@pf...> > >From: Don Blackfield <bla...@ll...> > >Subject: Problem with pyfort > > > > > > Paul, > > > > You may be cursing Microsoft by now, I know that I am. I have > >"successfully" installed pyfort. However, > >when I try to run the pyfdemo script by typing > > > >pyfort.bat -i pyfdemo > > > >it begins to work. However it crashes because WINDOWS does not recognize > > > >make. The COMPAQ/DEC/Visual > >Fortran uses a similar routine called NMAKE.EXE . Is there some place in > > > >some file(s) where I need to change > >make to NMAKE.EXE ?? > > > > Sorry for the hassle..... > > > >Don > > ============================================== Donald T. Blackfield Fusion Energy Program New Technologies Engineering Division Lawrence Livermore National Laboratory P.O. Box 808, MailStop L-641 Livermore, CA 94550 (925)422-0496 / (925)422-7390 (fax) dt...@ll... ============================================== |
From: Leonardo S. <re...@te...> - 2002-10-15 19:23:06
|
On Tue, 15 Oct 2002 12:22:27 -0700 num...@li... wrote: > Numpy-discussion -- confirmation of subscription -- request 961098 > > We have received a request from 200.176.39.98 for subscription of your > email address, <re...@te...>, to the > num...@li... mailing list. To confirm the > request, please send a message to > num...@li..., and either: > > - maintain the subject line as is (the reply's additional "Re:" is > ok), > > - or include the following line - and only the following line - in the > message body: > > confirm 961098 > > (Simply sending a 'reply' to this message should work from most email > interfaces, since that usually leaves the subject line in the right > form.) > > If you do not wish to subscribe to this list, please simply disregard > this message. Send questions to > num...@li.... > > Esta mensagem foi verificada pelo E-mail Protegido Terra. > Scan engine: VirusScan / Atualizado em 09/10/2002 / Versão: 1.3.13 > Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/ > |
From: Paul F D. <pa...@pf...> - 2002-10-13 04:32:31
|
What took me a long while to appreciate is that inheriting from Numeric wasn't going to do me any good precisely because any operation such as a+b was going to produce an array not one of my new foos, unless I overrode it. So in fact you end up having to override darn near everything. I can only suggest MA as an example. People have succeeded in similar tasks by starting with the MA source and changing it to suit. > -----Original Message----- > From: num...@li... > [mailto:num...@li...] On Behalf Of Rob > Sent: Saturday, October 12, 2002 3:13 PM > To: num...@li... > Subject: [Numpy-discussion] Dyadic Python > > > As a help for me learning Dyadic vector analysis, I have been > working on a Numpy class for manipulating Dyads. I am > wondering if anyone else has any similar interests. Most of > the impetus for the work comes from "Methods for > Electromagnetic Field Analysis" by Ismo Lindell. In numerous > searches I found no computer code dealing with Dyads. > > My biggest stumbling block so far is integrating the > symbolism of Dyadic analysis into something understandable. > Operator overloading isn't > going to help me. For example in my program: > > A=dyad(a,b) where a and b are complex vectors > B=dyad(c,d) " > A.dmmd(B) is equivalent to double dyadic multiplication of the dyads A > and B. :) In a book this would be written something like A xx B > except that the x's would be aligned vertically. > > Ok, its an insane project. Rob. > > > -- > ----------------------------- > The Numeric Python EM Project > www.pythonemproject.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Numpy-discussion mailing list Num...@li... https://lists.sourceforge.net/lists/listinfo/numpy-discussion |
From: Rob <ro...@py...> - 2002-10-12 22:15:19
|
As a help for me learning Dyadic vector analysis, I have been working on a Numpy class for manipulating Dyads. I am wondering if anyone else has any similar interests. Most of the impetus for the work comes from "Methods for Electromagnetic Field Analysis" by Ismo Lindell. In numerous searches I found no computer code dealing with Dyads. My biggest stumbling block so far is integrating the symbolism of Dyadic analysis into something understandable. Operator overloading isn't going to help me. For example in my program: A=dyad(a,b) where a and b are complex vectors B=dyad(c,d) " A.dmmd(B) is equivalent to double dyadic multiplication of the dyads A and B. :) In a book this would be written something like A xx B except that the x's would be aligned vertically. Ok, its an insane project. Rob. -- ----------------------------- The Numeric Python EM Project www.pythonemproject.com |
From: Karthikesh R. <ka...@ja...> - 2002-10-11 17:05:55
|
Hi All, i am writing a class called communicate. Something like this: class Communicate: """ This is the main communicate class : there will be more """ def __init__(self): """This should hopefully read a file and set self's parameters """ self.C = 10 self.K = 6 self.N = 8 self.Na = 3 self.L = 4 self.modulation = "QPSK" 1. Shown is just one method in the class. Now there are lot of self variables (i understand they are something like private variables). Now i want to have an .ini file, so that i call something like this in the __init__ module : def __init__(self, fileName): file = open(fileName, 'r') self = something(file) and all the self's variables are set. i want the ini file to be the interface between the class and the outside world. Some one suggested ConfigParser , couldnt get an idea of what it is and how to use it.. 2. Is this method of having all the data in self variables good.The size of some of these 'self' could be very high 40000x40000 complex. Should i create local variables in the methods (i need a lot of variables, but their def life is too small .....) for example one of the method could be: def generateNoise(self): """ Generates AWGN """ power = Numeric.sqrt(RandomArray.random()*10) Noise = Numeric.zeros(....) Noise.real = Random ...... Noise.imag = RandomArray.... (Boared to type the whole thing that is why there are ......'s ) Any way power is a local variable, which i guess dies after generateNoise() method is called in the object. Am i right.. Can i have variables like 'power' 3. Thirdly, i want an easy method like '.mat' that exists in matlab. Can i use pickle (cPickle or Numeric.pickle) to store all the variables that i want. These matrices could be 40000x40000 entries long. Assuming that all the variables are in 'self' should i write an assignment module before pickling them (in case pickle is the right way to store these variables) def writeToFile(self): Na = self.Na x = self.x pickle the variables Na, x Thankx in advance and in anticipation, karthik PS: slowly moving from Matlab to Python, hence these stupid doubts ----------------------------------------------------------------------- Karthikesh Raju, email: ka...@ja... Researcher, http://www.cis.hut.fi/karthik Helsinki University of Technology, Tel: +358-9-451 5389 Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 Department of Computer Sc., P.O Box 5400, FIN 02015 HUT, Espoo, FINLAND ----------------------------------------------------------------------- |
From: Todd M. <jm...@st...> - 2002-10-10 19:44:18
|
Philip Austin wrote: >David Abrahams writes: > > > > Not sure what you're saying here. I /do/ remember when I was writing > > the Numeric/NumArray support that there seemed no publicly-accessible > > definition of the structure of the underlying array objects. > Numeric and numarray both have "arrayobject.h" which makes PyArrayObject public. Numarray also has "libnumarray.h" which indirectly exposes NDInfo. > >As I understand it, the numarray now in CVS deprecates the NDInfo >struct (see section 10.1 of numarray.pdf) in favor of PyArrayObject. > This is true, but is currently neither released nor documented. On the plus side, numarray is becoming more compatible with Numeric, getting faster, and simpler as well. Todd -- Todd Miller jm...@st... STSCI / SSB |
From: Philip A. <pa...@eo...> - 2002-10-10 18:13:44
|
David Abrahams writes: > > Not sure what you're saying here. I /do/ remember when I was writing > the Numeric/NumArray support that there seemed no publicly-accessible > definition of the structure of the underlying array objects. As I understand it, the numarray now in CVS deprecates the NDInfo struct (see section 10.1 of numarray.pdf) in favor of PyArrayObject. [snip] > See the note about pitfalls at > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/tutorial/doc/derived_object_types.html > for the reasons why. Thanks for the info -- Phil |
From: David A. <da...@bo...> - 2002-10-10 17:28:58
|
Philip Austin <pa...@eo...> writes: > > What I thought I would see, was some form of direct coupling > > between a module in boost and either the Numeric or numarray C-API. > > However, when I search the whole source tree (*.cpp *.hpp) I can > > find neither PyArrayObject, arrayobject.h, NDInfo, nor > > libnumarray.h. So I'm not sure what part of any Numeric/numarray > > C-API you're using now (if any) > > The answer is -- no part of the C-API if he can get away with it. > Your move towards Numeric compatibility for numarray means that he > now can get away with it. I've been getting away with it already. It's easy enough to access all that functionality through the usual Python/C API. > numeric wraps the module pointer, and calls functions > through it -- e.g. (from boost/libs/python/src/numeric.cpp): > > void array_base::resize(object const& shape) > { > attr("resize")(shape); > } > > which invokes PyObject_CallObject to call the array's resize method, > with the tuple shape (similar to CXX). If the method isn't part of the > library (say for Numeric and getflat) then a python exception is > thrown. Slow but effective. If you want to touch the raw PyObject*, of course, you can do this: void f(numeric::array x) { PyObject* danger = x.ptr(); // Cast to whatever you like. } > > and in particular, what isn't > > working for you. Note: numarray and Numeric are not totally > > compatible at either the C or Python levels, so either area could > > have been a source of difficulty. > > The problem was that, as long as a call to getNDInfo was required > to access an array's data pointer, a Python-only approach > like the above wouldn't work. Since it is now possible to > do this via a cast to PyArrayObject* for a numarray, the problem > has disappeared. Not sure what you're saying here. I /do/ remember when I was writing the Numeric/NumArray support that there seemed no publicly-accessible definition of the structure of the underlying array objects. > (there's nothing stopping you from using the C-API if you want, > though. For example you can create a numarray with data > copied from a C array with something like: > > numeric::array makeNum(int * data, int n=0){ > object obj(detail::new_reference(PyArray_FromDims(1, &n, PyArray_INT))); > char *arr_data = ((PyArrayObject*) obj.ptr())->data; > memcpy(arr_data, data, 4 * n); > return numeric::array(obj); > } Well, this uses undocumented implementation details. The supported approach is: handle<> raw_array(PyArray_FromDims(1, &n, PyArray_INT)); object obj(raw_array); Note, though, that you can also write: handle<PyArrayObject> raw_array(PyArray_FromDims(1, &n, PyArray_INT)); Assuming, of course, that PyArray_FromDims returns a PyArrayObject*. And now you have access to the PyArrayObject* through raw_array. Also note that it's probably smarter to use extract<numeric::array>(obj) Than numeric::array(obj) See the note about pitfalls at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/tutorial/doc/derived_object_types.html for the reasons why. -- David Abrahams * Boost Consulting da...@bo... * http://www.boost-consulting.com |
From: Philip A. <pa...@eo...> - 2002-10-10 16:46:29
|
> Philip Austin wrote: [snip] > > > >boost/libs/python/test/numpy.cpp > >boost/libs/python/test/numpy.py > >boost/python/numeric.hpp > > Todd Miller writes: > I took a look at the files above trying to see what you're doing. (note that all of this was written by Dave Abrahams, I'm just one of the first Numeric users.) > What I thought I would see, was some form of direct coupling > between a module in boost and either the Numeric or numarray C-API. > However, when I search the whole source tree (*.cpp *.hpp) I can > find neither PyArrayObject, arrayobject.h, NDInfo, nor > libnumarray.h. So I'm not sure what part of any Numeric/numarray > C-API you're using now (if any) The answer is -- no part of the C-API if he can get away with it. Your move towards Numeric compatibility for numarray means that he now can get away with it. Specifically, the extension tries to import the numarray module, and if that fails, imports Numeric (the user can change this with numeric::set_module_and_type("Numeric", "ArrayType"); or: numeric::set_module_and_type("numarray", "NDArray"); ) numeric wraps the module pointer, and calls functions through it -- e.g. (from boost/libs/python/src/numeric.cpp): void array_base::resize(object const& shape) { attr("resize")(shape); } which invokes PyObject_CallObject to call the array's resize method, with the tuple shape (similar to CXX). If the method isn't part of the library (say for Numeric and getflat) then a python exception is thrown. > and in particular, what isn't > working for you. Note: numarray and Numeric are not totally > compatible at either the C or Python levels, so either area could > have been a source of difficulty. The problem was that, as long as a call to getNDInfo was required to access an array's data pointer, a Python-only approach like the above wouldn't work. Since it is now possible to do this via a cast to PyArrayObject* for a numarray, the problem has disappeared. (there's nothing stopping you from using the C-API if you want, though. For example you can create a numarray with data copied from a C array with something like: numeric::array makeNum(int * data, int n=0){ object obj(detail::new_reference(PyArray_FromDims(1, &n, PyArray_INT))); char *arr_data = ((PyArrayObject*) obj.ptr())->data; memcpy(arr_data, data, 4 * n); return numeric::array(obj); } ) Regards, Phil |
From: Todd M. <jm...@st...> - 2002-10-10 13:25:50
|
Philip Austin wrote: >Todd Miller writes: > > Can you send me the Numeric wrapper code or let me know where to > > get it? > >It's now on the cvs main trunk: > >cvs -d:pserver:ano...@cv...:/cvsroot/boost login >cvs -z3 -d:pserver:ano...@cv...:/cvsroot/boost checkout boost > >You'll need all of boost if you want to try to compile/run the test >code. If you haven't worked with boost and boost.build (bjam) >before, I could send my install notes. If you'd just like to >browse the code, the pertinent files are: > >boost/libs/python/test/numpy.cpp >boost/libs/python/test/numpy.py >boost/python/numeric.hpp > >and the new tutorial (which doesn't cover numpy yet) is >quite good: > >boost/boost/libs/python/doc/tutorial > >as well as: > >boost/libs/python/doc/v2/reference.html >(also without numpy documentation) > >Regards, Phil > I took a look at the files above trying to see what you're doing. What I thought I would see, was some form of direct coupling between a module in boost and either the Numeric or numarray C-API. However, when I search the whole source tree (*.cpp *.hpp) I can find neither PyArrayObject, arrayobject.h, NDInfo, nor libnumarray.h. So I'm not sure what part of any Numeric/numarray C-API you're using now (if any) and in particular, what isn't working for you. Note: numarray and Numeric are not totally compatible at either the C or Python levels, so either area could have been a source of difficulty. Todd -- Todd Miller jm...@st... STSCI / SSB |
From: Philip A. <pa...@eo...> - 2002-10-10 01:48:50
|
Todd Miller writes: > Can you send me the Numeric wrapper code or let me know where to > get it? It's now on the cvs main trunk: cvs -d:pserver:ano...@cv...:/cvsroot/boost login cvs -z3 -d:pserver:ano...@cv...:/cvsroot/boost checkout boost You'll need all of boost if you want to try to compile/run the test code. If you haven't worked with boost and boost.build (bjam) before, I could send my install notes. If you'd just like to browse the code, the pertinent files are: boost/libs/python/test/numpy.cpp boost/libs/python/test/numpy.py boost/python/numeric.hpp and the new tutorial (which doesn't cover numpy yet) is quite good: boost/boost/libs/python/doc/tutorial as well as: boost/libs/python/doc/v2/reference.html (also without numpy documentation) Regards, Phil |
From: Todd M. <jm...@st...> - 2002-10-09 18:47:31
|
Philip Austin wrote: > >Todd, thanks for the quick response. Regarding your header comments: > >/* >Extensions constructed from seperate compilation units can access the >C-API defined here by defining "libnumarray_UNIQUE_SYMBOL" to a global >name unique to the extension. Doing this circumvents the requirement >to import libnumarray into each compilation unit, but is nevertheless >mildly discouraged as "outside the Python norm" and potentially >leading to problems. Looking around at "existing Python art", most >extension modules are monolithic C files, and likely for good reason. >*/ > > >I'd agree with this sentiment, but with numarray's NDInfo interface I >think we were stuck (we have an implementation file for a bunch of >boost numarray helper functions that require the API but have static >data initializations, so they can't go into a header). > Long term, you would be better off ditching NDInfo and working with the Numeric compatability API. Since it's a subset of the Numeric API, it may not support your purposes. However, if it doesn't, I want to extend it until it does. > >With Numeric, we could avoid import_array altogether, and get >everything we needed from PyObject_CallObject calls to Numeric to >create arrays using zeros or ones, followed by a cast to >PyArrayObject* to get the data pointer and fill the array. With >numarray, we need (or needed) getNDInfo to do the same thing, >mandating an import_libnumarray. Are the plans for the revised >interface to behave in the same way as NDInfo? > The current plan is to deprecate the "native" APIs which make use of NDInfo and to make numarray as compatible as possible with Numeric. The bulk of the changes which make this reasonable are in numarray CVS now. In a nutshell, prior to our use of C basetypes, we needed something like NDInfo. Now that we're using C basetypes, NDInfo appears less efficient, less compatible, and more complex than the "Numeric compatability" interface. Its possible for our "basetypes" to appear to be Numeric arrays, so that's what we did. If you guys find that you need missing parts of the Numeric C-API, I'll add them to numarray. So far, I've just added what I needed or knew someone else needed. > It's not a big deal to >us one way or another, but it would simplify Dave Abraham's boost >support for numeric/numarray if much of the functionality could be >done through python calls from the C side. > Can you send me the Numeric wrapper code or let me know where to get it? > >Thanks, Phil > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Numpy-discussion mailing list >Num...@li... >https://lists.sourceforge.net/lists/listinfo/numpy-discussion > Thanks, Todd -- Todd Miller jm...@st... STSCI / SSB |
From: Philip A. <pa...@eo...> - 2002-10-09 18:03:30
|
Todd Miller writes: > Philip Austin wrote: > > > > >Currently libnumarray.h doesn't implement this -- is there > >another way to compile a multiple file project which > >initializes the API just once? > > > Hopefully you got my earlier message about this. Since I CC'ed > numpy-discussion and never saw it there, I've included it below. But, > assuming you saw it, I think what you need is in CVS now. Todd, thanks for the quick response. Regarding your header comments: /* Extensions constructed from seperate compilation units can access the C-API defined here by defining "libnumarray_UNIQUE_SYMBOL" to a global name unique to the extension. Doing this circumvents the requirement to import libnumarray into each compilation unit, but is nevertheless mildly discouraged as "outside the Python norm" and potentially leading to problems. Looking around at "existing Python art", most extension modules are monolithic C files, and likely for good reason. */ I'd agree with this sentiment, but with numarray's NDInfo interface I think we were stuck (we have an implementation file for a bunch of boost numarray helper functions that require the API but have static data initializations, so they can't go into a header). With Numeric, we could avoid import_array altogether, and get everything we needed from PyObject_CallObject calls to Numeric to create arrays using zeros or ones, followed by a cast to PyArrayObject* to get the data pointer and fill the array. With numarray, we need (or needed) getNDInfo to do the same thing, mandating an import_libnumarray. Are the plans for the revised interface to behave in the same way as NDInfo? It's not a big deal to us one way or another, but it would simplify Dave Abraham's boost support for numeric/numarray if much of the functionality could be done through python calls from the C side. Thanks, Phil |
From: Todd M. <jm...@st...> - 2002-10-08 15:27:59
|
Philip Austin wrote: > >Currently libnumarray.h doesn't implement this -- is there >another way to compile a multiple file project which >initializes the API just once? > Hopefully you got my earlier message about this. Since I CC'ed numpy-discussion and never saw it there, I've included it below. But, assuming you saw it, I think what you need is in CVS now. Todd -- Todd Miller jm...@st... STSCI / SSB My earlier response: Someone else asked for this recently, and the solution is half-way implemented in CVS now. I'll finish it this morning so that it works the way you're used to, but the next "official" numarray release is still a ways off. So, if you still want to port now, here are the caveats: 1. Numarray CVS was working as of Friday on Windows, Linux, Solaris, and Tru64. 2. Use the "Numeric compatible" portion of the C-API. This API is a subset of the Numeric API which may cause you trouble. Let me know if it does. Don't use the "native" NDInfo based APIs because they're headed for deprecation. 3. The version you'll be working with has not yet been widely used and may have significant bugs I don't know about. It does pass all its unit tests on all our platforms. |
From: Todd M. <jm...@st...> - 2002-10-08 14:58:37
|
Philip Austin wrote: >We're currently porting several of our boost-wrapped Numeric classes >to numarray. The routines are spread across several cpp files, and >**libnumarray_API is needed in each file. In Numeric, we invoke >import_array() in the module file, to initialize **PyArray_API, and >def NO_IMPORT_ARRAY in the other files; this produces >extern void **PyArray_API in those files, and everyone's happy. > >Currently libnumarray.h doesn't implement this -- is there >another way to compile a multiple file project which >initializes the API just once? > >Thanks, Phil Austin > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Numpy-discussion mailing list >Num...@li... >https://lists.sourceforge.net/lists/listinfo/numpy-discussion > Someone else asked for this recently, and the solution is half-way implemented in CVS now. I'll finish it this morning so that it works the way you're used to, but the next "official" numarray release is still a ways off. So, if you still want to port now, here are the caveats: 1. Numarray CVS was working as of Friday on Windows, Linux, Solaris, and Tru64. 2. Use the "Numeric compatible" portion of the C-API. This API is a subset of the Numeric API which may cause you trouble. Let me know if it does. Don't use the "native" NDInfo based APIs because they're headed for deprecation. 3. The version you'll be working with has not yet been widely used and may have significant bugs I don't know about. It does pass all its unit tests on all our platforms. Todd -- Todd Miller jm...@st... STSCI / SSB |