Mercurial > hg > amuse
view base/datasets/functions.lisp @ 265:b75b45d76e45
add ioi-from-bar method to amuse-mtp
author | Jamie Forth <j.forth@gold.ac.uk> |
---|---|
date | Sun, 10 Apr 2011 16:59:24 +0100 |
parents | 6a3adca16910 |
children |
line wrap: on
line source
(cl:in-package #:amuse-datasets) (defun make-composition-identifiers-from-file (package pathname) "This reads a file that contains one id per line, and returns a list of composition-identifiers (specialised on package). It is useful for reading files that have been exported from the database, for use with the above functions." (with-open-file (stream pathname :direction :input) (loop for id = (read stream nil) while id collect (make-composition-identifier package id)))) (defun assign-compositions-to-dataset (composition-identifiers dataset-identifier) "This could be done more sensibly, at least for datasets stored in the database." (loop for identifier in composition-identifiers do (assign-composition-to-dataset identifier dataset-identifier)))