emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: emacs-orgmode@gnu.org
Subject: using a table from one org-file as a variable in a code block in another org-file
Date: Mon, 26 Nov 2012 11:47:13 -0500	[thread overview]
Message-ID: <CAJ51ETrxAw+nVYOTK-Rb4BCWY+pOEa-bXr1=MmQQg1gAvmH7rg@mail.gmail.com> (raw)

Hi everyone,

I have been using tables as variables for codeblocks on an org-file, e.g.
#+tblname: class-data
| user      | oxide | xc |
| jkitchin  | TiO2  | LDA|
...

#+BEGIN_SRC python :var data=class-data
from pylab import *
import numpy as np

vol = [x[1]  if x[1] != '' else np.nan for x in data]
B = [x[2] if x[2] != '' else np.nan for x in data  ]

scatter(vol, B)
xlabel('Volume ($\AA^3$)')
ylabel('Bulk modulus (GPa)')
title('All polymorphs of all oxides for all functionals')
show()
#+END_SRC

This is a fantastic feature, since I can have some code that is
expensive to run create the table, but then have analysis code that is
quick, since it only reads the table.

But, sometimes the tables are defined in other org-files.  Is there a
way to specify a table from another org-file in the variable header?

Something like this would be pretty handy:

:var ./org-file.org::class-data

Especially if I could click on it, and have it open the other org-file
with point at the table!

Any thoughts? Thanks,

John

-----------------------------------
John Kitchin
Associate 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:[~2012-11-26 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 16:47 John Kitchin [this message]
2012-11-26 17:32 ` using a table from one org-file as a variable in a code block in another org-file Eric Schulte
2012-11-27  0:50   ` 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='CAJ51ETrxAw+nVYOTK-Rb4BCWY+pOEa-bXr1=MmQQg1gAvmH7rg@mail.gmail.com' \
    --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).