j@251: (cl:in-package #:amuse-datasets) j@251: j@251: (defun make-composition-identifiers-from-file (package pathname) j@251: "This reads a file that contains one id per line, and returns a list j@251: of composition-identifiers (specialised on package). It is useful for j@251: reading files that have been exported from the database, for use with j@251: the above functions." j@251: (with-open-file (stream pathname :direction :input) j@251: (loop for id = (read stream nil) j@251: while id j@251: collect (make-composition-identifier package id)))) j@251: j@251: (defun assign-compositions-to-dataset (composition-identifiers j@251: dataset-identifier) j@251: "This could be done more sensibly, at least for datasets stored in j@251: the database." j@251: (loop for identifier in composition-identifiers j@251: do (assign-composition-to-dataset identifier j@251: dataset-identifier)))