Lisp-Stat / lisp-stat

Lisp-Stat main system
https://lisp-stat.github.io/lisp-stat
Microsoft Public License
140 stars 11 forks source link

"Getting Started" plot:plot error #30

Open DustinMorado opened 6 months ago

DustinMorado commented 6 months ago

Hi I was trying to work through the getting started plotting example and ran into the following error:

My setup

What I did

I began with the following bits and like some other reported issues with cephes but it still finishes the loading

CL-USER> (ql:quickload :lisp-stat)
To load "lisp-stat":
  Load 1 ASDF system:
    lisp-stat
; Loading "lisp-stat"
.................Library 
#P"/Users/dmorado/.roswell/lisp/quicklisp/dists/quicklisp/software/cephes.cl-20231021-git/scipy-cephes/libmd-x86-64.dylib"
exists, skipping build......
(:LISP-STAT)
CL-USER> (in-package :ls-user)
#<PACKAGE "LS-USER">
LS-USER> (ql:quickload :plot/vega)
To load "plot/vega":
  Load 1 ASDF system:
    plot/vega
; Loading "plot/vega"

(:PLOT/VEGA)
LS-USER> (data :vgcars)
T

I can also run the other parts of the tutorial getting the means and tabular pretty-print output of the vgcars dataset.

What goes wrong

However when I try to run the plot:plot command I get the following error

Code

LS-USER> (plot:plot
  (vega:defplot hp-mpg
    `(:title "Horsepower vs. MPG"
      :description "Horsepower vs miles per gallon for various cars"
      :data (:values ,vgcars)
      :mark :point
      :encoding (:x (:field :horsepower :type :quantitative)
                 :y (:field :miles-per-gallon :type :quantitative)))))

Debugger

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION DATA-FRAME::COLUMN-LENGTH (1)>
when called with arguments
  (#<DATA-FRAME (406 observations of 9 variables)>).
   [Condition of type SB-PCL::NO-APPLICABLE-METHOD-ERROR]

Restarts:
 0: [RETRY] Retry calling the generic function.
 1: [RETRY] Retry SLY mREPL evaluation request.
 2: [*ABORT] Return to SLY's top level.
 3: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1001490003}>)

Backtrace:
 0: ((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION DATA-FRAME::COLUMN-LENGTH (1)> #<DATA-FRAME (406 observations of 9 variables)>) [fast-method]
 1: (SB-PCL::CALL-NO-APPLICABLE-METHOD #<STANDARD-GENERIC-FUNCTION DATA-FRAME::COLUMN-LENGTH (1)> (#<DATA-FRAME (406 observations of 9 variables)>))
 2: ((:METHOD INITIALIZE-INSTANCE :AFTER (DATA-FRAME)) #<error printing DATA-FRAME {10016B8493}>) [fast-method]
 3: ((LAMBDA (SB-PCL::|.P0.| SB-PCL::|.P1.|) :IN "/Users/dmorado/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-stat-20231021-git/data/vgcars.lisp") #<unavailable argument> #<unavailable argument>)
 4: ((:METHOD VEGA:WRITE-SPEC (VEGA::VEGA-PLOT)) #<PLOT HP-MPG: Scatter plot ..) [fast-method]
 5: ((:METHOD VEGA:WRITE-HTML (VEGA::VEGA-PLOT)) #<PLOT HP-MPG: Scatter plot ..) [fast-method]
 6: (PLOT:PLOT #<PLOT HP-MPG: Scatter plot ..)
 7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (PLOT:PLOT (VEGA:DEFPLOT HP-MPG (SB-INT:QUASIQUOTE #))) #<NULL-LEXENV>)
 8: (EVAL (PLOT:PLOT (VEGA:DEFPLOT HP-MPG (SB-INT:QUASIQUOTE #))))
 9: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
10: (SLYNK::CALL-WITH-RETRY-RESTART "Retry SLY mREPL evaluation request." #<FUNCTION (LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1) {10061B174B}>)
11: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
12: ((LAMBDA NIL :IN SLYNK::CALL-WITH-LISTENER))
13: (SLYNK::CALL-WITH-BINDINGS ((*PACKAGE* . #1=#<PACKAGE "LS-USER">) (*DEFAULT-PATHNAME-DEFAULTS* . #P"/Users/dmorado/") (* . T) (** :PLOT/VEGA) (*** . #1#) (/ T) ...) #<FUNCTION (LAMBDA NIL :IN SLYNK::C..
14: (SLYNK-MREPL::MREPL-EVAL-1 #<SLYNK-MREPL::MREPL mrepl-1-1> "(plot:plot ..)
15: (SLYNK-MREPL::MREPL-EVAL #<SLYNK-MREPL::MREPL mrepl-1-1> "(plot:plot ..)
16: (SLYNK:PROCESS-REQUESTS NIL)
17: ((LAMBDA NIL :IN SLYNK::SPAWN-CHANNEL-THREAD))
18: ((LAMBDA NIL :IN SLYNK::SPAWN-CHANNEL-THREAD))
19: (SLYNK-SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SLYNK:SLYNK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SLYNK::SPAWN-CHANNEL-THREAD) {1001C4FDFB}>)
20: ((FLET SLYNK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/Users/dmorado/.roswell/lisp/sly/git/slynk/backend/sbcl.lisp") #<FUNCTION SLYNK:SLYNK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL :IN SLYNK::SPAWN-CHANNEL-T..
21: ((LAMBDA NIL :IN SLYNK::CALL-WITH-LISTENER))
22: (SLYNK::CALL-WITH-BINDINGS ((*PACKAGE* . #1=#<PACKAGE "LS-USER">) (*DEFAULT-PATHNAME-DEFAULTS* . #P"/Users/dmorado/") (* . T) (** :PLOT/VEGA) (*** . #1#) (/ T) ...) #<FUNCTION (LAMBDA NIL :IN SLYNK::C..
23: ((LAMBDA NIL :IN SLYNK::SPAWN-CHANNEL-THREAD))
24: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
25: ((FLET "WITHOUT-INTERRUPTS-BODY-173" :IN SB-THREAD::RUN))
26: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
27: ((FLET "WITHOUT-INTERRUPTS-BODY-166" :IN SB-THREAD::RUN))
28: (SB-THREAD::RUN)
29: ("foreign function: call_into_lisp_")
30: ("foreign function: funcall1")
snunez1 commented 6 months ago

This was reported before in https://github.com/Lisp-Stat/data-frame/issues/26. I believe it's an issue with different version of the system. What version of Quicklisp are you running? You might want to try cloning data frame and PLOT from GitHub.

DustinMorado commented 6 months ago

The Quicklisp version is from 2021-02-03, but the distribution last update was from 2023-10-31. I will look into that previous issue, apologies I didn't notice that the same problem had been posted before.

snunez1 commented 6 months ago

Solved?

Homo-carbonis commented 6 months ago

I can confirm the same issue: The versions of plot and data-frame in quicklisp don't seem to work together. Updating plot, data-frame, lla and smoothers to the latest versions from github solved the problem for me.

snunez1 commented 6 months ago

OK, I'll leave this open until Quicklisp gets updated in case it happens again.

DustinMorado commented 6 months ago

I had tried using the data-frame and plot from github into local-projects but then I got stuck with missing smoothers and lla (these are missing from the list of repositories to clone in the installation notes in the README.) Following the comment above and adding those from source as well solved the problem for me. Thanks again both for the advice and help.