Skip to content

Commit 0ebd934

Browse files
committed
Merge branch 'main' into feature/concrete-region-numbers
2 parents 7c98444 + 4187910 commit 0ebd934

File tree

11 files changed

+82
-57
lines changed

11 files changed

+82
-57
lines changed

.codespellrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[codespell]
2+
ignore-words-list = missings,rcall,linke,fo

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
version:
18-
- '1.6' # Replace this with the minimum Julia version that your package supports.
18+
- 'lts' # Replace this with the minimum Julia version that your package supports.
1919
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
2020
- 'nightly'
2121
os:
@@ -25,8 +25,8 @@ jobs:
2525
arch:
2626
- x64
2727
steps:
28-
- uses: actions/checkout@v2
29-
- uses: julia-actions/setup-julia@v1
28+
- uses: actions/checkout@v4
29+
- uses: julia-actions/setup-julia@v2
3030
with:
3131
version: ${{ matrix.version }}
3232
arch: ${{ matrix.arch }}
@@ -43,15 +43,15 @@ jobs:
4343
- uses: julia-actions/julia-buildpkg@v1
4444
- uses: julia-actions/julia-runtest@v1
4545
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v1
46+
- uses: codecov/codecov-action@v5
4747
with:
4848
file: lcov.info
4949
docs:
5050
name: Documentation
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v2
54-
- uses: julia-actions/setup-julia@v1
53+
- uses: actions/checkout@v4
54+
- uses: julia-actions/setup-julia@v2
5555
with:
5656
version: '1'
5757
- run: |

.github/workflows/format_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
version: ${{ matrix.julia-version }}
2424

25-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v4
2626
- name: Install JuliaFormatter and format
2727
# This will use the latest version by default but you can set the version like so:
2828
#

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
33
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
GridVisualizeTools = "5573ae12-3b76-41d9-b48c-81d0b6e61cc5"
6+
7+
[compat]
8+
Colors = "0.13"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Documenter, GridVisualizeTools, ColorTypes
1+
using Documenter, GridVisualizeTools, ColorTypes, Colors
22

33
function mkdocs()
44
DocMeta.setdocmeta!(GridVisualizeTools, :DocTestSetup, :(using GridVisualizeTools, ColorTypes, Colors); recursive = true)

docs/src/index.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,26 @@ rgbtuple
3333
rgbtuple(:red)
3434
# output
3535
36-
(1.0,1.0,1.0)
36+
(1.0,0.0,0.0)
3737
```
38-
3938
```@docs
40-
ColorTypes.RGB
39+
rgbcolor
4140
```
4241

43-
```@example
44-
using ColorTypes,GridVisualizeTools # hide
45-
RGB(:red)
42+
```@jldoctest
43+
rgbcolor(:red)
44+
# output
45+
46+
RGB{Float64}(1.0,0.0,0.0)
4647
```
47-
```@example
48-
using ColorTypes,GridVisualizeTools # hide
49-
RGB("green")
48+
```@jldoctest
49+
rgbcolor(1.0, 0.0, 0.0)
50+
# output
51+
52+
RGB{Float64}(1.0,0.0,0.0)
5053
```
5154

55+
5256
## Visibility handling of grid cells
5357

5458
```@docs

src/GridVisualizeTools.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using DocStringExtensions: SIGNATURES, TYPEDEF, TYPEDSIGNATURES
77
using StaticArraysCore: SVector
88

99
include("colors.jl")
10-
export region_cmap, bregion_cmap, rgbtuple
10+
export region_cmap, bregion_cmap, rgbtuple, rgbcolor
1111

1212
include("extraction.jl")
1313
export extract_visible_cells3D, extract_visible_bfaces3D

src/colors.jl

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
"""depend
22
$(SIGNATURES)
33
44
Create customized distinguishable colormap for interior regions.
@@ -10,7 +10,7 @@ region_cmap(10)[1]
1010
1111
# output
1212
13-
RGB{Float64}(0.85,0.6,0.6)
13+
RGB{Float64}(0.85, 0.6, 0.6)
1414
```
1515
1616
"""
@@ -33,7 +33,7 @@ bregion_cmap(10)[1]
3333
3434
# output
3535
36-
RGB{Float64}(1.0,0.0,0.0)
36+
RGB{Float64}(1.0, 0.0, 0.0)
3737
```
3838
3939
"""
@@ -46,66 +46,76 @@ function bregion_cmap(n)
4646
end
4747

4848
"""
49-
$(SIGNATURES)
49+
Create color tuple from color description (e.g. string)
5050
51-
Create RGB color from color name string.
51+
```jldoctest
52+
julia> rgbtuple(:red)
53+
(1.0, 0.0, 0.0)
5254
53-
julia> Colors.RGB("red")
54-
RGB{Float64}(1.0,0.0,0.0)
55+
julia> rgbtuple("red")
56+
(1.0, 0.0, 0.0)
5557
```
5658
"""
57-
function Colors.RGB(c::String)
58-
c64 = Colors.color_names[c]
59-
Colors.RGB(c64[1] / 255, c64[2] / 255, c64[3] / 255)
60-
end
59+
rgbtuple(c) = rgbtuple(parse(Colors.RGB{Float64},c))
6160

6261
"""
6362
$(SIGNATURES)
6463
65-
Create RGB color from color name symbol.
64+
Create color tuple from RGB color.
6665
6766
```jldoctest
68-
julia> Colors.RGB(:red)
69-
RGB{Float64}(1.0,0.0,0.0)
67+
julia> rgbtuple(RGB(0.0,1,0))
68+
(0.0, 1.0, 0.0)
7069
```
7170
"""
72-
Colors.RGB(c::Symbol) = Colors.RGB(String(c))
71+
rgbtuple(c::Colors.RGB) = (Colors.red(c), Colors.green(c), Colors.blue(c))
72+
7373

7474
"""
75-
$(SIGNATURES)
75+
rgbcolor(col::Any)
7676
77-
Create RGB color from tuple
77+
Return Colors.RGB object from string or symbol.
7878
7979
```jldoctest
80-
julia> Colors.RGB((1.0,0,0))
81-
RGB{Float64}(1.0,0.0,0.0)
80+
julia> rgbcolor(:red)
81+
RGB{Float64}(1.0, 0.0, 0.0)
82+
83+
julia> rgbcolor("red")
84+
RGB{Float64}(1.0, 0.0, 0.0)
8285
```
83-
"""
84-
Colors.RGB(c::Tuple) = Colors.RGB(c...)
8586
8687
"""
87-
$(SIGNATURES)
88+
rgbcolor(col::Any) = parse(Colors.RGB{Float64},col)
8889

89-
Create color tuple from color description (e.g. string)
9090

91-
```jldoctest
92-
julia> rgbtuple(:red)
93-
(1.0, 0.0, 0.0)
91+
"""
92+
rgbcolor(col::RGB)
9493
95-
julia> rgbtuple("red")
96-
(1.0, 0.0, 0.0)
94+
Pass through of RGB color object.
95+
```jldoctest
96+
julia> rgbcolor(RGB(1.0,0.0, 0.0))
97+
RGB{Float64}(1.0, 0.0, 0.0)
9798
```
98-
"""
99-
rgbtuple(c) = rgbtuple(Colors.RGB(c))
10099
101100
"""
102-
$(SIGNATURES)
101+
rgbcolor(col::Colors.RGB) = col
103102

104-
Create color tuple from RGB color.
103+
"""
104+
rgbcolor(col::Tuple)
105105
106+
Create RGB color object from tuple
106107
```jldoctest
107-
julia> rgbtuple(RGB(0.0,1,0))
108-
(0.0, 1.0, 0.0)
108+
julia> rgbcolor((1.0,0.0, 0.0))
109+
RGB{Float64}(1.0, 0.0, 0.0)
109110
```
111+
110112
"""
111-
rgbtuple(c::Colors.RGB) = (Colors.red(c), Colors.green(c), Colors.blue(c))
113+
function rgbcolor(col::Tuple)
114+
# Base.depwarn(
115+
# "Setting custom colors as `Tuple`, e.g. `color=(0.,0.,1.)` will be removed in the next major release. "*
116+
# "Please use color=RGB(0.,0.,1.) instead.",
117+
# :update_lines,
118+
# )
119+
return Colors.RGB(col...)
120+
end
121+

src/marching.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
Mutates:
1919
- ixcoord: 3x4 array of plane - tetedge intersection coordinates
20-
- ixvalues: 4 element array of fuction values at plane - tetdedge intersections
20+
- ixvalues: 4 element array of function values at plane - tetdedge intersections
2121
2222
Returns:
2323
- nxs,ixcoord,ixvalues
@@ -67,7 +67,7 @@ end
6767
flevel could be flevels
6868
xyzcut could be a vector of plane data
6969
perhaps we can also collect isolines.
70-
Just an optional collector parameter, defaulting to somethig makie independent.
70+
Just an optional collector parameter, defaulting to something makie independent.
7171
7272
Better yet:
7373
@@ -114,7 +114,7 @@ Return values: (points, tris, values)
114114
115115
These can be readily turned into a mesh with function values on it.
116116
117-
Caveat: points with similar coordinates are not identified, e.g. an intersection of a plane and an edge will generate as many edge intersection points as there are tetrahedra adjacent to that edge. As a consequence, normal calculations for visualization alway will end up with facet normals, not point normals, and the visual impression of a rendered isosurface will show its piecewise linear genealogy.
117+
Caveat: points with similar coordinates are not identified, e.g. an intersection of a plane and an edge will generate as many edge intersection points as there are tetrahedra adjacent to that edge. As a consequence, normal calculations for visualization always will end up with facet normals, not point normals, and the visual impression of a rendered isosurface will show its piecewise linear genealogy.
118118
119119
"""
120120
function marching_tetrahedra(coord::Matrix{Tc},

src/markerpoints.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $(SIGNATURES)
55
Assume that `points` are nodes of a polyline.
66
Place `nmarkers` equidistant markers at the polyline, under
77
the assumption that the points are transformed via the transformation
8-
matrix M vor visualization.
8+
matrix M for visualization.
99
"""
1010
function markerpoints(points, nmarkers, transform)
1111
dist(p1, p2) = norm(transform * (p1 - p2))

0 commit comments

Comments
 (0)