Skip to content

Commit

Permalink
attempting to reproduce this error nextjournal/clerk#531
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkueng committed Sep 11, 2024
1 parent e892f6e commit 9a1b305
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cpcache
venv
.clerk
.idea
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Attempt to reproduce issue https://github.com/nextjournal/clerk/issues/531

My reproduction fails with the error `Invalid symbol: Note:.` which I believe is probably identical in respects to the origin of the issue.

To start up the project do the following:

1. Install python3, pip3 and virtualenv
2. Run `virtualenv venv` to create a virtual environment directory.
3. Activate the new virtual environment `source venv/bin/activate`
4. Install matplotlib `pip install matplotlib`
5. Start up the REPL within the activated virtual environment `clj -m nrepl.cmdline`
6. Once the browser opens up, enable the last line in `notebooks/issue_reproduction.clj` and see the error appear.
3 changes: 3 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{:paths ["dev"]
:deps {clj-python/libpython-clj {:mvn/version "2.025"}
io.github.nextjournal/clerk {:mvn/version "0.16.1016"}}}
7 changes: 7 additions & 0 deletions dev/user.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(require
'[nextjournal.clerk :as clerk])

;; start Clerk's built-in webserver on the default port 7777, opening the browser when done
(clerk/serve! {:browse true :watch-paths ["notebooks"]})

(clerk/show! "notebooks/issue_reproduction.clj")
Binary file added images/2024_08_20_room_light.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions notebooks/issue_reproduction.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(ns issue_reproduction
(:require [libpython-clj2.require :refer [require-python]]
[libpython-clj2.python :refer [py. py.. py.- get-attr call-attr] :as py]))

; have to set the headless mode before requiring pyplot
(def mplt (py/import-module "matplotlib"))
(py. mplt "use" "Agg")

(require-python '[matplotlib.pyplot :as pyplot :bind-ns true])

;; Fails with error: Invalid symbol: Note:.
;; which sounds like https://github.com/nextjournal/clerk/issues/531 -> Invalid symbol: BagObj:
; (matplotlib.pyplot/imread "images/2024_08_20_room_light.jpg")

0 comments on commit 9a1b305

Please sign in to comment.