Closed 09b1d729-77bf-490e-b469-c1103143400f closed 14 years ago
Cool!
You may also want to see this thread on sage-devel about where to put spkgs.
As to the redefining, that seems... problematic. There are other Sage Python packages that must encounter the same problems - you may want to ask on the list about how they deal with this. (I suppose numpy and matplotlib would be likely candidates for this.)
What platforms does Brian work on out of the box?
Replying to @kcrisman:
Cool!
You may also want to see this thread on sage-devel about where to put spkgs.
Thanks, I didn't know about Google Code!
As to the redefining, that seems... problematic. There are other Sage Python packages that must encounter the same problems - you may want to ask on the list about how they deal with this. (I suppose numpy and matplotlib would be likely candidates for this.)
Yes, I'll give it a try, but I'm not sure if I'll be able to find another solution. I'll let you know.
What platforms does Brian work on out of the box?
Well, in the website they say: All platforms running Python, so at least Windows, Linux and Mac. I can't say more than that, as I've tried it just on Linux.
Replying to @kcrisman:
As to the redefining, that seems... problematic.
And turning of the preparser via:
preparser(false)
would also be problematic?
Replying to @sagetrac-uri:
Replying to @kcrisman:
As to the redefining, that seems... problematic.
And turning of the preparser via:
preparser(false)
would also be problematic?
Well, the issues is that a lot of Sage would no longer work as advertised. That is fine if one is only using Brian, but presumably the point of having Brian as an optional package is that one could go back and forth with other parts of Sage. I don't know exactly what other such packages do, though. I highly suggest just emailing sage-devel (perhaps in reply to your original message) and asking what ways around this there are; I assume they exist. Good luck!
Finally, Brian developers helped me to find a way to solve the problem without needing to redefine any Sage class nor to turn off the preparser. I've upload it on Google Code, you can download it here. However, I'll re-upload it here in Trac page to avoid confusions.
Reviewer: Karl-Dieter Crisman
This seems to build fine, the script is ok. In terms of experimental, positive review - it didn't crash anything, and commands actually do things and give output that is consistent with it.
To release manager - what happens now? It gets uploaded to the Sage mirrors as experimental package, maybe? Who does that?
But in the interests of improving it - I don't see why this couldn't be an optional package, if you can find another potential maintainer (different ticket). If so, you'd definitely want to have a SPKG-TEST file or whatever, since there are builtin tests. But...
When I do
sage: import brian
sage: brian.tests()
I get that I'm missing nose
. I doubt that nose
will be a Sage package anytime soon - or should it, if it makes tests that much easier? Perhaps upstream would consider having a non-nose
option for testing.
When I try the brian website examples, it tells me that the Sage matplotlib backend doesn't support show()
. That would be another thing to figure out.
The package has unchecked-in changes:
$ hg stat
? .hgignore
? SPKG.txt
? patches/units.py
? patches/units.py.patch
? spkg-install
Oriol, could you add these files to the repository and commit the changes with the ticket number in the commit string.
Also, could you please add yourself to the account name-real name map? Thanks!
Oh, I'm so sorry, Mitesh - here I was checking whether the spkg worked but forgot to actually rebuild the spkg from its constituents. If I ran sage-pkg on it would it have shown this?
Replying to @qed777:
The package has unchecked-in changes:
$ hg stat ? .hgignore ? SPKG.txt ? patches/units.py ? patches/units.py.patch ? spkg-install
Oriol, could you add these files to the repository and commit the changes with the ticket number in the commit string.
Ok, done. Please, let me know if it's allright, it's the first time I added files to the repository and I want to be sure I did everything correctly.
Also, could you please add yourself to the account name-real name map?
Done!
Thanks!
Thanks to you for your commments!!
Replying to @kcrisman:
But in the interests of improving it - I don't see why this couldn't be an optional package, if you can find another potential maintainer (different ticket). If so, you'd definitely want to have a SPKG-TEST file or whatever, since there are builtin tests. But...
When I do
sage: import brian sage: brian.tests()
I get that I'm missing
nose
. I doubt thatnose
will be a Sage package anytime soon - or should it, if it makes tests that much easier? Perhaps upstream would consider having a non-nose
option for testing.
I don't really know what to say about that... I don't know nose
and haven't looked at these tests much. I'll think about it, though. However, is it really necessary to include tests on the packages, in order to be set as optional instead of experimental?
When I try the brian website examples, it tells me that the Sage matplotlib backend doesn't support
show()
. That would be another thing to figure out.
Yes, I had already seen that. The problem is not in Brian but in the matplotlib package itself... there're other ways to see the images, for example replacing the show() command for:
sage: savefig('figure.png')
which creates the file figure.png in the working directory. Maybe that should be specified in the documentation. What do you think?
Replying to @sagetrac-uri:
Replying to @qed777:
Oriol, could you add these files to the repository and commit the changes with the ticket number in the commit string.
Ok, done. Please, let me know if it's allright, it's the first time I added files to the repository and I want to be sure I did everything correctly.
I apologize if I've missed it, but is there a link to the updated package?
Replying to @sagetrac-uri:
..but it's the same link I provided before (there's been no update, I just added the files to the repository).
ok, just to avoid confusions, what I mean by that is that the link is the same because I didn't change the name of the package (from brian-1.2.1.p0 to brian-1.2.1.p1) because there's been no update. So you'll download the right file with the old link.
Brian package (.spkg file)
Attachment: brian-1.2.1.p0.spkg.gz
# 9221 is related (making nose an optional/standard package).
Okay, I checked this all out again, and now the HG is fine, and I can't find any garbage files, and it still applies fine to Sage 4.5.3, and I think this is more than ready to be an experimental package.
If you want, you can find people to test it on a couple other platforms to make sure it's ready for optional package status - I'm not sure exactly what the protocol for that is, though it seems to me that it's more than ready compared to other denizens of http://www.sagemath.org/packages/optional/. But that could also be another ticket. At the very least it should get loaded up to the mirrors. Make it so!
Harald, Mike, or Minh, could one of you add attachment: brian-1.2.1.p0.spkg to the experimental / contributed package repository?
Replying to @kcrisman:
# 9221 is related (making nose an optional/standard package).
Small correction: #9921 is about this, though there is a discussion about nose at #9221.
Replying to @qed777:
Harald, Mike, or Minh, could one of you add attachment: brian-1.2.1.p0.spkg to the experimental / contributed package repository?
Done. See
Thanks, Minh!
Great, thank you all! I'll open a new ticket to see if it can be accepted as an optional package.
There's been some discussion on other tickets about the virtues of nose, so it might not be that unlikely to make it standard in Sage.
I've created a Sage package from an already existing Python package called Brian (see http://www.briansimulator.org/ for more information). The description that is provided in this webpage is the following:
Brian is a simulator for spiking neural networks available on almost all platforms. The motivation for this project is that a simulator should not only save the time of processors, but also the time of scientists. It is easy to learn and use, highly flexible and easily extensible. The Brian package itself and simulations using it are all written in the Python programming language.
I'm not sure whether this package should be proposed as experimental or optional. For the moment I've put it as an experimental package. However, I think it could be optional, because as a Python package it has been widely tested and works perfectly, so I don't think there'll be a lot of problems as a Sage package. Please, let me know your opinion on that.
I must say I detected some problems with Brian units related to the Sage classes 'RealNumber' and 'Integer', so I created a patch so that when Brian is imported these two classes are redefined as follows:
This solves the problems.
I attach the .spkg here (I know it's better just to provide a link, but I don't have anywhere else to upload it to).
Please, let me know what you think!
CC: @mwhansen @sagetrac-mvngu @haraldschilly
Component: packages: experimental
Keywords: brian brain simulator neuronal dynamics
Author: Oriol Castejon
Reviewer: Karl-Dieter Crisman
Issue created by migration from https://trac.sagemath.org/ticket/9675