Skip to content

Commit

Permalink
Remove ForwardDiff, Interpolations and that functionality
Browse files Browse the repository at this point in the history
modified:   .gitignore
modified:   Project.toml
modified:   src/MechanicalSketch.jl
modified:   src/autodiff_unitfu.jl
modified:   src/matrix_interpolation.jl
modified:   src/streamline_convolution.jl
modified:   test/Manifest.toml
modified:   test/Project.toml
modified:   test/run_process_test.jl
deleted:    test/test_11.png
modified:   test/test_20.png
modified:   test/test_21.png
modified:   test/test_22.png
modified:   test/test_23.jl
deleted:    test/test_23.png
modified:   test/test_24.jl
deleted:    test/test_24.png
modified:   test/test_25.jl
deleted:    test/test_25.png
modified:   test/test_26.jl
deleted:    test/test_26.png
modified:   test/test_27.jl
deleted:    test/test_27.png
modified:   test/test_28.png
modified:   test/test_29.jl
deleted:    test/test_29.png
modified:   test/test_30.jl
deleted:    test/test_30.png
modified:   test/test_31.png
modified:   test/test_32.jl
modified:   test/test_33.jl
deleted:    test/test_33.png
modified:   test/test_34.jl
deleted:    test/test_34.png
modified:   test/test_35.png
modified:   test/test_36.png
modified:   test/test_37.png
modified:   test/test_38.jl
deleted:    test/test_38.png
modified:   test/test_39.png
modified:   test/test_40.jl
deleted:    test/test_40.png
modified:   test/test_41.jl
deleted:    test/test_41.png
modified:   test/test_5.png
  • Loading branch information
hustf committed Jun 28, 2021
1 parent cedccb5 commit 784a33d
Show file tree
Hide file tree
Showing 45 changed files with 382 additions and 350 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ luxor-drawing*
test/std*
*.gif
*.png
Manifest.toml
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name = "MechanicalSketch"
uuid = "183f2c95-4b91-4df3-9bd2-197e8f9edb13"
authors = ["hustf <[email protected]> and contributors"]
version = "0.5.3"
version = "0.6.0"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
24 changes: 11 additions & 13 deletions src/MechanicalSketch.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module MechanicalSketch
# TODO import new Luxor functions from latest revision.
import Luxor
import Luxor:
# Layout
Expand Down Expand Up @@ -138,12 +137,11 @@ weighted_color_mean, Colors, parse, comp1, comp2, comp3, comp4


using MechanicalUnits
#import MechanicalUnits: Power, oneunit, numtype, AbstractQuantity # TODO import these to MechanicalUnits!
import MechanicalUnits.Unitfu: Power, oneunit, numtype, AbstractQuantity
@import_expand kW # Don't use ~ since that would also import WI, which we use elsewhere.
import Latexify, LaTeXStrings, NodeJS
import Latexify: @latexify, latexify, @latexrecipe
import LaTeXStrings: LaTeXString, @L_str
using Latexify: @latexify, latexify, @latexrecipe
using LaTeXStrings: LaTeXString, @L_str
"""
Rotations given with units occur around the positive z axis, when y is up and x is to the right.
We don't dispatch on the dimension of angles, because the dimension is NonDims (for good reason).
Expand All @@ -152,17 +150,17 @@ In the context of this package, defining Angle is considered harmless:
const Angle = Union{typeof(1.0°), typeof(1°), typeof(1.0f0°), typeof(1.0rad), typeof(1rad), typeof(1.0f0*rad)}
# TODO move Angle to numeric types...
import ColorSchemes
import ColorSchemes: getinverse, get
import ColorSchemes: RGB, RGBA
import ColorSchemes: HSV, HSVA, HSL, HSLA, LCHab, LCHabA, LCHuv, LCHuvA # Cylindrical hue colorspaces
import ColorSchemes: isoluminant_cgo_70_c39_n256, leonardo, PuOr_8, Greys_9 # We also define ColSchemeNoMiddle in 'colors.jl'
using ColorSchemes: getinverse, get
using ColorSchemes: RGB, RGBA
using ColorSchemes: HSV, HSVA, HSL, HSLA, LCHab, LCHabA, LCHuv, LCHuvA # Cylindrical hue colorspaces
using ColorSchemes: isoluminant_cgo_70_c39_n256, leonardo, PuOr_8, Greys_9 # We also define ColSchemeNoMiddle in 'colors.jl'
import Base: -, +, *, /, hypot, product, show
import Colors: @colorant_str
import FileIO: @format_str, File, save
import ForwardDiff
using Colors: @colorant_str
using FileIO: @format_str, File, save
#import ForwardDiff
import StaticArrays
import StaticArrays: SA, SVector
import Interpolations: interpolate, Linear, Flat, extrapolate, Extrapolation, Gridded
using StaticArrays: SA, SVector
#import Interpolations: interpolate, Linear, Flat, extrapolate, Extrapolation, Gridded
const CHORD_ZERO = 0.25
const FOIL_CHORD_POS = [0, 0.0125, 0.025, 0.05, 0.075, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1]
const FOIL_HALF_T = [0, 0.117, 0.1575, 0.2179, 0.2649, 0.3042, 0.4146, 0.4764, 0.5, 0.4816, 0.4149, 0.3159, 0.1989, 0.0811, 0.0306, 0]
Expand Down
5 changes: 3 additions & 2 deletions src/autodiff_unitfu.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
#="""
generate_Q²_to_Q_from_CQ_to_Q(CQ_to_Q)
Input:
f: CQ → Q
Expand Down Expand Up @@ -174,4 +174,5 @@ care if differentiating twice!
"""
function ∇(f; physwidth = 10.0m, physheight = 4.0m)
matrix_to_function(∇_rectangle(f; physwidth, physheight))
end
end
=#
2 changes: 2 additions & 0 deletions src/matrix_interpolation.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#= Interpolations.jl and ForwardDiff.jl are removed as dependencies in this version.
"""
function_to_interpolated_function(f_xy; physwidth = 10.0m, physheight = 4.0m)
Expand Down Expand Up @@ -95,3 +96,4 @@ function matrix_to_function(matrix) # temp ::Array{Float64,2})
extrapolate(fxy_inter, Flat())
end
=#
12 changes: 7 additions & 5 deletions src/streamline_convolution.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#= ForwardDiff and Interpolations removed as dependencies from this version.
"""
draw_streamlines(pt, f_xy; physwidth = 10.0m, physheight = 4.0m, centered = true,
h = 0.1s, nsteps = 10, probability = 0.0001)
Expand Down Expand Up @@ -58,7 +59,7 @@ Return x for x in the interval [-maxabs, maxabs]
Repeating between these values.
"""
sawtooth(x, maxabs) = rem(x, 2maxabs, RoundNearest)
sawtooth(x, maxabs) = rem(x, 2maxabs, RoundNearest)
"""
line_integral_convolution_complex(f_xy, n_xy, x_mid, y_mid, f_s, f_0)
Expand Down Expand Up @@ -107,7 +108,7 @@ function line_integral_convolution_complex(f_xy, n_xy, x_mid, y_mid, f_s, f_0)
end

=#

"""
noise_between_wavelengths(λ_min, λ_max, x)
Expand Down Expand Up @@ -181,7 +182,7 @@ function noise_between_wavelengths(λ_min, λ_max, xs::T, ys::T; normalize = tru
no = [ noise_between_wavelengths(λ_min, λ_max, x, y) for y in ys, x in xs]
normalize ? normalize_datarange(no) : no
end

#=
"""
noise_for_lic(f_xy, xs, ys)
Expand Down Expand Up @@ -385,7 +386,7 @@ end
Linear floating index of q given that index 1 corresponds to 'mini' and 'maxindex' corresponds to 'maxi'.
"""
float_index(maxindex::Int, mini::T, maxi::T, q::T) where T = 1 + (maxindex - 1) * (q - mini) / (maxi - mini)
float_index(maxindex::Int, mini::T, maxi::T, q::T) where T = 1 + (maxindex - 1) * (q - mini) / (maxi - mini)
"""
Expand Down Expand Up @@ -790,4 +791,5 @@ function color_matrix_mix(lumin_mat, quant_scalar_mat, legend, luminosity_variat
# lum will be in the range 0 to 100.
color_with_lumin(col, lum)
end
end
end
=#
Loading

0 comments on commit 784a33d

Please sign in to comment.