From: Bruce S. <bas...@nc...> - 2010-10-10 04:11:19
|
In the "For developers" section of vpython.org is a zip file containing experimental code for doing either the convenient "from visual import *" or a clean "import vpython". Please try this out and post comments about whether this would meet your needs, or how it should be changed, or offer a different scheme entirely. Once we reach agreement, this will become a part of VPython 5.4 for Python 2.7 and Python 3.1. I was able to follow the suggestion to put almost everything in the new vpython folder, so that the visual folder mostly just imports from the vpython folder. I thought it might be possible, and clean, to put the two modules inside one folder, but that doesn't work. I'm very hazy on how the import search works. If you see a way to have one folder rather than two, please explain. As far as I can tell from my tests, there is complete backward compatibility with existing programs. Bruce Sherwood ----------------------------------------------------------------------------- Here are the installation instructions in the accompanying README file: 1) Before making any changes to your current site-packages, make a copy of site-packages/visual 2) Replace site-packages/visual with the visual folder in this package. 3) Add to site-packages the vpython folder in this package. 4) From your saved copy of site-packages/visual, copy into the new vpython folder cvisual.pyd (Windows) or cvisual.so (Mac) 5) On Windows, from your saved copy of site-packages/visual, copy the doc and examples folders into the new visual folder. After making these changes, you can still use "from visual import *" if that is convenient, but if you want to import the visual objects cleanly, import them from the new vpython module. Here are two simple examples: import vpython as vp vp.box(color=vp.color.orange, material=vp.materials.wood) from vpython import (box, color, materials) box(color=color.orange, material=materials.wood) There are new clean modules vpython.controls, vpython.filedialog, and vpython.graph that can be used instead of the old modules visual.controls, visual.filedialog, and visual.graph. The old modules execute "from visual import *" and are retained because some programs expect that behavior when importing one of these modules. |
From: Bruce S. <bas...@nc...> - 2010-10-10 19:51:58
|
A colleague correctly points out that "vpython" isn't an appropriate name for the other module, because of confusion with the cover term (VPython = Visual+Python). A better name might be for example visual_parts; note that whatever the name is, presumably it will get imported with a short name (much as the scipy world settled on import numpy as np). You're invited to suggest a better name. Bruce Sherwood On Sat, Oct 9, 2010 at 10:11 PM, Bruce Sherwood <bas...@nc...> wrote: > In the "For developers" section of vpython.org is a zip file > containing experimental code for doing either the convenient "from > visual import *" or a clean "import vpython". Please try this out and > post comments about whether this would meet your needs, or how it > should be changed, or offer a different scheme entirely. Once we reach > agreement, this will become a part of VPython 5.4 for Python 2.7 and > Python 3.1. > > I was able to follow the suggestion to put almost everything in the > new vpython folder, so that the visual folder mostly just imports from > the vpython folder. I thought it might be possible, and clean, to put > the two modules inside one folder, but that doesn't work. I'm very > hazy on how the import search works. If you see a way to have one > folder rather than two, please explain. > > As far as I can tell from my tests, there is complete backward > compatibility with existing programs. > > Bruce Sherwood > > ----------------------------------------------------------------------------- > > Here are the installation instructions in the accompanying README file: > > 1) Before making any changes to your current site-packages, make a copy of > > site-packages/visual > > 2) Replace site-packages/visual with the visual folder in this package. > > 3) Add to site-packages the vpython folder in this package. > > 4) From your saved copy of site-packages/visual, copy into the new > vpython folder > > cvisual.pyd (Windows) or > cvisual.so (Mac) > > 5) On Windows, from your saved copy of site-packages/visual, copy the doc and > examples folders into the new visual folder. > > After making these changes, you can still use "from visual import *" if that is > convenient, but if you want to import the visual objects cleanly, import them > from the new vpython module. Here are two simple examples: > > import vpython as vp > vp.box(color=vp.color.orange, material=vp.materials.wood) > > from vpython import (box, color, materials) > box(color=color.orange, material=materials.wood) > > There are new clean modules vpython.controls, vpython.filedialog, and > vpython.graph > that can be used instead of the old modules visual.controls, > visual.filedialog, and > visual.graph. The old modules execute "from visual import *" and are > retained because > some programs expect that behavior when importing one of these modules. > |
From: Anton S. <br...@po...> - 2010-10-11 17:43:52
|
On 2010-10-10 12:51, Bruce Sherwood wrote: > [...] You're invited to suggest a better name. I always said VP ought to be named Gilliam. -- Anton Sherwood *\\* www.ogre.nu |
From: C A. R. <an...@ex...> - 2010-10-10 22:20:01
|
On Sun, Oct 10, 2010 at 2:51 PM, Bruce Sherwood <bas...@nc...> wrote: > On Sat, Oct 9, 2010 at 10:11 PM, Bruce Sherwood <bas...@nc...> wrote: >> In the "For developers" section of vpython.org is a zip file >> containing experimental code for doing either the convenient "from >> visual import *" or a clean "import vpython". Please try this out and >> post comments about whether this would meet your needs, or how it >> should be changed, or offer a different scheme entirely. Once we reach >> agreement, this will become a part of VPython 5.4 for Python 2.7 and >> Python 3.1. Perfect, will take a look. >> I was able to follow the suggestion to put almost everything in the >> new vpython folder, so that the visual folder mostly just imports from >> the vpython folder. I thought it might be possible, and clean, to put >> the two modules inside one folder, but that doesn't work. I'm very >> hazy on how the import search works. If you see a way to have one >> folder rather than two, please explain. I personally think two folders/modules is desirable. The only way I think there should be one, is if the "visual" namespace can be used for the pythonic module, and something else (ie. visual.physics, etc.) used for the wildcard module ;-) >> As far as I can tell from my tests, there is complete backward >> compatibility with existing programs. >> >> Bruce Sherwood > > A colleague correctly points out that "vpython" isn't an appropriate > name for the other module, because of confusion with the cover term > (VPython = Visual+Python). I don't understand what you mean here, what's the issue exactly? > A better name might be for example > visual_parts; This particular name makes the proper module seem more like a second class citizen. IMO, the clean module _is_ vpython... the "visual" module is not. > note that whatever the name is, presumably it will get > imported with a short name (much as the scipy world settled on import > numpy as np). You're invited to suggest a better name. I might be alone here, but I rarely use a different name for imports, unless there will be conflict, but i like everything to be explicit... I don't like to have to look it up when i read the code later. But if vpython really cannot work, I still like either visualpy, visuallib, or maybe even pyvisual/visualpy. C Anthony |
From: C A. R. <an...@ex...> - 2010-10-10 22:21:34
|
On Sun, Oct 10, 2010 at 5:19 PM, C Anthony Risinger <an...@ex...> wrote: > > But if vpython really cannot work, I still like either visualpy, Oops, I meant vispy here :-) C Anthony |
From: Craig S. <cra...@ma...> - 2010-10-11 14:31:36
|
I don't like visual_parts at all. Too long and is unlike just about every other Python module out there. If vpython is off the table, I'd prefer the names in the order of 1) vispy, 2) visualpy, 3) vislib, 4) visuallib, 5) libvis, 6) libvisual. The other discussions over the weekend seemed to converge to a good solution: a clean implementation in the newly named space, and a visual module that imports from the clean implementation to avoid code duplication. It's unfortunate a visual.py solution can't be made to work, but visual/__init.py__ isn't too bad. Craig On Oct 10, 2010, at 2:51 PM, Bruce Sherwood wrote: > A colleague correctly points out that "vpython" isn't an appropriate > name for the other module, because of confusion with the cover term > (VPython = Visual+Python). A better name might be for example > visual_parts; note that whatever the name is, presumably it will get > imported with a short name (much as the scipy world settled on import > numpy as np). You're invited to suggest a better name. > > Bruce Sherwood > > On Sat, Oct 9, 2010 at 10:11 PM, Bruce Sherwood <bas...@nc...> wrote: >> In the "For developers" section of vpython.org is a zip file >> containing experimental code for doing either the convenient "from >> visual import *" or a clean "import vpython". Please try this out and >> post comments about whether this would meet your needs, or how it >> should be changed, or offer a different scheme entirely. Once we reach >> agreement, this will become a part of VPython 5.4 for Python 2.7 and >> Python 3.1. >> >> I was able to follow the suggestion to put almost everything in the >> new vpython folder, so that the visual folder mostly just imports from >> the vpython folder. I thought it might be possible, and clean, to put >> the two modules inside one folder, but that doesn't work. I'm very >> hazy on how the import search works. If you see a way to have one >> folder rather than two, please explain. >> >> As far as I can tell from my tests, there is complete backward >> compatibility with existing programs. >> >> Bruce Sherwood >> >> ----------------------------------------------------------------------------- >> >> Here are the installation instructions in the accompanying README file: >> >> 1) Before making any changes to your current site-packages, make a copy of >> >> site-packages/visual >> >> 2) Replace site-packages/visual with the visual folder in this package. >> >> 3) Add to site-packages the vpython folder in this package. >> >> 4) From your saved copy of site-packages/visual, copy into the new >> vpython folder >> >> cvisual.pyd (Windows) or >> cvisual.so (Mac) >> >> 5) On Windows, from your saved copy of site-packages/visual, copy the doc and >> examples folders into the new visual folder. >> >> After making these changes, you can still use "from visual import *" if that is >> convenient, but if you want to import the visual objects cleanly, import them >> from the new vpython module. Here are two simple examples: >> >> import vpython as vp >> vp.box(color=vp.color.orange, material=vp.materials.wood) >> >> from vpython import (box, color, materials) >> box(color=color.orange, material=materials.wood) >> >> There are new clean modules vpython.controls, vpython.filedialog, and >> vpython.graph >> that can be used instead of the old modules visual.controls, >> visual.filedialog, and >> visual.graph. The old modules execute "from visual import *" and are >> retained because >> some programs expect that behavior when importing one of these modules. >> > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users -- Craig A. Struble, Ph.D. | Marquette University Associate Professor of Computer Science | 369 Cudahy Hall (414)288-3783 | (414)288-5472 (fax) http://www.mscs.mu.edu/~cstruble | cra...@ma... |
From: Bruce S. <bas...@nc...> - 2010-10-11 19:19:29
|
Suppose the clean folder is named simply vis? There does not seem to exist a Python module named vis. It's short, which is nice for those who prefer to use the full name, as in vis.box(), and by its shortness it has the flavor of "visual but without the extras imported by visual". It's similar to your first choice but without the py, which seems a bit superfluous in the Python environment. And on the other hand, if someone starts a new project dealing with visualization they're more likely to call it vispy than vis, because of tradition (scipy, numpy, etc.). Whaddya think? I hope that some people other than me actually try out the machinery I posted and say whether in fact it satisfies their needs. Bruce Sherwood On Mon, Oct 11, 2010 at 8:31 AM, Craig Struble <cra...@ma...> wrote: > I don't like visual_parts at all. Too long and is unlike just about every other Python module out there. If vpython is off the table, I'd prefer the names in the order of 1) vispy, 2) visualpy, 3) vislib, 4) visuallib, 5) libvis, 6) libvisual. |
From: Craig S. <cra...@ma...> - 2010-10-11 19:25:19
|
I'm fine with that too, and it's even shorter, which I like more. :-) Craig On Oct 11, 2010, at 2:19 PM, Bruce Sherwood wrote: > Suppose the clean folder is named simply vis? There does not seem to > exist a Python module named vis. It's short, which is nice for those > who prefer to use the full name, as in vis.box(), and by its shortness > it has the flavor of "visual but without the extras imported by > visual". It's similar to your first choice but without the py, which > seems a bit superfluous in the Python environment. And on the other > hand, if someone starts a new project dealing with visualization > they're more likely to call it vispy than vis, because of tradition > (scipy, numpy, etc.). > > Whaddya think? > > I hope that some people other than me actually try out the machinery I > posted and say whether in fact it satisfies their needs. > > Bruce Sherwood > > On Mon, Oct 11, 2010 at 8:31 AM, Craig Struble > <cra...@ma...> wrote: >> I don't like visual_parts at all. Too long and is unlike just about every other Python module out there. If vpython is off the table, I'd prefer the names in the order of 1) vispy, 2) visualpy, 3) vislib, 4) visuallib, 5) libvis, 6) libvisual. > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users -- Craig A. Struble, Ph.D. | Marquette University Associate Professor of Computer Science | 369 Cudahy Hall (414)288-3783 | (414)288-5472 (fax) http://www.mscs.mu.edu/~cstruble | cra...@ma... |
From: Bruce S. <bas...@nc...> - 2010-10-13 02:49:44
|
Thanks to some public and private support for the "vis" as the name of the clean module, I've remade the clean+convenience version to be in two site-packages folders named visual (convenience, backward compatibility) and vis (clean, no extra imports). You can get these materials from the "For developers" section of vpython.org. They should work with either Python 2.x or Python 3.1. It is very important to read the README file before installing. In particular, you need to save a copy of the old visual folder before installing. I hope some people will try this out before I'm tempted to post VPython 5.4 with these new features. Bruce Sherwood |
From: Bruce S. <bas...@nc...> - 2010-10-13 02:44:55
|
Correction: This stuff does work with Python 3.1, but I haven't yet made available the binaries of the C++ component; you have to use the cvisual file that you already have. Bruce Sherwood On Tue, Oct 12, 2010 at 8:42 PM, Bruce Sherwood <bas...@nc...> wrote: > Thanks to some public and private support for the "vis" as the name of > the clean module, I've remade the clean+convenience version to be in > two site-packages folders named visual (convenience, backward > compatibility) and vis (clean, no extra imports). You can get these > materials from the "For developers" section of vpython.org. They > should work with either Python 2.x or Python 3.1. > > It is very important to read the README file before installing. In > particular, you need to save a copy of the old visual folder before > installing. > > I hope some people will try this out before I'm tempted to post > VPython 5.4 with these new features. > > Bruce Sherwood > |