Skip to content

Commit 0faf60f

Browse files
committed
Update to Junimo.jl v0.1.1:
1. Add `gof` and `show_gof!` 2. Add pring macros 3. update docs
1 parent 34a10e1 commit 0faf60f

File tree

12 files changed

+531
-43
lines changed

12 files changed

+531
-43
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ docs/build
55

66
desktop.ini
77

8-
Manifest.toml
8+
Manifest.toml
9+
Prompts.md

Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name = "Junimo"
22
uuid = "3d54b6d4-9b4d-4421-9513-a6007c061c41"
33
authors = ["cug-xyx <xieyuxuan0430@igsnrr.ac.cn>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
7+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
78
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
9+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
810

911
[compat]
12+
CairoMakie = "0.15.8"
1013
Random = "1.11.0"
14+
Statistics = "1.11.1"
1115

1216
[extras]
1317
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Junimo.jl <a href="https://cug-xyx.github.io/Junimo.jl/index.html"><img src="docs/src/assets/logo.png" align="right" height="138"/></a>
1+
# Junimo.jl<a href="https://cug-xyx.github.io/Junimo.jl/index.html"><img src="docs/src/assets/logo.png" align="right" height="138"/></a>
22

33
[![Tests](https://github.com/cug-xyx/Junimo.jl/actions/workflows/tests.yml/badge.svg)](https://github.com/cug-xyx/Junimo.jl/actions/workflows/tests.yml)
44
[![Documentation](https://github.com/cug-xyx/Junimo.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/cug-xyx/Junimo.jl/actions/workflows/ci.yml)
@@ -7,21 +7,34 @@
77

88
## Table of Contents
99

10-
- [Junimo.jl ](#junimojl-)
10+
- [Junimo.jl](#junimojl)
1111
- [Table of Contents](#table-of-contents)
1212
- [Overview](#overview)
13+
- [Author](#author)
14+
- [Function Categories](#function-categories)
1315
- [Installation](#installation)
1416
- [Quick Start](#quick-start)
1517
- [Testing](#testing)
1618
- [Documentation](#documentation)
1719
- [Contributing](#contributing)
1820
- [License](#license)
21+
- [TODO](#todo)
1922

2023
## Overview
2124

2225
`Junimo.jl` gathers practical helpers and conventions into a single package.
2326
It favors small, composable utilities that can be reused across projects and scripts.
2427

28+
## Author
29+
30+
YuxuanXie
31+
32+
## Function Categories
33+
34+
- Utils: colored console output helpers (`cprint`, `red`, `green`, `blue`, `purple` and macros)
35+
- Statistics: goodness-of-fit metrics (`gof`)
36+
- Visualize: GoF annotation helpers for Makie (`show_gof!`)
37+
2538
## Installation
2639

2740
```julia
@@ -51,3 +64,7 @@ Contributions are welcome. Please open an issue to discuss ideas before submitti
5164
## License
5265

5366
GPL-3.0-only
67+
68+
## TODO
69+
70+
- [ ] colorful gof output (e.g., red for positive number, blue for negative number)

docs/make.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ makedocs(
66
sitename="Junimo.jl",
77
pages = [
88
"index.md",
9-
"Print" => "Utils/Print.md",
10-
# "Subsection" => [
11-
# ...
12-
# ]
9+
"Statistics" => [
10+
"Statistics/Gof.md"
11+
],
12+
"Utils" => [
13+
"Utils/Print.md"
14+
],
15+
"Visualize" => [
16+
"Visualize/ShowGof.md"
17+
]
1318
]
1419
)
1520

docs/src/Statistics/Gof.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Gof
2+
3+
```@meta
4+
CurrentModule = Junimo
5+
```
6+
7+
Compute a composite set of goodness-of-fit metrics between observed and simulated values.
8+
Missing values are filtered pairwise, and optional rounding is supported via `n_small`.
9+
10+
## Examples
11+
12+
```@example
13+
using Junimo # hide
14+
15+
yobs = [1, 2, 3, 4, 5]
16+
ysim = [1, 2, 3, 4, 6]
17+
18+
gof(yobs, ysim)
19+
```
20+
21+
```@example
22+
using Junimo # hide
23+
24+
gof(1, 1)
25+
```
26+
27+
```@example
28+
using Junimo # hide
29+
30+
yobs = [1, missing, 3, 4, 5]
31+
ysim = [1, 2, missing, 4, 6]
32+
33+
gof(yobs, ysim; n_small=3)
34+
```
35+
36+
## APIs
37+
38+
```@docs
39+
gof
40+
```

docs/src/Utils/Print.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@
44
CurrentModule = Junimo
55
```
66

7-
## Examples
8-
9-
```@example
10-
using Junimo # hide
11-
12-
red("Red text")
13-
green("Green text")
14-
blue("Blue text")
15-
purple("Purple text")
16-
```
17-
18-
## APIs
19-
20-
```@docs
21-
cprint
22-
red
23-
green
24-
blue
25-
purple
26-
```
27-
28-
!!! todo "TODO"
29-
- first
30-
- second
7+
## Examples
8+
9+
```@example
10+
using Junimo # hide
11+
12+
red("Red text")
13+
green("Green text")
14+
blue("Blue text")
15+
purple("Purple text")
16+
17+
@red "Red text (macro)"
18+
@green "Green text (macro)"
19+
@blue "Blue text (macro)"
20+
@purple "Purple text (macro)"
21+
```
22+
23+
## APIs
24+
25+
```@docs
26+
cprint
27+
red
28+
green
29+
blue
30+
purple
31+
@red
32+
@green
33+
@blue
34+
@purple
35+
```

docs/src/Visualize/ShowGof.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Gof
2+
3+
```@meta
4+
CurrentModule = Junimo
5+
```
6+
7+
Render a compact multiline block of GoF metrics at a chosen position on an axis.
8+
Metrics are computed internally via `gof` and can be filtered via the `metrics` keyword.
9+
10+
## Examples
11+
12+
```@example
13+
using Junimo # hide
14+
using CairoMakie # hide
15+
16+
CairoMakie.activate!() # hide
17+
18+
yobs = [1, 2, 3, 4, 5]
19+
ysim = [1, 2, 3, 4, 6]
20+
21+
22+
fig = Figure(; size=(700, 350))
23+
24+
ax = Axis(
25+
fig[1, 1], titlefont = :regular,
26+
xlabel = "Yobs (-)", ylabel = "Ysim (-)"
27+
)
28+
scatter!(ax, yobs, ysim; markersize=10, color=:lightblue)
29+
lines!(ax, [0, 6], [0, 6]; color=:red, linestyle=:dash, linewidth=2)
30+
show_gof!(
31+
ax, 5.3, 0.1,
32+
yobs, ysim;
33+
metrics = ["R2", "RMSE"],
34+
n=2,
35+
align=(:right, :bottom),
36+
color=:black
37+
)
38+
fig
39+
```
40+
41+
## APIs
42+
43+
```@docs
44+
show_gof!
45+
```

docs/src/index.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
11
# Junimo.jl
22

3-
## Functions
3+
[![Tests](https://github.com/cug-xyx/Junimo.jl/actions/workflows/tests.yml/badge.svg)](https://github.com/cug-xyx/Junimo.jl/actions/workflows/tests.yml)
4+
[![Documentation](https://github.com/cug-xyx/Junimo.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/cug-xyx/Junimo.jl/actions/workflows/ci.yml)
5+
6+
`Junimo.jl` is a personal Julia utility library, aimed at automating and streamlining day-to-day workflows.
7+
8+
## Table of Contents
9+
10+
- [Junimo.jl](#junimojl)
11+
- [Table of Contents](#table-of-contents)
12+
- [Overview](#overview)
13+
- [Author](#author)
14+
- [Function Categories](#function-categories)
15+
- [Installation](#installation)
16+
- [Quick Start](#quick-start)
17+
- [Testing](#testing)
18+
- [Documentation](#documentation)
19+
- [Contributing](#contributing)
20+
- [License](#license)
21+
22+
## Overview
23+
24+
`Junimo.jl` gathers practical helpers and conventions into a single package.
25+
It favors small, composable utilities that can be reused across projects and scripts.
26+
27+
## Author
28+
29+
YuxuanXie
30+
31+
## Function Categories
32+
33+
- Utils: colored console output helpers (`cprint`, `red`, `green`, `blue`, `purple` and macros)
34+
- Statistics: goodness-of-fit metrics (`gof`)
35+
- Visualize: GoF annotation helpers for Makie (`show_gof!`)
36+
37+
## Installation
38+
39+
```julia
40+
pkg> add https://github.com/cug-xyx/Junimo.jl
41+
```
42+
43+
## Quick Start
44+
45+
```julia
46+
using Junimo
47+
```
48+
49+
## Testing
50+
51+
```julia
52+
julia --project -e "using Pkg; Pkg.test()"
53+
```
54+
55+
## Documentation
56+
57+
Documentation site: https://cug-xyx.github.io/Junimo.jl/index.html
58+
59+
## Contributing
60+
61+
Contributions are welcome. Please open an issue to discuss ideas before submitting a PR.
62+
63+
## License
64+
65+
GPL-3.0-only
66+

src/Junimo.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module Junimo
44

55
include("./Utils/Print.jl")
66

7+
include("./Statistics/Gof.jl")
8+
9+
include("./Visualize/ShowGof.jl")
710

811
function __init__()
912
fortunes = [

0 commit comments

Comments
 (0)