#83: Hanging after evaluating cell with syntax error#84: Kernel dies on empty code string#30: Dead kernel on startup (comm_info_request) (don't terminate on unknown messages)#69: FileNotFoundException Could not locate... on classpath.#76: add-javascript broken?#58: AOT+old tools.reader causing problems using latest ClojureScript#85: Consider the silent and store_history keys of an execute requestclojupyter install artifact (call java directly)clojupyter-installcheck-os-supportcheck-install-dirupdate-version-ednclojupyter (instead of clojure)make targets
update-version-edninstall-version (install plain icon)install-version-tag-icons (install version-tagged icon, depends on convert from imagemagick package)README.md: add tentative near-term roadmap[x] Introduce handler-based middleware structure similar to nREPL and Ring
[x] Enable higher degree of separation of concerns, thus enabling adding features in a modular fashion
[x] Introduce layered message handling: Incoming messages pass through a define sequence of middleware handlers with outbound message passing through the same set of handlers in reverse order, yielding a layered message-processing architecture
[x] Introduce handler, middleware, and transport abstractions similar to those of
employed in nREPL, but adapted
to fit into the multichannel context of Jupyter (cf. send-stdin, send-iopub, and
send-req in clojupyter.transport)
[x] Convert existing functionality to middleware-based structure, messaging-handling is now defined
by core message handler (in clojupyter.middleware):
(def wrap-base-handlers
(comp wrap-execute-request
wrap-comm-msg
wrap-comm-info
wrap-comm-open
wrap-is-complete-request
wrap-complete-request
wrap-kernel-info-request
wrap-inspect-request
wrap-history-request
wrap-shutdown-request))
(def wrap-jupyter-messaging
(comp wrapout-encode-jupyter-message
wrapout-construct-jupyter-message))
(def default-wrapper
(comp wrapin-verify-request-bindings
wrapin-bind-msgtype
wrap-print-messages
wrap-jupyter-messaging
wrap-busy-idle
wrap-base-handlers))
(def default-handler
(default-wrapper not-implemented-handler))
The modular structure will make it much easier to add functionality going forward.
[x] Reorganize code structure:
src
├── clojupyter
│ ├── display.clj
│ ├── javascript
│ │ └── alpha.clj
│ ├── kernel
│ │ ├── cljsrv
│ │ │ ├── nrepl_comm.clj
│ │ │ ├── nrepl_middleware.clj
│ │ │ └── nrepl_server.clj
│ │ ├── config.clj
│ │ ├── core.clj
│ │ ├── history.clj
│ │ ├── init.clj
│ │ ├── jupyter.clj
│ │ ├── logo.clj
│ │ ├── middleware
│ │ │ ├── base.clj
│ │ │ ├── comm.clj
│ │ │ ├── complete.clj
│ │ │ ├── execute.clj
│ │ │ ├── history.clj
│ │ │ ├── inspect.clj
│ │ │ └── log_traffic.clj
│ │ ├── middleware.clj
│ │ ├── spec.clj
│ │ ├── stacktrace.clj
│ │ ├── state.clj
│ │ ├── transport
│ │ │ └── zmq.clj
│ │ ├── transport.clj
│ │ ├── util.clj
│ │ └── version.clj
│ ├── misc
│ │ ├── display.clj
│ │ ├── helper.clj
│ │ ├── leiningen.clj
│ │ └── mime_convertible.clj
│ └── protocol
│ └── mime_convertible.clj
└── clojupyter.clj
8 directories, 32 files
~/Library/Preferences/clojupyter.edn on MacOS and ~/.config/clojupyter.edn on
Linux (per XDG Base Directory specification)~/Library/Caches on MacOS and ~/.local/share (per XDG Base
Directory specification)clj-time with clojure.java-timeidents in ZMQ messages to envelopeclojupyter.misc.jupyter)zmq-comm protocol - not needed:aot only in uberajr profile in project.cljstates.Zmq_Comm.
Accessor functions for stdin-socket and iopub-socket in passed-around map S.async.core - not used.core.clj
configure-shell-handler and configure-control-handler with make-handler. Their
role is the same, the main difference that execution-counter is incremented on the shell
socket. Why not simply use the same handler?run-kernel based on above.nrepl-server and Clojupyter middlerware into separate namespace:
clojupyter.misc.nrepl-server.messages.clj
make-shell-handler and make-control-handler: Unify into one.handle-execute-request into regular responding
function defined with defresponse.with-debug-loggingstatus-content and pyin-content into point-of-use.nrepl_comm.clj
defrecord into smaller functions, no change in logic.history.clj
nrepl_server.clj(added)
nrepl-related code from core.clj.state.clj
states.clj - add single atom for all of global state.zmq_comm.clj
util.clj
with-debug-logging macro.reformat-form. Very early experiment with auto-indent / auto-reformat of cells based on
Code Prettify
/ Autopep8. Very primitive / early cell reformatting
prototype appears to work (cf. ./nbextensions/code_prettify/autopep8.yaml). More work needed (quite a bit),
but it looks like there's a fairly straightforward solution.user.clj
reformat-form.Changes at revision 2913dc17 relative to Clojupyter master latest commit per 15 February 2019 (994f680c):
nrepl-based access from interactive development environments such as CIDER/Cursive:
Leave :value unchanged, add :mime-tagged-value insteadnrepl v0.5.3 and cider-nrepl v0.20.0message-* functions:privatecore.clj
configure-{shell,control}-handler to use multi-method instead (respond-to-message)catching-exceptions to improve code readabilityprocess-heartbeat awaynrepl-server-addr to retrieve nrepl server port to enable connection from interactive
development environmentmessages.clj
respond-to-message dispatching on request type to eliminate individually
named response functions such as input-request, comm-open-reply, kernel-info-reply, etc.defresponse to further reduce code sizeshutdown-reply separating shutdown actions and responding to shutdown requestsend-message and send-router-message to reduce code redundancy and make code easier to followexecute-request-handler a bit, add commentsget-message-{signer,checker} to make-message-{signer,checker}util.cljmiddleware/mime_values.clj
:mime-tagged-value to result of to-mime (instead of mime-tagging :value
directly): Enables using the nrepl server using regular clientsprotocol/mime_convertible.clj
nil as nil (instead of not printing anything)stacktrace.clj
cider-nrepl occasionally triggers uncaught exceptions. Most likely linked to upgrade of
nrepl and/or cider-nrepl; the cause of the problem not understood as yet.core_test.clj
stderr instead of stdout->Class-forms, e.g. ->HiccupHTML instead of HiccupHTML., to allow interactive class updateslog/debug here and therehtml-demo.ipynb
HEAD of master using Clojure 1.8)incanter-demo.ipynb
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |