On 06/01/16 16:23, Bill Page wrote:
On 6 January 2016 at 13:12, Vincent Delecroix <20100.delecr...@gmail.com> wrote:
Why making it a python package?!
Yes, that is a very good question. The original motivation came as a
result of a comment by William Stien on an SMC issue concerning Ocatve
in Sage worksheets on SMC. See emails below. I indicated that on SMC I
used a locally modified version of 'octave.py' to avoid some errors
that bugged me but that I was not sufficiently strongly motivated
(i.e. "too lazy") to go through the process of trying to get the
changes into Sage itself.
If it was a git branch it would be much easier to see the difference with the
actual sage/interfaces/octave.py and test it...
Yes that is true but that would only be interesting to developers.
Yes and know. If these changes gets integrated into Sage it will benefit
to *all* users and not only the one who installs your Python package.
I am fairly familiar with but certainly not fluent in the development
process in the Sage. Every time I look at it, it seems like a
significant uphill learning curve and (mostly) I really do not want to
be a Sage developer.
You just produced Sage code. That makes you a Sage developer. Being able
to produce git branch is another matter. If you find it too complicated
then we really have a problem with our development process.
I think I remember William saying that it is possible to modify the
source code of Sage directly in the cloud... though I am not familiar
with it.
For the time being, I should be able to get your changes integrated
(once your satisfied with them).
2. The following is very inefficient to get rid of the first line
out = "\n".join(out.splitlines()[1:])
I do not recall the original intention - maybe related to
https://docs.python.org/2/glossary.html#term-universal-newlines
I doubt that efficiency is an issue here, but do you have a suggestion?
i = out.find("\n")
return out[i:] if i != -1 else out
(maybe the if/else is not needed)
3. The following is not a syntax error but is considered as such
sage: octave.octave("\"syntax error\"")
File "<string>", line unknown
SyntaxError: sage2="syntax error";
(this is just a string containing syntax error)
Yes. I am not sure what is the best way to determine that Octave has
returned an error message rather than a result. Maybe looking for
>>>
would be more reliable?
No idea. I was just trying to break your code.
4. What is EOF at line 302?
I think this is a possible exception returned by 'expect'.
Then you should import it.
import pexpect # at the top of the file
...
except pexpect.EOF # instead of "except EOF"
...
(note that there is another line in your code that needs this import)
Regards,
Vincent
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.