Skip to content

Commit ee18a4e

Browse files
committed
Update packages
1 parent 00f0613 commit ee18a4e

File tree

5 files changed

+55
-51
lines changed

5 files changed

+55
-51
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ trim_trailing_whitespace = true
1414
insert_final_newline = true
1515

1616
[*.md]
17-
indent_size = 3
17+
indent_size = 4
1818

1919
[*.nix]
2020
indent_size = 2
2121

22-
[*.zig, *.zig.zon]
22+
[*.{zig,zig.zon}]
2323
indent_size = 4

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
*
22

33
!.github/
4+
!.github/**
45
!assets/
5-
!assets/**/
6+
!assets/**
67
!.editorconfig
78
!.gitattributes
89
!.gitignore
10+
!.gitmodules
911
!.justfile
1012
!.zigversion
1113
!LICENSE
1214
!README.md
1315

14-
!src/
15-
!src/**/
1616
!examples/
17+
!examples/**
18+
!src/
19+
!src/**
1720

1821
!*.md
22+
!*.mdc
1923
!*.svg
2024
!*.png
2125
!*.nix
2226
!*.lock
27+
!*.yaml
28+
!*.yml
29+
!*.sh
2330
!*.zig
2431
!*.zon

.justfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ test:
3333
# Remove build artifacts and non-essential files
3434
clean:
3535
@echo "Cleaning..."
36-
@rm -rf .zig-cache zig-out
36+
@find . -type d -name ".zig-cache" -exec rm -rf {} +
37+
@find . -type d -name "zig-out" -exec rm -rf {} +
3738

3839
# Format the project
3940
format:
4041
@echo "Formatting..."
4142
@zig fmt .
42-
@nixfmt .
43+
@find . -name "*.nix" -type f -exec nixfmt {} \;
4344

4445
# Generate documentation
4546
docs:

README.md

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
</div>
1616

1717
<a href="https://github.com/Kaweees/kiwigrad">
18-
<img alt="Zig Logo" src="assets/img/zig.svg" align="right" width="150">
18+
<img alt="Zig Logo" src="assets/img/zig.svg" align="right" width="150">
1919
</a>
2020

2121
<div align="left">
22-
<h1><em><a href="https://github.com/Kaweees/kiwigrad">~kiwigrad</a></em></h1>
22+
<h1><em><a href="https://github.com/Kaweees/kiwigrad">~kiwigrad</a></em></h1>
2323
</div>
2424

2525
<!-- ABOUT THE PROJECT -->
@@ -35,14 +35,8 @@ A scalar-valued automatic differentiation (autograd) engine for deep learning wr
3535
## Preview
3636

3737
<p align="center">
38-
<img src="assets/img/mlp.png"
39-
width = "80%"
40-
alt = "MLP"
41-
/>
42-
<img src="assets/img/perceptron.png"
43-
width = "80%"
44-
alt = "Perceptron"
45-
/>
38+
<img src="assets/img/mlp.png" width = "80%" alt = "MLP" />
39+
<img src="assets/img/perceptron.png" width = "80%" alt = "Perceptron" />
4640
</p>
4741

4842
<!-- GETTING STARTED -->
@@ -58,60 +52,60 @@ To get a local copy of the project up and running on your machine, follow these
5852

5953
1. Clone the project repository
6054

61-
```sh
62-
git clone https://github.com/Kaweees/kiwigrad.git
63-
cd kiwigrad
64-
```
55+
```sh
56+
git clone https://github.com/Kaweees/kiwigrad.git
57+
cd kiwigrad
58+
```
6559

6660
2. Install the project dependencies
6761

68-
```sh
69-
nix-shell --max-jobs $(nproc) # Linux / Windows (WSL)
70-
nix-shell --max-jobs $(sysctl -n hw.ncpu) # macOS
71-
```
62+
```sh
63+
nix-shell --max-jobs $(nproc) # Linux / Windows (WSL)
64+
nix-shell --max-jobs $(sysctl -n hw.ncpu) # macOS
65+
```
7266

7367
3. Build the project
7468

75-
```sh
76-
just build
77-
```
69+
```sh
70+
just build
71+
```
7872

7973
4. Run the project
8074

81-
```sh
82-
just run
83-
```
75+
```sh
76+
just run
77+
```
8478

8579
### Add as a dependency
8680

8781
To include `kiwigrad` in your Zig project, follow these steps:
8882

8983
1. Add to your `build.zig.zon` file via `zig fetch`:
9084

91-
```sh
92-
zig fetch --save git+https://github.com/Kaweees/kiwigrad.git
93-
```
85+
```sh
86+
zig fetch --save git+https://github.com/Kaweees/kiwigrad.git
87+
```
9488

9589
2. Add the following line to your `build.zig` file:
9690

97-
```zig
98-
const kiwigrad = @import("kiwigrad");
91+
```zig
92+
const kiwigrad = @import("kiwigrad");
9993
100-
pub fn build(b: *std.Build) void {
101-
// exe setup...
94+
pub fn build(b: *std.Build) void {
95+
// exe setup...
10296
103-
const KiwiGrad_dep = b.dependency("kiwigrad", .{
104-
.target = target,
105-
.optimize = optimize,
106-
});
97+
const KiwiGrad_dep = b.dependency("kiwigrad", .{
98+
.target = target,
99+
.optimize = optimize,
100+
});
107101
108-
const KiwiGrad_module = KiwiGrad_dep.module("kiwigrad");
109-
exe.root_module.addImport("kiwigrad", KiwiGrad_module);
102+
const KiwiGrad_module = KiwiGrad_dep.module("kiwigrad");
103+
exe.root_module.addImport("kiwigrad", KiwiGrad_module);
110104
111-
// additional build steps...
112-
}
105+
// additional build steps...
106+
}
113107
114-
```
108+
```
115109

116110
## Usage
117111

shell.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
{ pkgs ? import <nixpkgs> { } }:
1+
{
2+
pkgs ? import <nixpkgs> { },
3+
}:
24

35
pkgs.mkShell {
46
buildInputs = with pkgs; [
5-
zig # Zig compiler
6-
graphviz # Graphviz
7+
zig_0_14 # Zig compiler 0.14.1
8+
nixfmt # Nix formatter
79
just # Just runner
8-
nixfmt-classic # Nix formatter
10+
graphviz # Graphviz
911
];
1012

1113
# Shell hook to set up environment

0 commit comments

Comments
 (0)