From 7adeec0bbb68e7be6282b51e34751422e31fa777 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Tue, 21 Apr 2009 08:15:04 +0200 Subject: [PATCH] data import, using RSM strings. Signed-off-by: AJ Rossini --- lispstat.asd | 5 +++-- src/data/import.lisp | 28 +++++++++++----------------- src/packages.lisp | 13 +++++++++++++ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lispstat.asd b/lispstat.asd index a229eb4..b8b9d4f 100644 --- a/lispstat.asd +++ b/lispstat.asd @@ -1,5 +1,5 @@ ;; -*- mode: lisp -*- -;;; Time-stamp: <2009-04-15 08:50:46 tony> +;;; Time-stamp: <2009-04-21 08:11:06 tony> ;;; Created: <2005-05-30 17:09:47 blindglobe> ;;; File: lispstat.asd ;;; Author: AJ Rossini @@ -113,7 +113,8 @@ :depends-on (:cffi :cl-plplot ;; FIXME: conditionally load only, not always simple to install? :lisp-matrix - :lift) + :lift + :rsm-string) :components ((:static-file "version" :pathname #p"version.lisp-expr") (:static-file "LICENSE") (:static-file "README") diff --git a/src/data/import.lisp b/src/data/import.lisp index 2756931..a9b6d6b 100644 --- a/src/data/import.lisp +++ b/src/data/import.lisp @@ -3,7 +3,7 @@ ;;; See COPYRIGHT file for any additional restrictions (BSD license). ;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. -;;; Time-stamp: <2009-03-16 14:47:15 tony> +;;; Time-stamp: <2009-04-20 19:07:46 tony> ;;; Creation: <2008-09-03 08:10:00 tony> ;;; File: import.lisp ;;; Author: AJ Rossini @@ -15,23 +15,10 @@ ;;; 'releases'. Our software 'escapes', leaving a bloody trail of ;;; designers and quality assurance people in its wake. +(in-package :cls-dataimport) -(in-package :cl-user) -(defpackage :lisp-stat-data-import - (:documentation "Data I/O and similar import technologies.") - (:nicknames :ls-data-import) - (:use :common-lisp - :lisp-stat-object-system - :lisp-stat-data) - (:shadowing-import-from :lisp-stat-object-system - slot-value call-method call-next-method) - (:export data-import data-export)) -(in-package :lisp-stat-data-import) - -;;; The purpose of this package is to provide the basic structures for -;;; importing data, to be further processed by LispStat. @@ -44,6 +31,15 @@ ;; of the non-native, there could be raw sources (ascii file formats), ;; xml sources (xml -> lisp, possible with some preprocessing. +;;; Reading from DSV files: + +;;; consider either the cybertyggyr-dsv package, or the rsm.string +;;; package. The latter seems to actually work a bit at what we need +;;; to acccomplish, but the former is a challenge to get right when we +;;; need to think abut what it is that we need to get done. The +;;; latter is also better licensed. i.e. BSD-style. + + (defparameter *lisp-stat-data-external-source-formats* '(csv tsv xml ;; ex of text-based (UTF, ASCII, or similar) formats sql ;; ex of RDBMS call @@ -52,8 +48,6 @@ (defparameter *lisp-stat-data-import-referencing-type* '(lisp-data-structure reference lisp-function)) - - (defgeneric data-import (source source-format referencing-type) (:documentation "read data from stream srce, in format srce-frmt; return a reftype, which could be a diff --git a/src/packages.lisp b/src/packages.lisp index 8c67b4a..c5169ed 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -143,6 +143,19 @@ listoflist->array listoflist->matrix-like)) + +(defpackage :cls-dataimport + (:documentation "Data I/O and similar import technologies.") + (:use :common-lisp + :lisp-stat-object-system + :cls-dataframe + :cls-data-listoflist + :rsm.string) + (:shadowing-import-from :lisp-stat-object-system + call-method call-next-method) + (:export dsvstream->dataframe dsvstream->matrix dsvstream->listoflist)) + + (defpackage :lisp-stat-model (:documentation "Model management for data analysis.") (:use :common-lisp -- 2.11.4.GIT