Skip to content

Commit e6ec1ac

Browse files
committed
Release 2.017 - fixing codegen
1 parent c71711d commit e6ec1ac

24 files changed

+29634
-122
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Time for a ChangeLog!
2+
## 2.017
3+
* Tested AOT and codegen of numpy namespace to ensure it is loadable and works as expected.
4+
* This fixed an issue with the codegen system.
5+
26
## 2.016
37
* Upgrade dtype-next to latest version. This version of dtype-next comes with it's own
48
java-api so you can integrate deeper into the zero-copy pathways.

codegen-test/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Codegen Sample
2+
3+
A quick sample testing intended codegen usage.
4+
5+
6+
## Usage
7+
8+
We first generate the numpy namespace with a compile step.
9+
10+
```console
11+
scripts/compile
12+
```
13+
14+
Next we run the compiled code from an AOT'd main.
15+
16+
17+
```console
18+
scripts/run
19+
```

codegen-test/deps.edn

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{:paths ["src"]
2+
:deps {clj-python/libpython-clj {:mvn/version "2.017"}}}

codegen-test/src/code/codegen.clj

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(ns code.codegen
2+
(:require [libpython-clj2.python :as py]
3+
[libpython-clj2.codegen :as cgen]))
4+
5+
6+
(defn codegen
7+
[]
8+
(py/initialize!)
9+
(cgen/write-namespace! "numpy"))

codegen-test/src/code/main.clj

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
(ns code.main
2+
(:require [python.numpy :as np]
3+
[libpython-clj2.python :as py])
4+
(:gen-class))
5+
6+
7+
(defn setup!
8+
[]
9+
(py/initialize!))
10+
11+
12+
(defn lspace
13+
[]
14+
(np/linspace 2 3))
15+
16+
17+
(defn -main
18+
[]
19+
(setup!)
20+
(println (lspace))
21+
(shutdown-agents))

0 commit comments

Comments
 (0)