From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [babel] Problems assigning tables as variables using #+CALL and using properties in code blocks and sbe calls Date: Fri, 19 Jul 2013 02:34:20 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b62432cdb1f2e04e1d27c10 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzyeN-0003Jv-Cb for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 20:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzyeM-00085n-Ce for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 20:34:23 -0400 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:40270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzyeM-00085h-6i for emacs-orgmode@gnu.org; Thu, 18 Jul 2013 20:34:22 -0400 Received: by mail-ee0-f50.google.com with SMTP id d49so2012275eek.23 for ; Thu, 18 Jul 2013 17:34:21 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Mailing List --047d7b62432cdb1f2e04e1d27c10 Content-Type: text/plain; charset=ISO-8859-1 Hi, I have a tables like this: #+TBLNAME: tablename | a | b |c | d | | 1 | 2 |3 |4 | | z | x | y |w| #+TBLNAME: othertablename | a | b |c | d | | 1 | 2 |3 |4 | | z | x | y |w| I have the following code block #+name: test #+begin_src python :var table=tablename :exports results import numpy as np tab = np.array(table) return np.array([tab[:,1], tab[:,-1]]).T #+end_src If I call that function the result is correct However using #+CALL: aushang[:var table=othertablename]() :exports results or #+CALL: aushang(table=othertablename) :exports results does not work. It seem the babel block does not get the table but something else in case its called by #+CALL:. In general, how-to refer to a table in #+CALL blocks? On a similar line: I used $PROP_name to use property values within the sbe function. However, how to use the same property as input to a code-block? +begin_src python :var x=$PROP_name :exports results and +begin_src python :var x=name :exports results did not work Any ideas? Thanks Torsten --047d7b62432cdb1f2e04e1d27c10 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
I have a tables like this:
=
#+TBLNAME: tablename
| a | b |c | d |
| 1 | 2 |3=A0 |4= |
| z | x | y |w|

#+TBLNAME: othertablename
= | a | b |c | d |
| 1 | 2 |3=A0 |4 |
| z | x | y |w|

I have the follow= ing code block

#+name: test
#+begin_src python :var table=3Dtabl= ename :exports results
import numpy as np
tab =3D np.array(table)
= return np.array([tab[:,1], tab[:,-1]]).T
#+end_src

If I call that function the result is correct
However using

#+CALL: aushang[:var table=3Dotherta= blename]() :exports results
or
#+CALL: au= shang(table=3Dothertablename) :exports results

does not work. It seem the babel block does not get the tabl= e but something else in case its called by #+CALL:.
In gener= al, how-to refer to a table in #+CALL blocks?

On a simila= r line: I used $PROP_name to use property values within the sbe function.
However, how to use the same property as input to a code-block?<= br>
+begin_src python :var x=3D$PROP_name :exports results
and
+begin_src python :var x=3Dname :exports results

did not work

Any ideas?

Thanks

= Torsten

--047d7b62432cdb1f2e04e1d27c10--