xarray setup, progress.
[CommonLispStat.git] / src / data / dataframe-xarray.lisp
blobb2e7b775ed1a428ccb3c7ac55b9b825303e35412
1 ;;; -*- mode: lisp -*-
3 ;;; Time-stamp: <2009-07-13 16:03:15 tony>
4 ;;; Creation: <2009-06-22 17:09:47 tony>
5 ;;; File: dataframe-xarray.lisp
6 ;;; Author: AJ Rossini <blindglobe@gmail.com>
7 ;;; Copyright: (c)2009--, AJ Rossini. BSD, LLGPL, or GPLv2, depending
8 ;;; on how it arrives.
9 ;;; Purpose: Integration of xarray tools with dataframe-like
10 ;;; objects.
12 ;;; What is this talk of 'release'? Klingons do not make software
13 ;;; 'releases'. Our software 'escapes', leaving a bloody trail of
14 ;;; designers and quality assurance people in its wake.
16 ;;; Tamas Papp's xarray package is his 2nd generation generic array
17 ;;; indexing package, coming after the ideas and thoughts behind his
18 ;;; affi package, which while novel, is somewhat obsolete as a
19 ;;; selector framework, but great as an iteration framework.
21 (in-package :cls-dataframe)
23 (defmethod xref ((obj dataframe-like) &rest subscripts)
24 "For data-frame-like, dispatch on storage object."
25 (xref (dataset obj) subscripts))
27 (defmethod (setf xref) (value (obj dataframe-like) &rest subscripts)
28 (setf (xref (dataset obj) subscripts) value))
30 (defmethod xref ((obj matrix-like) &rest indices))
32 (defmethod xtype ((obj dataframe-like))
33 "Unlike the standard xtype, here we need to return a vector of the
34 types. Vectors can have single types, but arrays have single type.
35 Dataframe-like have multiple types, variable-like single type,
36 case-like has multiple types, and matrix-like has single type.")
38 (defmethod xdims ((obj dataframe-like))
39 (dataframe-dimensions obj))
41 ;; use default methods at this point, except for potentially weird DFs
42 (defmethod xdims* ())
44 (defmethod xdim ((obj dataframe-like) index)
45 (dataframe-dimension index))
49 (defmethod xrank ())
52 (defmethod slice ())
54 (defmethod take ())
56 (defmethod carray ())