From: Stef M. <s.m...@ru...> - 2009-01-08 20:30:55
|
hello, A number of VP3-scripts uses, like this r = pos-pos[:,NewAxis] # all pairs of atom-to-atom vectors NewAxis isn't defined in VP5, and I can't find any information about NewAxis. Anyone has a clue ? thanks, Stef |
From: Bruce S. <Bru...@nc...> - 2009-01-08 20:43:09
|
See the example programs stars.py or gas.py in the Visual 5 version, which have been rewritten to work either with Numeric (Visual 3) or numpy (Visual 5). I don't know why numpy made some seemingly trivial changes such as NewAxis -> newaxis. Annoying. But it was essential to invoke numpy rather than Numeric in Visual 5 because Numeric is no longer supported. In the Visual 5 documentation (accessible from the IDLE help menu), choose "Numpy module (arrays)" for documentation on numpy. Bruce Sherwood Stef Mientki wrote: > hello, > > A number of VP3-scripts uses, like this > > r = pos-pos[:,NewAxis] # all pairs of atom-to-atom vectors > > > NewAxis isn't defined in VP5, > and I can't find any information about NewAxis. > > Anyone has a clue ? > > thanks, > Stef > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Stef M. <s.m...@ru...> - 2009-01-08 22:32:13
|
thanks Bruce, Bruce Sherwood wrote: > See the example programs stars.py or gas.py in the Visual 5 version, > which have been rewritten to work either with Numeric (Visual 3) or > numpy (Visual 5). I don't know why numpy made some seemingly trivial > changes such as NewAxis -> newaxis. Annoying. I didn't notice the demo stars (as I've under the name Nebula_20), beautiful ! If it was only the newaxis, it can also be set with try: NewAxis except: NewAxis = newaxis (Because I use a pre-script, it's easier for me to put it there once) But there is also a subtle change with "tolist", I see :-( Two minor remarks about the stars demo: print """ Right button drag to rotate view. Left button drag up or down to move in or out. """ shouldn't "left button" be "middle button" ? and you misses at the end where " t += dt" Nsteps += 1 cheers, Stef |
From: Bruce S. <Bru...@nc...> - 2009-01-09 02:43:46
|
Thanks for the corrections, which I've checked into CVS. Bruce Sherwood Stef Mientki wrote: > thanks Bruce, > > Bruce Sherwood wrote: >> See the example programs stars.py or gas.py in the Visual 5 version, >> which have been rewritten to work either with Numeric (Visual 3) or >> numpy (Visual 5). I don't know why numpy made some seemingly trivial >> changes such as NewAxis -> newaxis. Annoying. > I didn't notice the demo stars (as I've under the name Nebula_20), > beautiful ! > If it was only the newaxis, it can also be set with > try: > NewAxis > except: > NewAxis = newaxis > (Because I use a pre-script, it's easier for me to put it there once) > But there is also a subtle change with "tolist", I see :-( > > Two minor remarks about the stars demo: > > print """ > Right button drag to rotate view. > Left button drag up or down to move in or out. > """ > shouldn't "left button" be "middle button" ? > > and you misses at the end where " t += dt" > Nsteps += 1 > > cheers, > Stef > > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Guy K. K. <g....@ma...> - 2009-01-10 20:10:03
|
On Fri, 09 Jan 2009 09:42:51 Bruce Sherwood wrote: > I don't know why numpy made some seemingly trivial > changes such as NewAxis -> newaxis. Annoying. I'd guess they did it as it's more PEP-8 compatible. NewAxis looks like a class, whereas newaxis is an attribute, variable, or some other identifier. numpy.newaxis is comparable to visual.color.magenta in a way. I'm glad that it's renamed, as it is not possible to create a NewAxis instance, and therefore is much less confusing to the Python programmer. Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Room 2.63, Quad Block A Building Massey University, Auckland, Albany Private Bag 102 904, North Shore Mail Centre voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 eMail: G....@ma... http://iims.massey.ac.nz |
From: Bruce S. <Bru...@nc...> - 2009-01-10 22:30:15
|
Interesting points. Thanks for the insight. Bruce Sherwood Guy K. Kloss wrote: > On Fri, 09 Jan 2009 09:42:51 Bruce Sherwood wrote: >> I don't know why numpy made some seemingly trivial >> changes such as NewAxis -> newaxis. Annoying. > > I'd guess they did it as it's more PEP-8 compatible. NewAxis looks like a > class, whereas newaxis is an attribute, variable, or some other identifier. > numpy.newaxis is comparable to visual.color.magenta in a way. > > I'm glad that it's renamed, as it is not possible to create a NewAxis > instance, and therefore is much less confusing to the Python programmer. > > Guy > |