From 73b10792ab739a235b0500af448bb4d7a87b368c Mon Sep 17 00:00:00 2001 From: Ethan Miller Date: Sat, 11 Feb 2023 11:29:29 -0500 Subject: [PATCH 1/3] Upgrade to latest clay version --- deps.edn | 2 +- docs/column_exploration.clj | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/deps.edn b/deps.edn index 7b8b3a6..1b97492 100644 --- a/deps.edn +++ b/deps.edn @@ -4,4 +4,4 @@ techascent/tech.ml.dataset {:mvn/version "7.000-beta-27"} ;; generateme/fastmath {:mvn/version "2.1.0"} } - :aliases {:dev {:extra-deps {org.scicloj/clay {:mvn/version "1-alpha14"}}}}} + :aliases {:dev {:extra-deps {org.scicloj/clay {:mvn/version "2-alpha12"}}}}} diff --git a/docs/column_exploration.clj b/docs/column_exploration.clj index fa405b8..7c1dd90 100644 --- a/docs/column_exploration.clj +++ b/docs/column_exploration.clj @@ -3,23 +3,17 @@ ^{:kind/hidden true} (ns intro (:require [tablecloth.api :as tc] - [scicloj.clay.v1.api :as clay] - [scicloj.clay.v1.tools :as tools] - [scicloj.clay.v1.tool.scittle :as scittle] - [scicloj.kindly.v2.kind :as kind] - [scicloj.clay.v1.view.dataset] - [nextjournal.clerk :as clerk])) + [scicloj.clay.v2.api :as clay] + [scicloj.kindly.v3.api :as kindly] + [scicloj.kindly.v3.kind :as kind] + )) ^{:kind/hidden true} -#_(clay/restart! {:tools [#_tools/scittle - tools/clerk]}) +(clay/start!) ^{:kind/hidden true} (comment - (clerk/show!) - - (do (scittle/show-doc! "docs/column_exploration.clj" {:hide-doc? true}) - (scittle/write-html! "docs/column_exploration.html")) + (do (clay/show-doc! "docs/column_exploration.clj" {:hide-doc? true})) ,) ;; ## What is this exploration? From be4f406f9b2dc884c7a691a2d3669c0c569a9478 Mon Sep 17 00:00:00 2001 From: Ethan Miller Date: Sat, 11 Feb 2023 11:30:25 -0500 Subject: [PATCH 2/3] Show using tablecloth.column.api.operators ns --- docs/column_exploration.clj | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/column_exploration.clj b/docs/column_exploration.clj index 7c1dd90..6d66cbc 100644 --- a/docs/column_exploration.clj +++ b/docs/column_exploration.clj @@ -52,21 +52,28 @@ ;; ### Basic Operations -;; Right now we need to use the functional name space from the -;; underlying computation library tech.v3.datatype to operate on -;; columns. - -(require '[tech.v3.datatype.functional :as fun]) +;; Operations are right now in their own namespace +(require '[tablecloth.column.api.operators :as ops]) ;; With that imported we can perform a large number of operations: (def a (column [20 30 40 50])) (def b (column (range 4))) -(fun/- a b) +(ops/- a b) + +(ops/pow a 2) + +(ops/* 10 (fun/sin a)) + +(ops/< a 35) + +;; All these operations take a column as their first argument and +;; return a column, so they can be chained easily. + +(-> a + (ops/* b) + (ops/< 70)) -(fun/pow a 2) -(fun/* 10 (fun/sin a)) -(fun/< a 35) From f9bf81df2675f2097ad707c8efbabfa008f638c1 Mon Sep 17 00:00:00 2001 From: Ethan Miller Date: Sat, 11 Feb 2023 13:59:34 -0500 Subject: [PATCH 3/3] Cleanup whitespace --- docs/column_exploration.clj | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/column_exploration.clj b/docs/column_exploration.clj index 6d66cbc..7185618 100644 --- a/docs/column_exploration.clj +++ b/docs/column_exploration.clj @@ -74,6 +74,3 @@ (-> a (ops/* b) (ops/< 70)) - - -