clj-python / libpython-clj

Python bindings for Clojure
Eclipse Public License 2.0
1.08k stars 68 forks source link

docs on usage are out of sync and fail due to API changs in v2 #173

Closed joinr closed 2 years ago

joinr commented 3 years ago

https://clj-python.github.io/libpython-clj/Usage.html

(require '[libpython-clj.python
                 :refer [as-python as-jvm
                         ->python ->jvm
                         get-attr call-attr call-attr-kw
                         get-item att-type-map
                         call call-kw initialize!
                         as-numpy as-tensor ->numpy
                         run-simple-string
                         add-module module-dict
                         import-module
                         python-type]])

fails.

Removing call, as-numpy, as-tensor, ->numpy and changing namespace works:

(require '[libpython-clj2.python
                 :refer [as-python as-jvm
                         ->python ->jvm
                         get-attr call-attr call-attr-kw
                         get-item
                         initialize!
                         run-simple-string
                         add-module module-dict
                         import-module
                         python-type]])

I haven't checked any other examples.

behrica commented 2 years ago

I take a look at this, with the aim to fix it

behrica commented 2 years ago

I fixed them all with d37f06c48b75365f5dcb0dc2896cc9c3daabf89a

and propose to close the issue.

cnuernber commented 2 years ago

Closed. I am sure there are more places but this is fine for now.