emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Instructor account <jkitchin@andrew.cmu.edu>
To: emacs-orgmode@gnu.org
Subject: Re: odd/unexpected behavior with Python src blocks
Date: Mon, 29 Sep 2014 11:56:06 -0400	[thread overview]
Message-ID: <m261g62zft.fsf@johns-air.wv.cc.cmu.edu> (raw)
In-Reply-To: <87oatzkygu.fsf@gmail.com> (Aaron Ecay's message of "Sun, 28 Sep 2014 21:27:29 -0400")

Indeed, this passes by org-babel because stderr is not captured, and
scipy does what you suggest. I guess this happens inside compiled
c/Fortran code since there is nothing catching it in the odeint
python function doing that.

Thanks, I will try to bring it up on the scipy list. 

Aaron Ecay <aaronecay@gmail.com> writes:

> Hi John,
>
> 2014ko irailak 28an, John Kitchin-ek idatzi zuen:
>
> [...]
>
>> I am not sure why this happens, but it seems like incorrect behavior to
>> me.
>
> In the first case, python exits with a non-zero exit code, whereas in
> the second it exits with a zero code (i.e. successful exit), and prints
> the matrix-thing [[1.], [1.]] to stdout.  It looks like scipy traps the
> NameErrors and prints them to stderr, but continues its computation
> regardless.
>
> I’d say babel is performing as desired here, but scipy sadly isn’t
> reporting its errors in the standard way (by a nonzero exit, which I
> think would happen automatically if the NameErrors made it to the top
> level of the stack without being caught).

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2014-09-29 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-28 22:11 odd/unexpected behavior with Python src blocks John Kitchin
2014-09-29  1:27 ` Aaron Ecay
2014-09-29 15:56   ` Instructor account [this message]
2014-09-29 18:03     ` John Kitchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m261g62zft.fsf@johns-air.wv.cc.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).