annotate base/datasets/functions.lisp @ 259:c4e9a7bb9897

change move-to-first-bar to return a constituent, not a list of events
author Jamie Forth <j.forth@gold.ac.uk>
date Sat, 19 Mar 2011 18:50:24 +0000
parents 6a3adca16910
children
rev   line source
j@251 1 (cl:in-package #:amuse-datasets)
j@251 2
j@251 3 (defun make-composition-identifiers-from-file (package pathname)
j@251 4 "This reads a file that contains one id per line, and returns a list
j@251 5 of composition-identifiers (specialised on package). It is useful for
j@251 6 reading files that have been exported from the database, for use with
j@251 7 the above functions."
j@251 8 (with-open-file (stream pathname :direction :input)
j@251 9 (loop for id = (read stream nil)
j@251 10 while id
j@251 11 collect (make-composition-identifier package id))))
j@251 12
j@251 13 (defun assign-compositions-to-dataset (composition-identifiers
j@251 14 dataset-identifier)
j@251 15 "This could be done more sensibly, at least for datasets stored in
j@251 16 the database."
j@251 17 (loop for identifier in composition-identifiers
j@251 18 do (assign-composition-to-dataset identifier
j@251 19 dataset-identifier)))