diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index 69b999f..0000000 --- a/Manifest.toml +++ /dev/null @@ -1,863 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -[[ASL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fc1716d806dd345db9fd82e93f2186771fe6df13" -uuid = "ae81ac8f-d209-56e5-92de-9978fef736f9" -version = "0.1.1+4" - -[[AbstractFFTs]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "485ee0867925449198280d4af84bdb46a2a404d0" -uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.0.1" - -[[Adapt]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "ffcfa2d345aaee0ef3d8346a073d5dd03c983ebe" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.2.0" - -[[ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" - -[[Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[AxisAlgorithms]] -deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] -git-tree-sha1 = "a4d07a1c313392a77042855df46c5f534076fab9" -uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" -version = "1.0.0" - -[[Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[BenchmarkTools]] -deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"] -git-tree-sha1 = "9e62e66db34540a0c919d72172cc2f642ac71260" -uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "0.5.0" - -[[BinaryProvider]] -deps = ["Libdl", "Logging", "SHA"] -git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" -uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -version = "0.5.10" - -[[Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.6+5" - -[[Cairo]] -deps = ["Cairo_jll", "Colors", "Glib_jll", "Graphics", "Libdl", "Pango_jll"] -git-tree-sha1 = "d0b3f8b4ad16cb0a2988c6788646a5e6a17b6b1b" -uuid = "159f3aea-2a34-519c-b102-8c37f9878175" -version = "1.0.5" - -[[Cairo_jll]] -deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6" -uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" -version = "1.16.0+6" - -[[Calculus]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" -uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" -version = "0.5.1" - -[[ChainRulesCore]] -deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.29" - -[[CodecBzip2]] -deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] -git-tree-sha1 = "2e62a725210ce3c3c2e1a3080190e7ca491f18d7" -uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" -version = "0.7.2" - -[[CodecZlib]] -deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" -uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.0" - -[[ColorSchemes]] -deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"] -git-tree-sha1 = "3141757b5832ee7a0386db87997ee5a23ff20f4d" -uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" -version = "3.10.2" - -[[ColorTypes]] -deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "5e9769a17f17b587c951d57ba4319782b40c3513" -uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.10.10" - -[[ColorVectorSpace]] -deps = ["ColorTypes", "Colors", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "StatsBase"] -git-tree-sha1 = "4d17724e99f357bfd32afa0a9e2dda2af31a9aea" -uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" -version = "0.8.7" - -[[Colors]] -deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] -git-tree-sha1 = "ac5f2213e56ed8a34a3dd2f681f4df1166b34929" -uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" -version = "0.12.6" - -[[CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" -uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" - -[[Compat]] -deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.25.0" - -[[CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" - -[[ConstructionBase]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "48920211c95a6da1914a06c44ec94be70e84ffff" -uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.1.0" - -[[DataAPI]] -git-tree-sha1 = "dfb3b7e89e395be1e25c2ad6d7690dc29cc53b1d" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.6.0" - -[[DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" - -[[Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[DelimitedFiles]] -deps = ["Mmap"] -uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" - -[[DiffResults]] -deps = ["StaticArrays"] -git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805" -uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.0.3" - -[[DiffRules]] -deps = ["NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "214c3fcac57755cfda163d91c58893a8723f93e9" -uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.0.2" - -[[Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[DocStringExtensions]] -deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.3" - -[[Documenter]] -deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "3ebb967819b284dc1e3c0422229b58a40a255649" -uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.26.3" - -[[DocumenterEpub]] -deps = ["Dates", "Documenter", "EzXML", "FileIO", "ImageMagick", "Markdown", "NodeJS", "Test", "ZipFile"] -git-tree-sha1 = "a8cbad63aebeac30dfbedd2c7dee130fbb3ef495" -uuid = "be4a6882-a45f-4bf3-9876-0e7ffb31ffcc" -version = "0.1.4" - -[[Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" - -[[Expat_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1402e52fcda25064f51c77a9655ce8680b76acf0" -uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.2.7+6" - -[[EzXML]] -deps = ["Printf", "XML2_jll"] -git-tree-sha1 = "0fa3b52a04a4e210aeb1626def9c90df3ae65268" -uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" -version = "1.1.0" - -[[FileIO]] -deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "8800ec70aee7292931a3d3c10a3be3445b9c6141" -uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.6.2" - -[[FixedPointNumbers]] -deps = ["Statistics"] -git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" -uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" -version = "0.8.4" - -[[Fontconfig_jll]] -deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f" -uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" -version = "2.13.1+14" - -[[Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - -[[ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "d48a40c0f54f29a5c8748cfb3225719accc72b77" -uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.16" - -[[FreeType2_jll]] -deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6" -uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.10.1+5" - -[[FriBidi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0d20aed5b14dd4c9a2453c1b601d08e1149679cc" -uuid = "559328eb-81f9-559d-9380-de523a88c83c" -version = "1.0.5+6" - -[[Gettext_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "8c14294a079216000a0bdca5ec5a447f073ddc9d" -uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" -version = "0.20.1+7" - -[[Glib_jll]] -deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "04690cc5008b38ecbdfede949220bc7d9ba26397" -uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" -version = "2.59.0+4" - -[[Graphics]] -deps = ["Colors", "LinearAlgebra", "NaNMath"] -git-tree-sha1 = "2c1cf4df419938ece72de17f368a021ee162762e" -uuid = "a2bd30eb-e257-5431-a919-1863eab51364" -version = "1.1.0" - -[[Graphite2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "42adbc6fd39ba41138f894b8ac711146a2b0d986" -uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" -version = "1.3.13+4" - -[[HTTP]] -deps = ["Base64", "Dates", "IniFile", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] -git-tree-sha1 = "c9f380c76d8aaa1fa7ea9cf97bddbc0d5b15adc2" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.5" - -[[HarfBuzz_jll]] -deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Gettext_jll", "Glib_jll", "Graphite2_jll", "ICU_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] -git-tree-sha1 = "90bed5fc61d12d10832ebf988988104888eebaca" -uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566" -version = "2.6.1+10" - -[[ICU_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6ce9cf3c5490b045710d60ac3fd2fe48188846b3" -uuid = "a51ab1cf-af8e-5615-a023-bc2c838bba6b" -version = "67.1.0+3" - -[[IOCapture]] -deps = ["Logging"] -git-tree-sha1 = "377252859f740c217b936cebcd918a44f9b53b59" -uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.1.1" - -[[ImageCore]] -deps = ["AbstractFFTs", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] -git-tree-sha1 = "79badd979fbee9b8980cd995cd5a86a9e93b8ad7" -uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" -version = "0.8.20" - -[[ImageMagick]] -deps = ["FileIO", "ImageCore", "ImageMagick_jll", "InteractiveUtils", "Libdl", "Pkg", "Random"] -git-tree-sha1 = "f35fb0080591e6f271b7e1cf4c8323a4a78d5150" -uuid = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" -version = "1.1.7" - -[[ImageMagick_jll]] -deps = ["JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "1c0a2295cca535fabaf2029062912591e9b61987" -uuid = "c73af94c-d91f-53ed-93a7-00f77d67a9d7" -version = "6.9.10-12+3" - -[[IniFile]] -deps = ["Test"] -git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.0" - -[[InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[Interpolations]] -deps = ["AxisAlgorithms", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] -git-tree-sha1 = "eb1dd6d5b2275faaaa18533e0fc5f9171cec25fa" -uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" -version = "0.13.1" - -[[Ipopt]] -deps = ["BinaryProvider", "Ipopt_jll", "Libdl", "LinearAlgebra", "MathOptInterface", "MathProgBase"] -git-tree-sha1 = "7c526d73eeacf6495e694e8309f3c89d4b5f8912" -uuid = "b6b21f68-93f8-5de0-b562-5493be1d77c9" -version = "0.6.5" - -[[Ipopt_jll]] -deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "OpenBLAS32_jll", "Pkg"] -git-tree-sha1 = "91c4f42e86e4c18d9399f962045513e1ec29abad" -uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -version = "3.13.2+1" - -[[JLLWrappers]] -git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.2.0" - -[[JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" - -[[JSONSchema]] -deps = ["HTTP", "JSON", "ZipFile"] -git-tree-sha1 = "b84ab8139afde82c7c65ba2b792fe12e01dd7307" -uuid = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" -version = "0.3.3" - -[[JpegTurbo_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9aff0587d9603ea0de2c6f6300d9f9492bbefbd3" -uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "2.0.1+3" - -[[JuMP]] -deps = ["Calculus", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MathOptInterface", "MutableArithmetics", "NaNMath", "Random", "SparseArrays", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "e952f49e2242fa21edcf27bbd6c67041685bee5d" -uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "0.21.6" - -[[Juno]] -deps = ["Base64", "Logging", "Media", "Profile"] -git-tree-sha1 = "07cb43290a840908a771552911a6274bc6c072c7" -uuid = "e5e0dc1b-0480-54bc-9374-aad01c23163d" -version = "0.8.4" - -[[LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f128cd6cd05ffd6d3df0523ed99b90ff6f9b349a" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.0+3" - -[[LaTeXStrings]] -git-tree-sha1 = "c7f1c695e06c01b95a67f0cd1d34994f3e7db104" -uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" -version = "1.2.1" - -[[Latexify]] -deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] -git-tree-sha1 = "537df0b32bc0a99620872cc6d06278e454da4533" -uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" -version = "0.14.10" - -[[LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" - -[[LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" - -[[LibGit2]] -deps = ["Base64", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" - -[[Libcroco_jll]] -deps = ["Artifacts", "Glib_jll", "JLLWrappers", "Libdl", "Pkg", "XML2_jll"] -git-tree-sha1 = "a8e3b1b67458c8933992b95db9c4b37865906e3f" -uuid = "57eb2189-7eb1-52c8-ac0e-99495f550b14" -version = "0.6.13+2" - -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[Libffi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "a2cd088a88c0d37eef7d209fd3d8712febce0d90" -uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" -version = "3.2.1+4" - -[[Libgcrypt_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] -git-tree-sha1 = "b391a18ab1170a2e568f9fb8d83bc7c780cb9999" -uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" -version = "1.8.5+4" - -[[Libgpg_error_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "ec7f2e8ad5c9fa99fc773376cdbc86d9a5a23cb7" -uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" -version = "1.36.0+3" - -[[Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f" -uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.0+7" - -[[Libmount_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "51ad0c01c94c1ce48d5cad629425035ad030bfd5" -uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" -version = "2.34.0+3" - -[[Librsvg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libcroco_jll", "Libdl", "Pango_jll", "Pkg", "gdk_pixbuf_jll"] -git-tree-sha1 = "af3e6dc6747e53a0236fbad80b37e3269cf66a9f" -uuid = "925c91fb-5dd6-59dd-8e8c-345e74382d89" -version = "2.42.2+3" - -[[Libtiff_jll]] -deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "291dd857901f94d683973cdf679984cdf73b56d0" -uuid = "89763e89-9b03-5906-acba-b20f662cd828" -version = "4.1.0+2" - -[[Libuuid_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f879ae9edbaa2c74c922e8b85bb83cc84ea1450b" -uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" -version = "2.34.0+7" - -[[LinearAlgebra]] -deps = ["Libdl"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[Luxor]] -deps = ["Base64", "Cairo", "Colors", "Dates", "FileIO", "ImageMagick", "Juno", "QuartzImageIO", "Random", "Rsvg"] -git-tree-sha1 = "8796dfbdde81ec4a811a2d972a6d5f8a7c4113d0" -uuid = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" -version = "2.10.0" - -[[METIS_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "2dc1a9fc87e57e32b1fc186db78811157b30c118" -uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" -version = "5.1.0+5" - -[[MUMPS_seq_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "OpenBLAS32_jll", "Pkg"] -git-tree-sha1 = "1a11a84b2af5feb5a62a820574804056cdc59c39" -uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" -version = "5.2.1+4" - -[[MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.6" - -[[MappedArrays]] -deps = ["FixedPointNumbers"] -git-tree-sha1 = "b92bd220c95a8bbe89af28f11201fd080e0e3fe7" -uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" -version = "0.3.0" - -[[Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[MathOptInterface]] -deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "JSON", "JSONSchema", "LinearAlgebra", "MutableArithmetics", "OrderedCollections", "SparseArrays", "Test", "Unicode"] -git-tree-sha1 = "606efe4246da5407d7505265a1ead72467528996" -uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "0.9.20" - -[[MathProgBase]] -deps = ["LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "9abbe463a1e9fc507f12a69e7f29346c2cdc472c" -uuid = "fdba3010-5040-5b88-9595-932c9decdf73" -version = "0.7.8" - -[[MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] -git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" -uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.0.3" - -[[MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" - -[[MechanicalUnits]] -deps = ["Base64", "Distributed", "InteractiveUtils", "Libdl", "LinearAlgebra", "Logging", "Markdown", "Random", "Serialization", "Sockets", "Test", "Unitfu"] -git-tree-sha1 = "0e0eca9fbd0d9c575d8cd106979c350bf0fe057b" -uuid = "e6be9192-89dc-11e9-36e6-5dbcb28f419e" -version = "0.4.3" - -[[Media]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "75a54abd10709c01f1b86b84ec225d26e840ed58" -uuid = "e89f7d12-3494-54d1-8411-f7d8b9ae1f27" -version = "0.5.0" - -[[Missings]] -deps = ["DataAPI"] -git-tree-sha1 = "f8c673ccc215eb50fcadb285f522420e29e69e1c" -uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "0.4.5" - -[[Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[MosaicViews]] -deps = ["MappedArrays", "OffsetArrays", "PaddedViews"] -git-tree-sha1 = "614e8d77264d20c1db83661daadfab38e8e4b77e" -uuid = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389" -version = "0.2.4" - -[[MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" - -[[MutableArithmetics]] -deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "6b6bb8f550dc38310afd4a0af0786dc3222459e2" -uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "0.2.14" - -[[NaNMath]] -git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "0.3.5" - -[[NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" - -[[NodeJS]] -deps = ["Pkg"] -git-tree-sha1 = "350ac618f41958e6e0f6b0d2005ae4547eb1b503" -uuid = "2bd173c7-0d6d-553b-b6af-13a54713934c" -version = "1.1.1" - -[[OffsetArrays]] -deps = ["Adapt"] -git-tree-sha1 = "b3dfef5f2be7d7eb0e782ba9146a5271ee426e90" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.6.2" - -[[OpenBLAS32_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "ba4a8f683303c9082e84afba96f25af3c7fb2436" -uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" -version = "0.3.12+1" - -[[OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.3+4" - -[[OrderedCollections]] -git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.4.0" - -[[PCRE_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "1b556ad51dceefdbf30e86ffa8f528b73c7df2bb" -uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc" -version = "8.42.0+4" - -[[PaddedViews]] -deps = ["OffsetArrays"] -git-tree-sha1 = "0fa5e78929aebc3f6b56e1a88cf505bb00a354c4" -uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" -version = "0.5.8" - -[[Pango_jll]] -deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "FriBidi_jll", "Glib_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9a336dee51d20d1ed890c4a8dca636e86e2b76ca" -uuid = "36c8627f-9965-5494-a995-c6b170f724f3" -version = "1.42.4+10" - -[[Parsers]] -deps = ["Dates"] -git-tree-sha1 = "223a825cccef2228f3fdbf2ecc7ca93363059073" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.16" - -[[Pixman_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6a20a83c1ae86416f0a5de605eaea08a552844a3" -uuid = "30392449-352a-5448-841d-b1acce4e97dc" -version = "0.40.0+0" - -[[Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[Profile]] -deps = ["Printf"] -uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" - -[[QuartzImageIO]] -deps = ["ColorVectorSpace", "FileIO", "ImageCore", "Libdl"] -git-tree-sha1 = "29c1803a9d6d1c7c2130610df5da953c49366976" -uuid = "dca85d43-d64c-5e67-8c65-017450d5d020" -version = "0.7.3" - -[[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[Ratios]] -git-tree-sha1 = "37d210f612d70f3f7d57d488cb3b6eff56ad4e41" -uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" -version = "0.4.0" - -[[Reexport]] -git-tree-sha1 = "57d8440b0c7d98fc4f889e478e80f268d534c9d5" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.0.0" - -[[Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.1.3" - -[[Roots]] -deps = ["Printf"] -git-tree-sha1 = "369e25546984dff5df351bc056fccc30de615080" -uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "1.0.8" - -[[Rsvg]] -deps = ["Cairo", "Glib_jll", "Librsvg_jll"] -git-tree-sha1 = "3d3dc66eb46568fb3a5259034bfc752a0eb0c686" -uuid = "c4c386cf-5103-5370-be45-f3a111cca3b8" -version = "1.0.0" - -[[SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" - -[[Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[SortingAlgorithms]] -deps = ["DataStructures", "Random", "Test"] -git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" -uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "0.3.1" - -[[SparseArrays]] -deps = ["LinearAlgebra", "Random"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - -[[SpecialFunctions]] -deps = ["ChainRulesCore", "OpenSpecFun_jll"] -git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "1.3.0" - -[[StaticArrays]] -deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "9da72ed50e94dbff92036da395275ed114e04d49" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.0.1" - -[[Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] -git-tree-sha1 = "400aa43f7de43aeccc5b2e39a76a79d262202b76" -uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.33.3" - -[[TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" - -[[Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" - -[[Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[TranscodingStreams]] -deps = ["Random", "Test"] -git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" -uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.5" - -[[URIs]] -git-tree-sha1 = "7855809b88d7b16e9b029afd17880930626f54a2" -uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.2.0" - -[[UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[Unitfu]] -deps = ["ConstructionBase", "LinearAlgebra", "Random"] -git-tree-sha1 = "5b07a0ed91dc5b9ca192d4562a6efd4c94470b9c" -uuid = "5ee08b94-2369-4f4a-b8c7-99333ba35fb0" -version = "0.18.0" - -[[WoodburyMatrices]] -deps = ["LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "59e2ad8fd1591ea019a5259bd012d7aee15f995c" -uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" -version = "0.5.3" - -[[XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "afd2b541e8fd425cd3b7aa55932a257035ab4a70" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.9.11+0" - -[[XSLT_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "2b3eac39df218762d2d005702d601cd44c997497" -uuid = "aed1982a-8fda-507f-9586-7b0439959a61" -version = "1.1.33+4" - -[[Xorg_libX11_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] -git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" -uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" -version = "1.6.9+4" - -[[Xorg_libXau_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" -uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" -version = "1.0.9+4" - -[[Xorg_libXdmcp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" -uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" -version = "1.1.3+4" - -[[Xorg_libXext_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" -uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" -version = "1.3.4+4" - -[[Xorg_libXrender_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" -uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" -version = "0.9.10+4" - -[[Xorg_libpthread_stubs_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" -uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" -version = "0.1.0+3" - -[[Xorg_libxcb_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] -git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" -uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" -version = "1.13.0+3" - -[[Xorg_xtrans_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" -uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" -version = "1.4.0+3" - -[[ZipFile]] -deps = ["Libdl", "Printf", "Zlib_jll"] -git-tree-sha1 = "c3a5637e27e914a7a445b8d0ad063d701931e9f7" -uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" -version = "0.9.3" - -[[Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" - -[[Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "2c1332c54931e83f8f94d310fa447fd743e8d600" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.4.8+0" - -[[gdk_pixbuf_jll]] -deps = ["Artifacts", "Glib_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg", "Xorg_libX11_jll", "libpng_jll"] -git-tree-sha1 = "031f60d4362fba8f8778b31047491823f5a73000" -uuid = "da03df04-f53b-5353-a52f-6a8b0620ced0" -version = "2.38.2+9" - -[[libpng_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee" -uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.37+6" - -[[nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" diff --git a/Project.toml b/Project.toml index d951e3b..a3fbfe3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MechanicalSketch" uuid = "183f2c95-4b91-4df3-9bd2-197e8f9edb13" authors = ["hustf and contributors"] -version = "0.4.1" +version = "0.5.0" [deps] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" @@ -18,9 +18,11 @@ LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Luxor = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" +MechGluecode = "3017d99d-ab52-4519-99a2-fa9ddc4637fe" MechanicalUnits = "e6be9192-89dc-11e9-36e6-5dbcb28f419e" NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" +RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/README.md b/README.md index 1e782e7..3a06d89 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,20 @@ There's no intention to make this very general, rather to add functionality as t Sketches should look good and be in a consistent pallette. The test images are in .png format, but .svg is better for zooming. For post-editing figures, not all svg editors handle fonts. 'Inkscape' seems to work well. You might need to install additional fonts for some test images. +# Status +The current release is somewhat forced. Newly introduced functions could simplify the tests / examples, but this has not been fully implemented. + +Also, Luxor has introduced some new functions which are not imported here. + +Some functionality may be covered both here and in 'MechGluecode'. + +We have not picked an interface. Nothing is as of yet exported. + +TODO: +- Drop unnecessary dependencies. +- Use baremodules to export a subset of functions. +- Consider adding terminalmenus for picking functions, at least a way of listing those. + # Installation pkg> registry add github.com/hustf/M8 pgk> add MechanicalSketch diff --git a/examples/pluto_1.jl b/examples/pluto_1.jl index e733b84..8d2a47d 100644 --- a/examples/pluto_1.jl +++ b/examples/pluto_1.jl @@ -55,7 +55,7 @@ l7 = for i in 1:200 # ╔═╡ 53105580-6894-11eb-3af3-3feadd3c43bf begin l1, l2, l3, l4, l5, l6, l7 - this_fig = empty_figure(joinpath(@__DIR__, "pluto_1.png")) + this_fig = empty_figure(filename = joinpath(@__DIR__, "pluto_1.png")) background("green") end diff --git a/src/MechanicalSketch.jl b/src/MechanicalSketch.jl index 18d810c..d2d89be 100644 --- a/src/MechanicalSketch.jl +++ b/src/MechanicalSketch.jl @@ -1,11 +1,12 @@ module MechanicalSketch +# TODO import new Luxor functions from latest revision. import Luxor import Luxor: Drawing,Turtle, Pencolor, Penwidth, Forward, Turn, HueShift, SVGimage, paper_sizes, Tiler, Partition, rescale, -finish, preview, +finish, preview, snapshot, origin, rulers, background, @png, @pdf, @svg, @eps, @draw, @imagematrix, @@ -230,10 +231,29 @@ Initial scale is set with set_scale_sketch() pt height = 70m/s pt height = 20kN """ -function empty_figure(filename = "HiThere.png"; +function empty_figure(;filename = :rec, backgroundcolor = color_with_lumin(PALETTE[8], 10), hue = PALETTE[8], height = missing, width = missing) fig = Drawing(WI, HE, filename) + configure_mechanical(;backgroundcolor, hue, height, width) + fig +end +""" +configure_mechanical(; + backgroundcolor = color_with_lumin(PALETTE[8], 10), + hue = PALETTE[8], height = missing, width = missing) + +Establish a drawing sized for A4 300 dpi figures (WI, HE), +black on white figure, line width 3 pt default. + +Initial scale is set with set_scale_sketch() +pt height = 20m +pt height = 70m/s +pt height = 20kN +""" +function configure_mechanical(; + backgroundcolor = color_with_lumin(PALETTE[8], 10), + hue = PALETTE[8], height = missing, width = missing) # Font for the 'toy' text interface # (use e.g. JuliaMono for unicode symbols like ∈. There are no nice fonts for text AND math. fontface("Calibri") @@ -247,8 +267,9 @@ function empty_figure(filename = "HiThere.png"; setdash("solid") # Origo at centre origin() - # Scale and rotation in pixels - x right, y up ('z' is in.). And rotations may - # clockwise. Just deal with it. Or stick to using dimensions. + # Scale and rotation in pixels - x right, y up ('z' is in.). And rotations + # are clockwise. Just deal with it. Or stick to using quantities. Functions taking + # e.g. angles convert to ccw rotations. setmatrix([1, 0, 0, 1, WI / 2, HE / 2]) @assert !ismissing(width) + !ismissing(height) < 2 "Width or height can be specified here." if ismissing(width) && ismissing(height) @@ -258,16 +279,14 @@ function empty_figure(filename = "HiThere.png"; else set_scale_sketch(width, WI) end - fig -end - +end """ text(t, pt::Point, angle::T; kwargs) where {T <: Angle} For angles with unit, use rotation around z axis. """ text(t, pt::Point, angle::T) where {T <: Angle} = text(t, pt; angle = - ustrip( angle |> rad)) -# TODO collect luxor functions with angle arguments in separate file. + polyrotate!(f, ang::Angle) = polyrotate!(f, - ustrip( ang |> rad)) @@ -295,4 +314,5 @@ include("colorlegends_vector.jl") include("place_image.jl") include("latex.jl") include("chart.jl") +include("macros.jl") end # module diff --git a/src/autodiff_unitfu.jl b/src/autodiff_unitfu.jl index 68307d8..fd39e71 100644 --- a/src/autodiff_unitfu.jl +++ b/src/autodiff_unitfu.jl @@ -167,7 +167,7 @@ end """ ∇(f; physwidth, physheight) - → derivative function based on linear interpolation between pixels. + → derivative function (x, y) based on linear interpolation between pixels. The values of the output function varies linearly between pixels. Take care if differentiating twice! diff --git a/src/labels.jl b/src/labels.jl index 81445b4..0609e7c 100644 --- a/src/labels.jl +++ b/src/labels.jl @@ -1,5 +1,5 @@ """ - box_fill_outline(pt_topleft, colfill; + box_fill_outline(pt_topleft, colfill; height = row_height(), width = EM, luminfac = 2, opacity = missing) @@ -9,7 +9,7 @@ Outline color luminosity is 200% the luminosity of fill color, if possible. For dark backgrounds, consider luminfac = 0.5. By default, opacity is not changed from the current state. Range 0-1, where 1 is opaque. """ -function box_fill_outline(pt_topleft, colfill; +function box_fill_outline(pt_topleft, colfill; height = row_height(), width = EM, luminfac = 2, boxopacity = missing) gsave() !ismissing(boxopacity) && setopacity(boxopacity) @@ -32,7 +32,7 @@ function label_boxed(pt, str; colfill = color_with_lumin(get_current_RGBA(), 0.5 luminfac = 1.0, boxopacity = 0.75, valign = :bottom) @layer begin box_fill_outline(pt, colfill; luminfac, height = -FS / 2, width = pixelwidth(str), boxopacity) - sethue(PALETTE[10]) + #sethue(PALETTE[10]) text(str, pt; valign) end end diff --git a/src/latex.jl b/src/latex.jl index b84d621..b4d912c 100644 --- a/src/latex.jl +++ b/src/latex.jl @@ -44,7 +44,56 @@ function tex2svg_string(formula::LaTeXString; modifylatex = true, modifysvgcolor end +""" + prepare_latexify!(eq::Expr) + +Modify an expression in-place before passing to latexify +""" +function prepare_latexify!(ex::Expr; depth = 0) + if ex.head == :call + if ex.args[1] == :∙ + ex.args[1] = :* + elseif ex.args[1] == :√ + # TODO + #println("Found it") + end + end + for a in ex.args + if isa(a, Expr) + prepare_latexify!(a; depth = depth + 1) + else + end + end + ex +end +""" + show_expression(ex::Expr; depth = 0) + +For debugging, show an expression tree recursively with indents. +""" +function show_expression(ex::Expr; depth = 0) + inde = repeat(" ", depth * 4) + println(inde, ex.head) + for a in ex.args + if isa(a, Expr) + printstyled(inde, "->", "\n"; color= :black) + show_expression(a; depth = depth + 1) + else + if isa(a, Symbol) + if isdefined(Main, a) + printstyled(inde, a, "\n"; color=:green) + else + printstyled(inde, a, "\n"; color=:red) + end + else + println(inde, a) + end + end + end + printstyled(inde, "<-", "\n"; color= :black) + ex +end """ @@ -53,17 +102,19 @@ end Iteratively - get rid of latex outer enclosing dollar and paranthesises. - get rid of latex outer enclosing paranthesises. - - drop ∙ used within units: N∙m => Nm - - drop {\\vysmblkcircle}, which is used within units - fix display of unit superscripts - remove underscore escaping - - reorder √ function to square root - - reorder dot multiplication function - - replace bold font unicode with + - reorder √ function to square root (see @warn) + - replace bold font unicode with latex boldfont - replace square bracket with contents in subscript """ function modify_latex(formula::String)::String st = String(formula) + if occursin("g\\left( t \\cdot", st) + @error "---" + else + #@show "OK" + end if startswith(st, "\$") && endswith(st, "\$") # get rid of latex outer enclosing dollar and paranthesises. modify_latex(st[nextind(st, begin, 1):prevind(st, end, 1)]) @@ -74,9 +125,6 @@ function modify_latex(formula::String)::String #@show st #@show output modify_latex(output) - #elseif occursin('∙', st) - # # drop ∙ used within units: N∙m => Nm - # modify_latex(replace(st, '∙' => "")) elseif occursin("{\\vysmblkcircle}", st) # drop {\\vysmblkcircle} used within units (no space) output = replace(st, "{\\vysmblkcircle}" => "") @@ -119,29 +167,9 @@ function modify_latex(formula::String)::String matched = ma.match replacement = "\\sqrt{" * captured * "} " output = replace(st, matched => replacement; count = 1) - #println("5") - #@show st - #@show output - modify_latex(output) - else - @error "Bad regex" - end - elseif occursin("\\vysmblkcircle\\left( ", st) - # reorder dot multiplication function: - # \\vysmblkcircle\\left(factor1, factor2 \\right) - # => factor1 \\cdot factor2 - # A more solid approach is probably defining: #@latexrecipe ∙ - regex = r"\\vysmblkcircle\\left\( (.*?), (.*?) \\right\)" - ma = match(regex, st) - if !isnothing(ma) - captured1 = ma.captures[1] - captured2 = ma.captures[2] - matched = ma.match - replacement = captured1 * " \\cdot " * captured2 - output = replace(st, matched => replacement; count = 1) - #println("6") - #@show st - #@show output + @warn """This replacement may mess up nested expression. Consider pipelining through prepare_latexify (e.g. @@ev_draw "text" expr)""" + show_colorful_regex(st, ma) + modify_latex(output) else @error "Bad regex" @@ -150,7 +178,6 @@ function modify_latex(formula::String)::String # Replace bold font unicode # \\bfX # => \\\boldsymbol{X} - # A more solid approach is probably defining: #@latexrecipe ∙ regex = r"\\bf([a-zA-Z])" ma = match(regex, st) if !isnothing(ma) @@ -187,7 +214,48 @@ function modify_latex(formula::String)::String end modify_latex(formula::LaTeXString) = modify_latex(String(formula)) +""" + show_colorful_regex(st, ma::RegexMatch) + +For debugging +""" +function show_colorful_regex(st, ma::RegexMatch) + printstyled(st * "\n", color=:green) + + str = repeat('-', ma.offset - 1) + str *= repeat('|', length(ma.match)) + str *= repeat('-', length(st) - length(ma.match) - ma.offset + 1) + printstyled(str * "\n", color=:green) + + if length(ma.captures) > 0 + str = repeat('-', ma.offsets[1] - 1) + str *= repeat('|', length(ma.captures[1])) + printstyled(str * "\n", color=:green) + end + + if length(ma.captures) > 1 + str = repeat('-', ma.offsets[2] - 1) + str *= repeat('|', length(ma.captures[2])) + printstyled(str * "\n", color=:green) + end + + + printstyled(st[1:(ma.offset - 1)], color=:red) + printstyled(ma.match, color=:yellow) + printstyled(st[(ma.offset + length(ma.match)):end] * "\n", color=:red) + if length(ma.captures) > 0 + printstyled(st[1:(ma.offsets[1] - 1)], color=:red) + printstyled(ma.captures[1], color=:yellow) + printstyled(st[(ma.offsets[1] + length(ma.captures[1])):end] * "\n", color=:red) + end + + if length(ma.captures) > 1 + printstyled(st[1:(ma.offsets[2] - 1)], color=:red) + printstyled(ma.captures[2], color=:yellow) + printstyled(st[(ma.offsets[2] + length(ma.captures[2])):end] * "\n", color=:red) + end +end """ modify_svg_color(svgstring::String)::String @@ -212,4 +280,90 @@ function modify_svg_color(svgstring::String)::String styles = sfills * sstrokes news = olds * styles replace(step1, olds => news) +end + +""" + draw_expr(pt, scalefactor, eq::Expr; + abovedisplayskip = 6scalefactor, belowdisplayskip = 6scalefactor, indent = EM) + -> (upper left point, lower right point, scalefactor) + +Iterative, place each line in eq on the image below each other. + +abovedisplayskip is applied before every equation. +belowdisplayskip is applied after every equation. +indent is offset to right +""" +function draw_expr(pt, scalefactor, eq::Expr; + abovedisplayskip = 6scalefactor, belowdisplayskip = 6scalefactor, indent = EM) + ptorg = pt + ptbr = pt + ptul = pt + # Replace dot multiplication by ordinary multiplication, + # and √ with sqrt. + prepare_latexify!(eq) + # Consider replacing the expression walk below with MacroTools postwalk. + # ...if that is clearer. + if eq.head != :block + draw_single_expr(pt, scalefactor, eq; abovedisplayskip, belowdisplayskip, indent) + else + # Multi-line - iterate and display below. + geniter = (a for a in eq.args if typeof(a) != LineNumberNode) + for a in geniter + ptul, ptbr = draw_expr(pt, scalefactor, a) + pt += (0, ptbr.y - ptul.y) + end + ptorg, ptbr + end +end +draw_expr(pt, eq::Expr) = draw_expr(pt, 3.143, eq) + + +""" + draw_single_expr(pt, scalefactor, eq::Expr; + abovedisplayskip = 6scalefactor, belowdisplayskip = 6scalefactor, indent = EM) + -> (upper left point, lower right point) + +Iterative, place each line in eq on the image below each other. + +abovedisplayskip is applied before every equation. +belowdisplayskip is applied after every equation. +indent is offset to right +""" +function draw_single_expr(pt, scalefactor, eq::Expr; + abovedisplayskip = 6scalefactor, belowdisplayskip = 6scalefactor, indent = EM) + @assert eq.head != :block + ptorg = pt + pt+= (0, abovedisplayskip) + l = guard_latexify(eq) + ptul, ptbr = place_image(pt + (indent, 0), l; scalefactor, centered = false) + ptorg, ptbr + (0, belowdisplayskip), scalefactor +end + + +""" + guard_latexify(eq::Expr) + +If a line contains just a defined function call with literal arguments, +show the. For example, string("Just show this comment") can be useful. +""" +function guard_latexify(eq::Expr) + if eq.head == :call + evalit = true + for a in eq.args + if typeof(a) <: Symbol + if !isdefined(@__MODULE__, a) + evalit = false + break + end + end + end + if evalit + latexify(LaTeXString(eval(eq))) + else + latexify(LaTeXString(string(eq))) + end + else + # This would be an assignment. Show it! + latexify(prepare_latexify!(eq)) + end end \ No newline at end of file diff --git a/src/macros.jl b/src/macros.jl new file mode 100644 index 0000000..80e7f19 --- /dev/null +++ b/src/macros.jl @@ -0,0 +1,196 @@ + +""" +@ev_draw msg eq init=false + +1) If optional argument init = true, set default layout parameters (see below) +2) Place the text 'msg' on the current drawing at global variable cpt. +3) Latexify expression(s) eq and place it as an svg below the text +4) Evaluate eq in the calling context +5) Update layout parameter cpt - current point, based on layout parameters. + +Macro for cutting down on boilerplate code. This is not sufficient for +all cases. When this does not produce expected results, +use @macroexpand to see what occurs, and copy / modify that code. + +Also, modifying line spacing (Δcpy) and (scalelatex) and of course +the current point (CP) may increase the +usefulness of this macro. + +Note that 'msg' accepts pango-style html-like markup for text formatting. + +Additional input: locally defined variables +cpt Point Mutating current position, bottom left of displayed first line +Δcpy Float64 Line spacing after text lines, typically 2 (points) +scalelatex = 3.143 + +## Example: +```julia +cpt = O + (-WI / 2 + EM, -HE / 2 + 2EM) +Δcpy = 2 +scalelatex = 3.143 +pt += @ev_draw "Unit stripping function:" :(ul(x) = x / oneunit(x)) +``` +""" +macro ev_draw(msg, eq, init = false) + # Check macro input in this module's context + @assert typeof(eq) <: Expr "Second argument not an expression, at \n\t$__source__" + expr = draw_init(init) + assertions!(expr, __source__) + place_msg!(expr, msg) + place_eqs!(expr, eq) + + # Evaluate the equation / expression / block in the calling context - main scope. + push!(expr.args, esc(quote + eval($eq) + end)) + + # If the current drawing is a recording surface, return a snapshot + push!(expr.args, quote + if currentdrawing().surfacetype == :rec + snapshot() + end + end) + expr +end + +""" + eq_draw(msg, eq, init = false) +Skips the evaluation, otherwise same as @ev_draw +""" +macro eq_draw(msg, eq, init = false) + # Check macro input in this module's context + @assert typeof(eq) <: Expr "Second argument not an expression, at \n\t$__source__" + expr = draw_init(init) + assertions!(expr, __source__) + place_msg!(expr, msg) + place_eqs!(expr, eq) + # If the current drawing is a recording surface, return a snapshot + push!(expr.args, quote + if currentdrawing().surfacetype == :rec + snapshot() + end + end) + expr +end + + + + + + + +""" + draw_init(init) + +Create an expression skeleton for macros `@ev_draw`. +init is an expression which is evaluated in the calling context. +If 'init = true', layout parameters are defined globally +in the calling context: + cpt Current point + Δcpy Verttical spacing + scalelatex + +For better control, define these prior to the first call. +""" +function draw_init(init) + expr = Expr(:block) + push!(expr.args, esc(quote + if eval($init) == true + cpt = O + (-WI / 2 + EM, -HE / 2 + 2EM) + Δcpy = 2 + scalelatex = 3.143 + end + end)) + expr +end + +""" + assertions!(expr, __source__) + +Check that global variables and functions exist in the calling context, for +macro `@ev_draw`. +""" +function assertions!(expr, __source__) + + booleancheck = Expr(:escape, Expr(:isdefined, :cpt)) + assertion = Expr(:(macrocall), Symbol("@assert"), __source__, booleancheck, "Global 'cpt' (current Point) not defined, at \n\t$__source__") + push!(expr.args, assertion) + + booleancheck = Expr(:escape, Expr(:isdefined, :Δcpy)) + assertion = Expr(:(macrocall), Symbol("@assert"), __source__, booleancheck, "Global 'Δcpy' (additional line spacing, a unitless number) not defined, at \n\t$__source__") + push!(expr.args, assertion) + + booleancheck = Expr(:escape, Expr(:isdefined, :scalelatex)) + assertion = Expr(:(macrocall), Symbol("@assert"), __source__, booleancheck, "Global 'scalelatex' (e.g. 3.142, normally based on output from place_img with defined height) not defined, at \n\t$__source__") + push!(expr.args, assertion) + +# booleancheck = Expr(:escape, Expr(:isdefined, :currentdrawing)) +# assertion = Expr(:(macrocall), Symbol("@assert"), __source__, booleancheck, "Global 'currentdrawing()' not defined, at \n\t$__source__") +# push!(expr.args, assertion) + expr +end + +""" + place_msg!(expr, msg) + +Place the text (no latex) on drawing, update layout parameters in the calling context +of macro `@ev_draw`. +""" +function place_msg!(expr, msg) + # Evaluate string(msg) in the calling context to get a string for sure. + push!(expr.args, esc(quote + local st = eval(string($msg)) + end)) + + # Unfortunately, the 'Text API' does not provide easily interpretable feedback on + # how much vertical space 'msg' occupies. We rely on constant EM and line counting. + push!(expr.args, esc(quote + local textlinebreaks = count(c -> c == '\n' || c == '\r', collect(st)) + end)) + + # 'Settext' will displace multi-line output upwards. But 'cpt' keeps track of + # the next line's baseline. So we move 'cpt' down by 'textlinebreaks' * (EM + Δcpy) . + push!(expr.args, esc(quote + local Δy = ($EM + Δcpy) * textlinebreaks + local Δpt = Point(0, Δy) + end)) + push!(expr.args, esc(Expr(:+=, :cpt, :Δpt))) + + # Draw string in the modified position + push!(expr.args, esc(quote + settext(st, cpt, markup = true) + end)) + # Move current point to next base line, as if we were drawing more text. + push!(expr.args, esc(quote + Δy = ($EM + Δcpy) + Δpt = Point(0, Δy) + end)) + push!(expr.args, esc(Expr(:+=, :cpt, :Δpt))) + expr +end + +""" + place_eqs!(expr, eq) + +Draw the equation(s). The reference point here is not baseline of text, +but the upper left corner of the svg image. Compensate for that. +Uupdate layout parameters in the calling context of macro `@ev_draw`. +""" +function place_eqs!(expr, eq) + # Draw the equation(s). The reference point here is not baseline of text, + # but the upper left corner of the svg image. Compensate for that. + push!(expr.args, esc(quote + local ptul, ptbr = draw_expr(cpt + Point(0, -EM), scalelatex, $eq) + # circle(cpt; r = 40mm) # For debugging of layout parameters. + # circle(ptul; r = 50mm) + # circle(ptbr; r = 50mm) + end)) + + # Move to next line. Assume the next line will be text, so add the 'EM' that we skipped before the equation + push!(expr.args, esc(quote + Δy = ptbr.y - ptul.y + Δpt = Point(0, Δy) + end)) + push!(expr.args, esc(Expr(:+=, :cpt, :Δpt))) + expr +end \ No newline at end of file diff --git a/src/matrix_interpolation.jl b/src/matrix_interpolation.jl index 07f3151..957eb2d 100644 --- a/src/matrix_interpolation.jl +++ b/src/matrix_interpolation.jl @@ -76,7 +76,7 @@ Convert the matrix with real-valued elements into a real-valued function. The do is quantities, i.e. two position coordinates. The size of the domain is taken from current sketch scale. The output function is linearly interpolated between pixels, based on the currently defined sketch scale. """ -function matrix_to_function(matrix::Array{Float64,2}) +function matrix_to_function(matrix) # temp ::Array{Float64,2}) # Image processing convention: a column has a horizontal line of pixels ny, nx = size(matrix) # We assume every element correspond to a position, unit of length diff --git a/src/place_image.jl b/src/place_image.jl index 6b16930..4432e4f 100644 --- a/src/place_image.jl +++ b/src/place_image.jl @@ -32,7 +32,7 @@ end centered = false) place_image(pos::Point, data::Luxor.Cairo.CairoSurfaceBase; centered = true, alpha = missing, width = missing, height = missing, scalefactor = missing) - -> (upper left point, lower right point, scalefac) + -> (upper left point, lower right point, scalefactor) Return the upper left, lower right corners, also the calculated scaling factor from original to placed image. diff --git a/test/Manifest.toml b/test/Manifest.toml index b6e2b3a..9fc55d9 100644 --- a/test/Manifest.toml +++ b/test/Manifest.toml @@ -13,9 +13,9 @@ version = "0.3.4" [[Adapt]] deps = ["LinearAlgebra"] -git-tree-sha1 = "ffcfa2d345aaee0ef3d8346a073d5dd03c983ebe" +git-tree-sha1 = "f1b523983a58802c4695851926203b36e28f09db" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.2.0" +version = "3.3.0" [[ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -26,12 +26,6 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[BinaryProvider]] -deps = ["Libdl", "Logging", "SHA"] -git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" -uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -version = "0.5.10" - [[Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e" @@ -55,11 +49,17 @@ git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6" uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" version = "1.16.0+6" +[[ChainRules]] +deps = ["ChainRulesCore", "Compat", "LinearAlgebra", "Random", "Reexport", "Requires", "Statistics"] +git-tree-sha1 = "729a17113c67d941a54169da6a81c5ec890f5834" +uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" +version = "0.7.63" + [[ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3" +git-tree-sha1 = "bd0cc939d94b8bd736dce5bbbe0d635db9f94af7" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.29" +version = "0.9.41" [[CodeTracking]] deps = ["InteractiveUtils", "UUIDs"] @@ -69,33 +69,33 @@ version = "1.0.5" [[ColorSchemes]] deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"] -git-tree-sha1 = "3141757b5832ee7a0386db87997ee5a23ff20f4d" +git-tree-sha1 = "c8fd01e4b736013bc61b704871d20503b33ea402" uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" -version = "3.10.2" +version = "3.12.1" [[ColorTypes]] deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "5e9769a17f17b587c951d57ba4319782b40c3513" +git-tree-sha1 = "32a2b8af383f11cbb65803883837a149d10dfe8a" uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.10.10" +version = "0.10.12" [[ColorVectorSpace]] -deps = ["ColorTypes", "Colors", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "StatsBase"] -git-tree-sha1 = "4d17724e99f357bfd32afa0a9e2dda2af31a9aea" +deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"] +git-tree-sha1 = "ae479dfe260efc16034e68d62e98d013527fdc32" uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" -version = "0.8.7" +version = "0.9.4" [[Colors]] -deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] -git-tree-sha1 = "ac5f2213e56ed8a34a3dd2f681f4df1166b34929" +deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] +git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40" uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" -version = "0.12.6" +version = "0.12.8" [[Compat]] deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b" +git-tree-sha1 = "0a817fbe51c976de090aa8c997b7b719b786118d" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.25.0" +version = "3.28.0" [[CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -149,9 +149,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" +git-tree-sha1 = "9d4f64f79012636741cf01133158a54b24924c32" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.3" +version = "0.8.4" [[Documenter]] deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] @@ -161,9 +161,9 @@ version = "0.26.3" [[DocumenterTools]] deps = ["Base64", "DocStringExtensions", "Documenter", "FileWatching", "LibGit2", "Sass"] -git-tree-sha1 = "9b40fd93f54ba5ef9d364981124a8ed389fd634e" +git-tree-sha1 = "fd313c343451ff8f88ff711662ea13f9629b9a58" uuid = "35a29f4d-8980-5a13-9543-d66fff28ecb8" -version = "0.1.9" +version = "0.1.10" [[Downloads]] deps = ["ArgTools", "LibCURL", "NetworkOptions"] @@ -205,10 +205,10 @@ uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" version = "4.3.1+4" [[FFTW]] -deps = ["AbstractFFTs", "FFTW_jll", "IntelOpenMP_jll", "Libdl", "LinearAlgebra", "MKL_jll", "Reexport"] -git-tree-sha1 = "1b48dbde42f307e48685fa9213d8b9f8c0d87594" +deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] +git-tree-sha1 = "746f68839306977040653ebbd249e39c15420b8a" uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" -version = "1.3.2" +version = "1.4.1" [[FFTW_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -218,9 +218,9 @@ version = "3.3.9+7" [[FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "8800ec70aee7292931a3d3c10a3be3445b9c6141" +git-tree-sha1 = "d74fd0dae131104471c849f25ba1179fe0fadf47" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.6.2" +version = "1.8.2" [[FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" @@ -269,27 +269,27 @@ version = "1.0.5+6" [[GLFW_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] -git-tree-sha1 = "a1bbf700b5388bffc3d882f4f4d625cf1c714fd7" +git-tree-sha1 = "a199aefead29c3c2638c3571a9993b564109d45a" uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" -version = "3.3.2+1" +version = "3.3.4+0" [[GR]] -deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] -git-tree-sha1 = "12d971c928b7ecf19b748a2c7df6a365690dbf2c" +deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "011458b83178ac913dc4eb73b229af45bdde5d83" uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.55.0" +version = "0.57.4" [[GR_jll]] -deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "8aee6fa096b0cbdb05e71750c978b96a08c78951" +deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qt5Base_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "90acee5c38f4933342fa9a3bbc483119d20e7033" uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.53.0+0" +version = "0.57.2+0" [[GeometryBasics]] deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] -git-tree-sha1 = "82853ebc70db4f5a3084853738c68fd497b22c7c" +git-tree-sha1 = "4136b8a5668341e58398bb472754bff4ba0456ff" uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" -version = "0.3.10" +version = "0.3.12" [[Gettext_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] @@ -316,15 +316,15 @@ uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" version = "1.3.13+4" [[Grisu]] -git-tree-sha1 = "03d381f65183cb2d0af8b3425fde97263ce9a995" +git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" -version = "1.0.0" +version = "1.0.2" [[HTTP]] deps = ["Base64", "Dates", "IniFile", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] -git-tree-sha1 = "c9f380c76d8aaa1fa7ea9cf97bddbc0d5b15adc2" +git-tree-sha1 = "b855bf8247d6e946c75bb30f593bfe7fe591058d" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.5" +version = "0.9.8" [[HarfBuzz_jll]] deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Gettext_jll", "Glib_jll", "Graphite2_jll", "ICU_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] @@ -345,22 +345,22 @@ uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" version = "0.1.1" [[ImageCore]] -deps = ["AbstractFFTs", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] -git-tree-sha1 = "79badd979fbee9b8980cd995cd5a86a9e93b8ad7" +deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] +git-tree-sha1 = "8aa4a5c9b0b0a0fea9cac59549222078e375b867" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" -version = "0.8.20" +version = "0.9.0" [[ImageIO]] deps = ["FileIO", "Netpbm", "PNGFiles", "TiffImages", "UUIDs"] -git-tree-sha1 = "015adb094b2d81167821df8a24c180a8eee22f2c" +git-tree-sha1 = "d444375fd1e45153fe339c259da8bf98eb5130d6" uuid = "82e4d734-157c-48bb-816b-45c225c6df19" -version = "0.5.3" +version = "0.5.4" [[ImageMagick]] deps = ["FileIO", "ImageCore", "ImageMagick_jll", "InteractiveUtils", "Libdl", "Pkg", "Random"] -git-tree-sha1 = "f35fb0080591e6f271b7e1cf4c8323a4a78d5150" +git-tree-sha1 = "5bc1cb62e0c5f1005868358db0692c994c3a13c6" uuid = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" -version = "1.1.7" +version = "1.2.1" [[ImageMagick_jll]] deps = ["JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pkg", "Zlib_jll", "libpng_jll"] @@ -406,9 +406,10 @@ uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[JLLWrappers]] -git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0" +deps = ["Preferences"] +git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.2.0" +version = "1.3.0" [[JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -424,9 +425,9 @@ version = "2.0.1+3" [[JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "86439cef50a24fa981583476f48b197b7dea691e" +git-tree-sha1 = "cd4f9bfbe8547b98a75cad63d5834d734dfa6e63" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.8.9" +version = "0.8.15" [[Juno]] deps = ["Base64", "Logging", "Media", "Profile"] @@ -453,9 +454,9 @@ version = "1.2.1" [[Latexify]] deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] -git-tree-sha1 = "537df0b32bc0a99620872cc6d06278e454da4533" +git-tree-sha1 = "f77a16cb3804f4a74f57e5272a6a4a9a628577cb" uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" -version = "0.14.10" +version = "0.15.5" [[LazyArtifacts]] deps = ["Artifacts", "Pkg"] @@ -561,15 +562,15 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[LoweredCodeUtils]] deps = ["JuliaInterpreter"] -git-tree-sha1 = "8c96709706ce27471655247ad9a931447d16dd62" +git-tree-sha1 = "9e3377afc44de61ae2abeaee4fa3a971f9a5c0bc" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "1.2.9" +version = "2.0.0" [[Luxor]] deps = ["Base64", "Cairo", "Colors", "Dates", "FileIO", "ImageMagick", "Juno", "QuartzImageIO", "Random", "Rsvg"] -git-tree-sha1 = "8796dfbdde81ec4a811a2d972a6d5f8a7c4113d0" +git-tree-sha1 = "6a56a893e2f048fa4d28bb69c5263f185bd0fe13" uuid = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" -version = "2.10.0" +version = "2.11.0" [[MKL_jll]] deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] @@ -584,10 +585,9 @@ uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" version = "0.5.6" [[MappedArrays]] -deps = ["FixedPointNumbers"] -git-tree-sha1 = "b92bd220c95a8bbe89af28f11201fd080e0e3fe7" +git-tree-sha1 = "18d3584eebc861e311a552cbb67723af8edff5de" uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" -version = "0.3.0" +version = "0.4.0" [[Markdown]] deps = ["Base64"] @@ -616,9 +616,9 @@ version = "0.5.0" [[Missings]] deps = ["DataAPI"] -git-tree-sha1 = "f8c673ccc215eb50fcadb285f522420e29e69e1c" +git-tree-sha1 = "4ea90bd5d3985ae1f9a908bd4500ae88921c5ce7" uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "0.4.5" +version = "1.0.0" [[Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" @@ -630,10 +630,10 @@ uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" version = "0.7.1" [[MosaicViews]] -deps = ["MappedArrays", "OffsetArrays", "PaddedViews"] -git-tree-sha1 = "614e8d77264d20c1db83661daadfab38e8e4b77e" +deps = ["MappedArrays", "OffsetArrays", "PaddedViews", "StackViews"] +git-tree-sha1 = "b34e3bc3ca7c94914418637cb10cc4d1d80d877d" uuid = "e94cdb99-869f-56ef-bcf0-1ae2bcbe0389" -version = "0.2.4" +version = "0.3.3" [[MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" @@ -644,19 +644,19 @@ uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" version = "0.3.5" [[Netpbm]] -deps = ["ColorVectorSpace", "FileIO", "ImageCore"] -git-tree-sha1 = "03472ec5ea8884b791c6340712f3261c0f393691" +deps = ["FileIO", "ImageCore"] +git-tree-sha1 = "18efc06f6ec36a8b801b23f076e3c6ac7c3bf153" uuid = "f09324ee-3d7c-5217-9330-fc30815ba969" -version = "1.0.0" +version = "1.0.2" [[NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "b3dfef5f2be7d7eb0e782ba9146a5271ee426e90" +git-tree-sha1 = "87a728aebb76220bd72855e1c85284c5fdb9774c" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.6.2" +version = "1.7.0" [[Ogg_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -672,9 +672,9 @@ version = "1.1.1+6" [[OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" +git-tree-sha1 = "b9b8b8ed236998f91143938a760c2112dceeb2b4" uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.3+4" +version = "0.5.4+0" [[Opus_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -695,9 +695,9 @@ version = "8.42.0+4" [[PNGFiles]] deps = ["Base64", "CEnum", "ImageCore", "IndirectArrays", "OffsetArrays", "libpng_jll"] -git-tree-sha1 = "28f9667d6ca9168b7198a481847f0879e6c72ef1" +git-tree-sha1 = "520e28d4026d16dcf7b8c8140a3041f0e20a9ca8" uuid = "f57f5aa1-a3ce-4bc8-8ab9-96f992907883" -version = "0.3.6" +version = "0.3.7" [[PaddedViews]] deps = ["OffsetArrays"] @@ -713,9 +713,9 @@ version = "1.42.4+10" [[Parsers]] deps = ["Dates"] -git-tree-sha1 = "223a825cccef2228f3fdbf2ecc7ca93363059073" +git-tree-sha1 = "c8abc88faa3f7a3950832ac5d6e690881590d6dc" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.16" +version = "1.1.0" [[Pixman_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -724,7 +724,7 @@ uuid = "30392449-352a-5448-841d-b1acce4e97dc" version = "0.40.0+0" [[Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs"] +deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[PkgVersion]] @@ -747,15 +747,21 @@ version = "1.0.10" [[Plots]] deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"] -git-tree-sha1 = "142dd04f5060c04de91cc10ca76dffb291a02426" +git-tree-sha1 = "eced322de627fa8469c55f24899fdd4cce7d978c" uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.10.6" +version = "1.13.2" [[Polynomials]] deps = ["Intervals", "LinearAlgebra", "OffsetArrays", "RecipesBase"] -git-tree-sha1 = "1c6c5b0c3713738d6b987903c529d80622c37e07" +git-tree-sha1 = "0b15f3597b01eb76764dd03c3c23d6679a3c32c8" uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" -version = "1.2.0" +version = "1.2.1" + +[[Preferences]] +deps = ["TOML"] +git-tree-sha1 = "ea79e4c9077208cd3bc5d29631a26bc0cff78902" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.2.1" [[Primes]] git-tree-sha1 = "afccf037da52fa596223e5a0e331ff752e0e845c" @@ -772,21 +778,21 @@ uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" [[ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "6e9c89cba09f6ef134b00e10625590746ba1e036" +git-tree-sha1 = "bb4a35eafac4e485335702fb5cea39389dc1a782" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.5.0" +version = "1.6.1" -[[Qt_jll]] +[[Qt5Base_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] -git-tree-sha1 = "7760cfea90bec61814e31dfb204fa4b81bba7b57" -uuid = "ede63266-ebff-546c-83e0-1c6fb6d0efc8" -version = "5.15.2+1" +git-tree-sha1 = "16626cfabbf7206d60d84f2bf4725af7b37d4a77" +uuid = "ea2cea3b-5b76-57ae-a6ef-0a8af62496e1" +version = "5.15.2+0" [[QuartzImageIO]] -deps = ["ColorVectorSpace", "FileIO", "ImageCore", "Libdl"] -git-tree-sha1 = "29c1803a9d6d1c7c2130610df5da953c49366976" +deps = ["FileIO", "ImageCore", "Libdl"] +git-tree-sha1 = "16de3b880ffdfbc8fc6707383c00a2e076bb0221" uuid = "dca85d43-d64c-5e67-8c65-017450d5d020" -version = "0.7.3" +version = "0.7.4" [[REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] @@ -803,9 +809,9 @@ version = "1.1.1" [[RecipesPipeline]] deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"] -git-tree-sha1 = "c4d54a78e287de7ec73bbc928ce5eb3c60f80b24" +git-tree-sha1 = "7a5026a6741c14147d1cb6daf2528a77ca28eb51" uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" -version = "0.3.1" +version = "0.3.2" [[Reexport]] git-tree-sha1 = "57d8440b0c7d98fc4f889e478e80f268d534c9d5" @@ -820,9 +826,9 @@ version = "1.1.3" [[Revise]] deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"] -git-tree-sha1 = "b72fa706920b1421d581525de9f4e442b95ba254" +git-tree-sha1 = "f8bc496aae6ff4b506e9fca0f8127900aac833a3" uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" -version = "3.1.14" +version = "3.1.15" [[Rsvg]] deps = ["Cairo", "Glib_jll", "Librsvg_jll"] @@ -834,10 +840,10 @@ version = "1.0.0" uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" [[Sass]] -deps = ["BinaryProvider", "Libdl", "Test"] -git-tree-sha1 = "de11179555c6363c5a61c4c94376db3498983734" +deps = ["libsass_jll"] +git-tree-sha1 = "aa841c3738cec78b5dbccd56dda332710f35f6a5" uuid = "322a6be2-4ae8-5d68-aaf1-3e960788d1d9" -version = "0.1.0" +version = "0.2.0" [[Scratch]] deps = ["Dates"] @@ -854,9 +860,9 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" [[Showoff]] deps = ["Dates", "Grisu"] -git-tree-sha1 = "ee010d8f103468309b8afac4abb9be2e18ff1182" +git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de" uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" -version = "0.3.2" +version = "1.0.3" [[SnoopCompile]] deps = ["Cthulhu", "FlameGraphs", "InteractiveUtils", "OrderedCollections", "Pkg", "Printf", "Profile", "Requires", "Serialization", "SnoopCompileCore", "YAML"] @@ -874,10 +880,10 @@ version = "2.5.2" uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[SortingAlgorithms]] -deps = ["DataStructures", "Random", "Test"] -git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" +deps = ["DataStructures"] +git-tree-sha1 = "2ec1962eba973f383239da22e75218565c390a96" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "0.3.1" +version = "1.0.0" [[SparseArrays]] deps = ["LinearAlgebra", "Random"] @@ -889,27 +895,38 @@ git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" version = "1.3.0" +[[StackViews]] +deps = ["OffsetArrays"] +git-tree-sha1 = "46e589465204cd0c08b4bd97385e4fa79a0c770c" +uuid = "cae243ae-269e-4f55-b966-ac2d0dc13c15" +version = "0.1.1" + [[StaticArrays]] deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "9da72ed50e94dbff92036da395275ed114e04d49" +git-tree-sha1 = "2653e9c769343808781a8bd5010ee7a17c01152e" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.0.1" +version = "1.1.2" [[Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +[[StatsAPI]] +git-tree-sha1 = "1958272568dc176a1d881acb797beb909c785510" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.0.0" + [[StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] -git-tree-sha1 = "400aa43f7de43aeccc5b2e39a76a79d262202b76" +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "2f6792d523d7448bbe2fec99eca9218f06cc746d" uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.33.3" +version = "0.33.8" [[StructArrays]] deps = ["Adapt", "DataAPI", "Tables"] -git-tree-sha1 = "26ea43b4be7e919a2390c3c0f824e7eb4fc19a0a" +git-tree-sha1 = "44b3afd37b17422a62aea25f04c1f7e09ce6b07f" uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" -version = "0.5.0" +version = "0.5.1" [[TOML]] deps = ["Dates"] @@ -917,40 +934,46 @@ uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" [[TableTraits]] deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.0" +version = "1.0.1" [[Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] -git-tree-sha1 = "a716dde43d57fa537a19058d044b495301ba6565" +git-tree-sha1 = "c9d2d262e9a327be1f35844df25fe4561d258dc9" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.3.2" +version = "1.4.2" [[Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +[[TensorCore]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1feb45f88d133a655e001435632f019a9a1bcdb6" +uuid = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50" +version = "0.1.1" + [[Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[TiffImages]] deps = ["ColorTypes", "DocStringExtensions", "FileIO", "FixedPointNumbers", "IndirectArrays", "OffsetArrays", "OrderedCollections", "PkgVersion", "ProgressMeter"] -git-tree-sha1 = "94d7c4d760d552a90a98a7150c4a32c7be25e4ee" +git-tree-sha1 = "af30d22cc2cdda1848821135bfb04ebd657005a2" uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69" -version = "0.3.0" +version = "0.3.2" [[TimeZones]] deps = ["Dates", "EzXML", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"] -git-tree-sha1 = "4ba8a9579a243400db412b50300cd61d7447e583" +git-tree-sha1 = "3f6f0be07f33e33bd986a58b4cf2d6c9fd2b7f18" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.5.3" +version = "1.5.4" [[URIs]] -git-tree-sha1 = "7855809b88d7b16e9b029afd17880930626f54a2" +git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.2.0" +version = "1.3.0" [[UUIDs]] deps = ["Random", "SHA"] @@ -1155,6 +1178,12 @@ git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee" uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" version = "1.6.37+6" +[[libsass_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "663428b7ebaf60c60ee147f0f9466430e9959ad6" +uuid = "47bcb7c8-5119-555a-9eeb-0afcc36cd728" +version = "3.5.5+0" + [[libvorbis_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] git-tree-sha1 = "fa14ac25af7a4b8a7f61b287a124df7aab601bcd" @@ -1165,6 +1194,10 @@ version = "1.3.6+6" deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +[[p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" + [[x264_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f" diff --git a/test/Project.toml b/test/Project.toml index 7133c8b..3898967 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2" DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8" diff --git a/test/test_1.jl b/test/test_1.jl index ca325c0..02f1685 100644 --- a/test/test_1.jl +++ b/test/test_1.jl @@ -3,16 +3,16 @@ import MechanicalSketch: foil_spline_local import MechanicalSketch: text, circle, Turtle, Pencolor, Penwidth, Forward, Turn import MechanicalSketch: HueShift, O, sethue, finish, EM, WI, background, empty_figure let - empty_figure(joinpath(@__DIR__, "test_1.png")); + empty_figure(filename = joinpath(@__DIR__, "test_1.png")); background("midnightblue") posx = -WI / 2 sethue("green") - # The unicode ∈ may not be supported by the default font and show as a square instead. + # The unicode ∈ may not be supported by the default font and show as a square instead. stri = "Da jeg var på vei til kirken ∈ dag morges så kom jeg forbi en liten sjømann. En frisk og hyggelig liten sjømann som hilste meg." text(stri, posx, 0) sethue("yellow") - + text("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", posx, EM) circle(O, 20, :stroke) diff --git a/test/test_10.jl b/test/test_10.jl index 41bb146..f148e4c 100644 --- a/test/test_10.jl +++ b/test/test_10.jl @@ -8,7 +8,7 @@ import MechanicalSketch: setline, PALETTE, color_from_palette let BACKCOLOR = color_with_lumin(PALETTE[2], 70); function restart() - empty_figure(joinpath(@__DIR__, "test_10.png")) + empty_figure(filename = joinpath(@__DIR__, "test_10.png")) background(BACKCOLOR) sethue(PALETTE[2]) end diff --git a/test/test_11.jl b/test/test_11.jl index 80619ae..c863829 100644 --- a/test/test_11.jl +++ b/test/test_11.jl @@ -8,7 +8,7 @@ using Ipopt # Nonlinear solver let BACKCOLOR = color_with_lumin(PALETTE[1], 80) function restart() - empty_figure(joinpath(@__DIR__, "test_11.png")) + empty_figure(filename = joinpath(@__DIR__, "test_11.png")) background(BACKCOLOR) sethue(PALETTE[1]) end @@ -85,7 +85,7 @@ innerst = modify_latex(inner) l = L"\text{Minimize: }\sum_{n=2}^{%$NP} %$innerst"; _, _, scalefactor = place_image(p, l, height = 2EM) -l2 = latexify(quote +l2 = latexify(quote (x[j] - x[j-1])^2 + (y[j] - y[j-1])^2 <= h^2 end); l3 = "\\textrm{;where }" * modify_latex(l2) diff --git a/test/test_12.jl b/test/test_12.jl index 08465d6..9907527 100644 --- a/test/test_12.jl +++ b/test/test_12.jl @@ -10,7 +10,7 @@ import MechanicalSketch: rope_pos_tension, setline, PALETTE let BACKCOLOR = color_with_lumin(PALETTE[8], 85); function restart() - empty_figure(joinpath(@__DIR__, "test_12.png")) + empty_figure(filename = joinpath(@__DIR__, "test_12.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_13.jl b/test/test_13.jl index 59da914..2ba89a7 100644 --- a/test/test_13.jl +++ b/test/test_13.jl @@ -10,7 +10,7 @@ import MechanicalSketch: rope_pos_tension, setline, kW let BACKCOLOR = PALETTE[8]; function restart() - empty_figure(joinpath(@__DIR__, "test_13.png")) + empty_figure(filename = joinpath(@__DIR__, "test_13.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_14.jl b/test/test_14.jl index 765df76..4a174ec 100644 --- a/test/test_14.jl +++ b/test/test_14.jl @@ -3,7 +3,7 @@ import MechanicalSketch: sethue, background, O, EM, HE, m, color_with_lumin, fin import MechanicalSketch: dimension_aligned, empty_figure, PALETTE let -empty_figure(joinpath(@__DIR__, "test_14.png")) +empty_figure(filename = joinpath(@__DIR__, "test_14.png")) background(color_with_lumin(PALETTE[6], 90)) sethue(PALETTE[4]) diff --git a/test/test_15.jl b/test/test_15.jl index 173534c..9a6fbf5 100644 --- a/test/test_15.jl +++ b/test/test_15.jl @@ -3,7 +3,7 @@ import MechanicalSketch: sethue, background, O, HE, m, s, color_with_lumin import MechanicalSketch: finish, set_scale_sketch, arrow, °, empty_figure import MechanicalSketch: PALETTE let -empty_figure(joinpath(@__DIR__, "test_15.png")) +empty_figure(filename = joinpath(@__DIR__, "test_15.png")) background(color_with_lumin(PALETTE[6], 80)) sethue(PALETTE[4]) diff --git a/test/test_16.jl b/test/test_16.jl index 0a258d0..9400865 100644 --- a/test/test_16.jl +++ b/test/test_16.jl @@ -4,7 +4,7 @@ import MechanicalSketch: finish, set_scale_sketch, arrow, °, m, kN, empty_figur import MechanicalSketch: PALETTE let -empty_figure(joinpath(@__DIR__, "test_16.png")) +empty_figure(filename = joinpath(@__DIR__, "test_16.png")) background(color_with_lumin(PALETTE[6], 80)) sethue(PALETTE[4]) diff --git a/test/test_17.jl b/test/test_17.jl index 5b178b8..4012bc9 100644 --- a/test/test_17.jl +++ b/test/test_17.jl @@ -18,7 +18,7 @@ ROPE_MINIMUM_BREAK = [161.90, 215.80, 269.80, 343.30, 407.10, 490.50, 569, 647.4 BACKCOLOR = color_with_lumin(PALETTE[8], 90); function restart() - empty_figure(joinpath(@__DIR__, "test_17.png")) + empty_figure(filename = joinpath(@__DIR__, "test_17.png")) background(BACKCOLOR) sethue(PALETTE[5]) set_scale_sketch(sum(ROPE_D) * 1.3, HE) @@ -49,13 +49,13 @@ circlearea(d) = π / 4 * d^2 circleradius(A) = sqrt(A/π) # Plot packed area let - A_rope = ROPE_WEIGHT ./ ρ_SK75 |> mm^2 + A_rope = ROPE_WEIGHT ./ ρ_SK75 .|> mm^2 sethue(color_with_lumin(PALETTE[5], 80)) circle.(pts , circleradius.(A_rope),:fill) end "Relative filled areas, actual to full circle" -area_rel = (ROPE_WEIGHT ./ ρ_SK75 |> mm^2) ./ circlearea.(ROPE_D) +area_rel = (ROPE_WEIGHT ./ ρ_SK75 .|> mm^2) ./ circlearea.(ROPE_D) # Plot relative filled areas setline(3PT) bottoms = map(pt -> pt + (0.0mm, -600.0mm), pts) diff --git a/test/test_18.jl b/test/test_18.jl index ddbdc92..1f12d27 100644 --- a/test/test_18.jl +++ b/test/test_18.jl @@ -5,14 +5,14 @@ import MechanicalSketch: text_table, area_filled, set_scale_sketch, circle, °, let BACKCOLOR = color_with_lumin(PALETTE[8], 80); function restart() - empty_figure(joinpath(@__DIR__, "test_18.png")) + empty_figure(filename = joinpath(@__DIR__, "test_18.png")) background(BACKCOLOR) sethue(PALETTE[1]) end restart() diameters = [6mm, 8mm, 10mm, 12mm] mbls = rope_breaking_strength.(diameters) -weights = rope_weight.(diameters) |> kg/km +weights = rope_weight.(diameters) .|> kg/km circleradius(A) = sqrt(A/π) radius_filled = circleradius.(area_filled.(diameters)) diff --git a/test/test_19.jl b/test/test_19.jl index e7b29f2..db0e71b 100644 --- a/test/test_19.jl +++ b/test/test_19.jl @@ -7,7 +7,7 @@ import MechanicalSketch: box, clipreset, readpng, placeimage, setopacity #let BACKCOLOR = color_with_lumin(PALETTE[8], 80); function restart() - empty_figure(joinpath(@__DIR__, "test_19.png")) + empty_figure(filename = joinpath(@__DIR__, "test_19.png")) background(BACKCOLOR) sethue(PALETTE[1]) end diff --git a/test/test_2.jl b/test/test_2.jl index c63265a..d933e16 100644 --- a/test/test_2.jl +++ b/test/test_2.jl @@ -5,7 +5,7 @@ import MechanicalSketch: get, getinverse, textextents, Point, rect, label, let -this_fig = empty_figure(joinpath(@__DIR__, "test_2.png")) +this_fig = empty_figure(filename = joinpath(@__DIR__, "test_2.png")) midcol = MechanicalSketch.HSL(get(PALETTE, 0.5)) bckcol = MechanicalSketch.RGB(MechanicalSketch.HSL(midcol.h, midcol.s, midcol.l * 0.5)) background(bckcol) diff --git a/test/test_20.jl b/test/test_20.jl index a0ebaec..db2cda7 100644 --- a/test/test_20.jl +++ b/test/test_20.jl @@ -12,14 +12,12 @@ using Test let if !@isdefined s⁻¹ - @import_expand m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(m,s,°) end BACKCOLOR = color_with_lumin(PALETTE[8], 80) function restart() - empty_figure(joinpath(@__DIR__, "test_20.png")) + empty_figure(filename = joinpath(@__DIR__, "test_20.png")) background(BACKCOLOR) sethue(PALETTE[5]) end @@ -69,7 +67,7 @@ legend3.(bibo) # Since we have values on both sides of zero, create a legend including zero. binwidth = 0.1m²∙s⁻¹ binbounds = Tuple((-5:5)binwidth) -# Distinguishing between positive and negative is often important. We +# Distinguishing between positive and negative is often important. We # truncate a colorscheme to make our own. cv(x) = get(PuOr_8, x, :clamp) nomiddle = [[cv(x) for x in range(0, 0.3, length = 10)]; diff --git a/test/test_21.jl b/test/test_21.jl index efb0560..8ee369d 100644 --- a/test/test_21.jl +++ b/test/test_21.jl @@ -7,14 +7,13 @@ import MechanicalSketch: BinLegend, draw_legend, latexify, @layer, fontsize let if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end BACKCOLOR = color_with_lumin(PALETTE[8], 80) function restart() - empty_figure(joinpath(@__DIR__, "test_21.png")) + empty_figure(filename = joinpath(@__DIR__, "test_21.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_22.jl b/test/test_22.jl index db499f4..58e8647 100644 --- a/test/test_22.jl +++ b/test/test_22.jl @@ -8,15 +8,13 @@ import MechanicalSketch: color_with_lumin import MechanicalSketch.Luxor.ColorTypes: LCHuvA, LCHabA, HSVA, HSLA, LCHabA, RGBA let if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(m, s, °) end BACKCOLOR = color_with_lumin(PALETTE[8], 70) function restart() - empty_figure(joinpath(@__DIR__, "test_22.png")) + empty_figure(filename = joinpath(@__DIR__, "test_22.png")) background(BACKCOLOR) sethue(color_with_lumin(PALETTE[6], 10)) end @@ -30,7 +28,7 @@ physwidth = 2.2m physheight = physwidth totheight = 2.1 * physheight set_scale_sketch(totheight, HE) -centers = totheight / 4 * Point.([(-1.2, 1), (1.2, 1), +centers = totheight / 4 * Point.([(-1.2, 1), (1.2, 1), (-1.2, -1), (0,0) ,(1.2, -1)]) xs, ys = x_y_iterators_at_pixels(;physwidth, physheight) diff --git a/test/test_23.jl b/test/test_23.jl index cf00572..020bd15 100644 --- a/test/test_23.jl +++ b/test/test_23.jl @@ -10,7 +10,7 @@ import MechanicalSketch: ∙, ∇_rectangle, x_y_iterators_at_pixels let BACKCOLOR = color_with_lumin(PALETTE[8], 10) function restart() - empty_figure(joinpath(@__DIR__, "test_23.png")) + empty_figure(filename = joinpath(@__DIR__, "test_23.png")) background(BACKCOLOR) sethue(PALETTE[8]) end @@ -18,8 +18,7 @@ restart() if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end "Source position" @@ -85,7 +84,7 @@ OB = O + (-EM, + 0.25HE + 0.5EM ) mi, ma = lenient_min_max(B) botlegend = BinLegendVector(;operand_example = first(B), max_magn_legend = ma, noof_magn_bins = 30, noof_ang_bins = 36, - name = :Velocity) + name = :Velocity) colormat = botlegend.(B) ulp, lrp = place_image(OB, colormat) legendpos = lrp + (EM, 0) + (0.0m, physheight) diff --git a/test/test_25.png b/test/test_25.png index fd2d3f5..c8546a4 100644 Binary files a/test/test_25.png and b/test/test_25.png differ diff --git a/test/test_26.jl b/test/test_26.jl index c0e02a4..1e8b655 100644 --- a/test/test_26.jl +++ b/test/test_26.jl @@ -10,7 +10,7 @@ import MechanicalSketch: ∙, ∇_rectangle, SVector, draw_streamlines import Interpolations: interpolate, Gridded, Linear, Flat, extrapolate import MechanicalSketch: Greys_9 let -empty_figure(joinpath(@__DIR__, "test_26.png")); +empty_figure(filename = joinpath(@__DIR__, "test_26.png")); include("test_functions_24.jl") include("test_functions_26.jl") # Reuse the flow field from test_23.jl, a matrix of complex velocities with an element per pixel. @@ -36,7 +36,7 @@ global const OU_26 = O + (0.0, -0.25HE + EM) NO_2 = noisepic_2(A, PHYSWIDTH_23, PHYSHEIGHT_23) # Show the noise image at the top figure -legend = BinLegend(;maxlegend = 1.0, noofbins = 128, +legend = BinLegend(;maxlegend = 1.0, noofbins = 128, colorscheme = reverse(Greys_9), name = Symbol("Value{Float64}")) upleftpoint, lowrightpoint = place_image(OU_26, legend.(NO_2)) draw_legend(lowrightpoint + (EM, 0) + (0.0m, PHYSHEIGHT_23), legend) diff --git a/test/test_26.png b/test/test_26.png index c82610e..acbe3b7 100644 Binary files a/test/test_26.png and b/test/test_26.png differ diff --git a/test/test_27.jl b/test/test_27.jl index dc277a5..1188025 100644 --- a/test/test_27.jl +++ b/test/test_27.jl @@ -10,11 +10,10 @@ import Interpolations: interpolate, Gridded, Linear, Flat, extrapolate import MechanicalSketch: Greys_9, BinLegend, circle let -empty_figure(joinpath(@__DIR__, "test_27.png")); +empty_figure(filename = joinpath(@__DIR__, "test_27.png")); if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end include("test_functions_24.jl") @@ -45,7 +44,7 @@ fxy = extrapolate(fxy_inter, Flat()); global const OU_27 = O + (0.0, -0.25HE + EM) global const NO_3 = noisepic_3(A, physheight, physwidth) -legend = BinLegend(;maxlegend = 1.0, noofbins = 128, +legend = BinLegend(;maxlegend = 1.0, noofbins = 128, colorscheme = reverse(Greys_9), name = Symbol("Value{Float64}")) upleftpoint, lowrightpoint = place_image(OU_27, legend.(NO_3)) draw_legend(lowrightpoint + (EM, 0) + (0.0m, PHYSHEIGHT_23), legend) @@ -70,7 +69,7 @@ h = DU_2 / (NS_3 -1 ) # 57.021068 seconds (62.33 M allocations: 2.247 GiB, 0.59% gc time) # 59.596110 seconds (59.04 M allocations: 2.002 GiB, 0.58% gc time) -botlegend = BinLegend(;maxlegend = maximum(M), noofbins = 128, +botlegend = BinLegend(;maxlegend = maximum(M), noofbins = 128, colorscheme = reverse(Greys_9), name = Symbol("Value{Float64}")) upleftpoint, lowrightpoint = place_image(OB, botlegend.(M) ) draw_legend(lowrightpoint + (EM, 0) + (0.0m, PHYSHEIGHT_23), botlegend) diff --git a/test/test_27.png b/test/test_27.png index a0a5b2e..a6a7c38 100644 Binary files a/test/test_27.png and b/test/test_27.png differ diff --git a/test/test_28.jl b/test/test_28.jl index 3450a75..2e069ac 100644 --- a/test/test_28.jl +++ b/test/test_28.jl @@ -8,9 +8,7 @@ let BACKCOLOR = color_with_lumin(PALETTE[8], 90); if !@isdefined N - @import_expand ~m # Will error if m² already is in the namespace - @import_expand ~N - @import_expand s + @import_expand( ~m, ~N, s) end include("test_functions_28.jl") @@ -24,7 +22,7 @@ thisname = split(thisline, "\t")[1] Fx, Fy, Fz, _, _, _, px, py, pz = parse.(Quantity{Float64}, split(thisline, '\t')[3:end-1]) -empty_figure(joinpath(@__DIR__, "test_28.png"), +empty_figure(filename = joinpath(@__DIR__, "test_28.png"), backgroundcolor = BACKCOLOR, hue = color_from_palette("blue")); diff --git a/test/test_29.jl b/test/test_29.jl index 225043c..5a8a376 100644 --- a/test/test_29.jl +++ b/test/test_29.jl @@ -11,10 +11,9 @@ import DSP.Windows: tukey import Statistics: mean #let if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s + @import_expand(~m, s) end -empty_figure(joinpath(@__DIR__, "test_29.png")); +empty_figure(filename = joinpath(@__DIR__, "test_29.png")); curpoint = O + (-WI / 2 + EM, -HE / 2 + 3EM) velocities = range(0.05m/s, stop= 0.5m/s, length = 3) diff --git a/test/test_3.jl b/test/test_3.jl index b1c6353..d1385c2 100644 --- a/test/test_3.jl +++ b/test/test_3.jl @@ -8,15 +8,12 @@ import MechanicalSketch: transform, @layer, do_action, getmatrix, grestore, gsav import MechanicalSketch: box_fill_outline, label, row_height, pixelwidth, @import_expand import MechanicalSketch: scale_pt_to_unit, lumin, label_boxed if !@isdefined ° - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° - @import_expand rad + @import_expand(~m, s, °, rad) end #let typcol = PALETTE[9]; bckcol = color_with_lumin(typcol, 0.5 * lumin(typcol)) - empty_figure(joinpath(@__DIR__, "test_3.png"); + empty_figure(filename = joinpath(@__DIR__, "test_3.png"); backgroundcolor = bckcol, hue = "white") # Straight arrow width diff --git a/test/test_3.png b/test/test_3.png index ec03b9f..6b0da44 100644 Binary files a/test/test_3.png and b/test/test_3.png differ diff --git a/test/test_30.jl b/test/test_30.jl index e34ff61..c7327c9 100644 --- a/test/test_30.jl +++ b/test/test_30.jl @@ -12,10 +12,9 @@ import Statistics: mean let if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s + @import_expand(~m, s) end -empty_figure(joinpath(@__DIR__, "test_30.png")); +empty_figure(filename = joinpath(@__DIR__, "test_30.png")); global curpoint = O + (-WI / 2 + EM, -HE / 2 + 3.5EM) diff --git a/test/test_30.png b/test/test_30.png index ee005d9..1f24299 100644 Binary files a/test/test_30.png and b/test/test_30.png differ diff --git a/test/test_31.jl b/test/test_31.jl index d691bd8..736f277 100644 --- a/test/test_31.jl +++ b/test/test_31.jl @@ -9,11 +9,10 @@ import Statistics: cor let set_figure_height(3777) -empty_figure(joinpath(@__DIR__, "test_31.png")); +empty_figure(filename = joinpath(@__DIR__, "test_31.png")); if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end global curpoint = O + (-WI / 2 + EM, -HE / 2 + 4.5EM) diff --git a/test/test_31.png b/test/test_31.png index 0a0c236..ad2446e 100644 Binary files a/test/test_31.png and b/test/test_31.png differ diff --git a/test/test_32.jl b/test/test_32.jl index 6ec87e9..8702898 100644 --- a/test/test_32.jl +++ b/test/test_32.jl @@ -15,8 +15,7 @@ let if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end include("test_functions_32.jl") @@ -50,10 +49,10 @@ fxy_lin(x, y) = (0.5 * (x / physwidth + 0.5), 0.0)m∙s⁻¹ # Phase and amplitude for the visualization. This can generate cyclic movies complex_convolution_matrix_linear = convolute_image_32(fxy_lin; physwidth, physheight) -legend = BinLegend(;maxlegend = 0.2, minlegend = -1.0, noofbins = 256, - colorscheme = reverse(Greys_9), +legend = BinLegend(;maxlegend = 0.2, minlegend = -1.0, noofbins = 256, + colorscheme = reverse(Greys_9), nan_color = color_with_lumin(PALETTE[1], 80), name = Symbol("Value{Float64}")) - + # Define scene functions (parts of each image) # Rectangular flow field plot including a visual frame counter diff --git a/test/test_33.jl b/test/test_33.jl index acb4d0b..95ffaf2 100644 --- a/test/test_33.jl +++ b/test/test_33.jl @@ -15,14 +15,12 @@ import Base.show let if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(~m, s, °) end include("test_functions_33.jl") -empty_figure(joinpath(@__DIR__, "test_33.png"); +empty_figure(filename = joinpath(@__DIR__, "test_33.png"); backgroundcolor = color_with_lumin(PALETTE[8], 10)) # Scaling and placement @@ -45,8 +43,8 @@ v_xy = matrix_to_function(velocity_matrix) streamlinepixels = streamlines_matrix(v_xy; physwidth, physheight) cent1 = Oadj + (-Δx, Δy) -legend1 = BinLegend(;maxlegend = 1.0, minlegend = 0.0, noofbins = 2, - colorscheme = leonardo, +legend1 = BinLegend(;maxlegend = 1.0, minlegend = 0.0, noofbins = 2, + colorscheme = leonardo, nan_color = color_with_lumin(PALETTE[1], 80), name = Symbol("Value{Float64}")) bw(x::Bool) = legend1(Float64(x)) ulp, _ = place_image(cent1, bw.(streamlinepixels)) @@ -59,7 +57,7 @@ settext(str, ulp, markup = true) complex_convolution_matrix = convolution_matrix(velocity_matrix, streamlinepixels) legend2 = BinLegendVector(;operand_example = first(complex_convolution_matrix), - max_magn_legend = lenient_max(complex_convolution_matrix), + max_magn_legend = lenient_max(complex_convolution_matrix), noof_ang_bins = 40, noof_magn_bins = 5, name = Symbol("Convolution matrix")) cent2 = Oadj + (Δx, Δy) @@ -74,8 +72,8 @@ settext(str, ulp, markup = true) cent3 = Oadj + (-Δx, 0.0m) curmat = lic_matrix_current(complex_convolution_matrix, 0, zeroval = -0.0) -legend3 = BinLegend(;maxlegend = 1.0, minlegend = -1.0, noofbins = 256, - colorscheme = reverse(Greys_9), +legend3 = BinLegend(;maxlegend = 1.0, minlegend = -1.0, noofbins = 256, + colorscheme = reverse(Greys_9), name = Symbol(" ")) ulp, _ = place_image(cent3, legend3.(curmat)) @@ -92,8 +90,8 @@ speedmatrix = hypot.(velocity_matrix) binwidth = 0.1m/s lum = 50 cols = isoluminant_cgo_80_c38_n256.colors .|> co -> color_with_lumin(co, lum) -legend4 = BinLegend(maxlegend = max_velocity, binwidth = binwidth, - colorscheme = cols, +legend4 = BinLegend(maxlegend = max_velocity, binwidth = binwidth, + colorscheme = cols, name = :Speed) ulp, _ = place_image(cent4, legend4.(speedmatrix)); @layer begin diff --git a/test/test_33.png b/test/test_33.png index 0bc7639..cb7957a 100644 Binary files a/test/test_33.png and b/test/test_33.png differ diff --git a/test/test_34.jl b/test/test_34.jl index 422ba09..aaaf52e 100644 --- a/test/test_34.jl +++ b/test/test_34.jl @@ -16,9 +16,7 @@ import ColorSchemes: isoluminant_cgo_80_c38_n256 let if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(~m, s, °) end include("test_functions_33.jl") diff --git a/test/test_35.jl b/test/test_35.jl index d836067..72ca0dd 100644 --- a/test/test_35.jl +++ b/test/test_35.jl @@ -11,12 +11,10 @@ import Luxor: Cairo.CairoSurfaceBase, translate, scale let if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(~m, s, °) end include("test_functions_35.jl") -empty_figure(joinpath(@__DIR__, "test_35.png"), +empty_figure(filename = joinpath(@__DIR__, "test_35.png"), backgroundcolor = color_with_lumin(PALETTE[8], 30)); totheight = 10.0m diff --git a/test/test_36.jl b/test/test_36.jl index d92318b..9ed2515 100644 --- a/test/test_36.jl +++ b/test/test_36.jl @@ -12,13 +12,11 @@ import Base.pop! if !@isdefined m² - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand ° + @import_expand(~m, s, °) end include("test_functions_36.jl") -empty_figure(joinpath(@__DIR__, "test_36.png"), height = 15m); +empty_figure(filename = joinpath(@__DIR__, "test_36.png"), height = 15m); pt = O + (-WI / 2, -HE / 2) + (EM, 2.5EM) str = "Testing a) latex b) brush strokes c) sequence of cropped panels\r The blocks use the golden ratio:" @@ -70,7 +68,7 @@ finish() #=import MechanicalSketch: BezierPath, BezierPathSegment, bezier, bezier′, bezier′′, makebezierpath, drawbezierpath, bezierpathtopoly, beziertopoly, pathtobezierpaths, bezierfrompoints, beziercurvature, bezierstroke, setbezierhandles, shiftbezierhandles h = 1m -empty_figure(joinpath(@__DIR__, "test_36.png"), height = 15m); +empty_figure(filename = joinpath(@__DIR__, "test_36.png"), height = 15m); pts = [Point(-w,-w), Point(-w,w), Point(w,w), diff --git a/test/test_36.png b/test/test_36.png index eb758bd..59be407 100644 Binary files a/test/test_36.png and b/test/test_36.png differ diff --git a/test/test_37.jl b/test/test_37.jl index 7c1c784..339c6cf 100644 --- a/test/test_37.jl +++ b/test/test_37.jl @@ -3,17 +3,15 @@ import MechanicalSketch: readsvg, place_image, settext, Quantity, ustrip, unit import MechanicalSketch: Point, julialogo, PALETTE, color_with_lumin, @svg import MechanicalSketch: background, color_with_alpha, scale, @layer, setopacity import MechanicalSketch: rotate, translate -import Plots -import Plots: plot, plot! -using RecipesBase +using MechGluecode +import Plots.plot +# Plot dependencies in 'test_functions_37.jl' + if !@isdefined N - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand N - @import_expand ° + @import_expand(~m, s, °, N) end include("test_functions_37.jl") -empty_figure(joinpath(@__DIR__, "test_37.png"); +empty_figure(filename = joinpath(@__DIR__, "test_37.png"); backgroundcolor = color_with_lumin(PALETTE[5], 90), hue = "black"); @layer begin @@ -27,34 +25,15 @@ pt = O + (-WI / 2 + EM, -HE / 2 + 2EM) settext("Plot recipe with svg style modifications", pt, markup = true) pt += (0, EM) -@warn "Plots is a heavy depencency, and conflicts with Luxor identifiers: 'text', 'brush', 'translate'. You may not want to install all these artifacts." x = 0.0s:1.0s:5.0s y = x .* N ./ s -unit_formatter(T, num) = string(eltype(T)(num)) -@recipe function f(::Type{T}, x::T) where T <: AbstractArray{<:Union{Missing,<:Quantity}} - u = unit(eltype(x)) - relevantkey = if RecipesBase.is_explicit(plotattributes, :letter) - letter = plotattributes[:letter] - Symbol(letter, :guide) - else - :guide - end - preguide = string(get(plotattributes, relevantkey, nothing)) - if preguide == "nothing" - guide --> "[" * string(u) * "]" - else - letter = plotattributes[:letter] - Symbol(letter, :formatter) --> x->unit_formatter(T,x) - end - return ustrip(x ./ u) -end -settext("Add units as guide label:", pt) +settext("MechGlueCode has quantity plot recipes:", pt) pl1 = plot(x, y); ptul, ptlr = place_image_37(pt, pl1, height = 0.25HE) pt += (0, 2EM + ptlr[2] - ptul[2]) -settext("When guides are specified, use tick units:", pt) +settext("When guides are specified, postfix units:", pt) pl2 = plot(x, y, xguide = "Time", yguide = "Force"); ptul, ptlr = place_image_37(pt, pl2, height = 0.25HE) pt += (0, 2EM + ptlr[2] - ptul[2]) @@ -71,8 +50,8 @@ ts = range(0, stop = 8π, length = n) x = ts * N .* map(cos, ts) y = (0.1ts) * N .* map(sin, ts) .|> N z = (1:n)s -pl3 = plot(x, y, z, zcolor = reverse(z./s), - m = (10, 0.8, :blues, Plots.stroke(0)), +pl3 = plot(x, y, z, zcolor = reverse(z./s), + m = (10, 0.8, :blues, Plots.stroke(0)), leg = false, cbar = true, w = 5, zguide = "Time"); plot!(pl3, zeros(n), zeros(n), 1:n, w = 10); diff --git a/test/test_37.png b/test/test_37.png index e9c39b8..d4b31d9 100644 Binary files a/test/test_37.png and b/test/test_37.png differ diff --git a/test/test_38.jl b/test/test_38.jl index 221cae3..7fa9a96 100644 --- a/test/test_38.jl +++ b/test/test_38.jl @@ -1,22 +1,18 @@ import MechanicalSketch: @import_expand, empty_figure, WI, HE, EM, O, PT, finish -import MechanicalSketch: settext, place_image, PALETTE, color_with_lumin -import MechanicalSketch: circle, ∙, arrow_nofill, Point, @layer, sethue +import MechanicalSketch: settext, place_image, PALETTE, color_with_lumin, snapshot +import MechanicalSketch: circle, ∙, arrow_nofill, Point, @layer, sethue, draw_expr import MechanicalSketch: latexify, arrow, generate_complex_potential_vortex import MechanicalSketch: generate_complex_potential_source, ∇, color_matrix import MechanicalSketch: fontsize, draw_legend, draw_streamlines, ∇_rectangle +import MechanicalSketch: @eq_draw, @ev_draw, x_y_iterators_at_pixels +import MechanicalSketch: matrix_to_function, SA import ColorSchemes: isoluminant_cgo_80_c38_n256 -if !@isdefined N - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand N - @import_expand ° -end +@import_expand(~m, s, N, °) include("test_functions_33.jl") ϕ = ϕ_33 include("test_functions_39.jl") - # Scaling and placement physwidth = 10.0m physheight = 4.0m @@ -31,42 +27,143 @@ cent2 = Oadj + ( Δx, Δy) cent3 = Oadj + ( Δx, -Δy) cent4 = Oadj + ( Δx, -3Δy) -empty_figure(joinpath(@__DIR__, "test_38.png"); - backgroundcolor = color_with_lumin(PALETTE[5], 90), +empty_figure( backgroundcolor = color_with_lumin(PALETTE[5], 90), hue = "black", height = totheight); +@eq_draw "Potential field, defined previously:" :(ϕ(𝐫)) init= true +@eq_draw "Steady flow velocity field at r:" :( 𝐕(𝐫) = 𝐢∙u(𝐫) + 𝐣∙v(𝐫) = ∇ϕ(𝐫)) +Δx, Δy = physwidth / 2, physheight / 2 +rng = string([(-Δx, -Δy), (Δx, Δy)]) +@ev_draw "We evaluate r rectangle $rng" :(𝐕 = ∇(ϕ)) + +@eq_draw("Local acceleration, steady flow is", quote + 𝐚 = d𝐕 / dt = d( 𝐢∙u(𝐫) + 𝐣∙v(𝐫)) / dt +end) +@eq_draw("A particle moves, so r = r(x, y, t)", quote + 𝐚 = δ𝐕 / δt ∙ dt / dt + δ𝐕 / δx ∙ dx / dt + δ𝐕 / δy ∙ dy / dt +end) +@eq_draw("This field is steady over time, so the first term is zero, and dx / dt = u", quote + 𝐚 = δ𝐕 / δx ∙ u + δ𝐕 / δy ∙ v = ∇𝐕∙(u, v) +end) + +@eq_draw("The last step is valid because the axes are orthogonal", quote + 𝐚 = δu / δx ∙ u + δv / δx ∙ v = ∇(u)∙ u + ∇(v)∙ v +end) + +#= To speed up the calculations, we'll strip and reapply interpolation information +xs, ys = x_y_iterators_at_pixels(;physwidth, physheight) +u_c = matrix_to_function([𝐕(x, y)[1] for y in ys, x in xs]) +u(r) = u_c(real(r), imag(r)) +v_c = matrix_to_function([𝐕(x, y)[2] for y in ys, x in xs]) +v(r) = u_c(real(r), imag(r)) +∇_rectangle(v; physwidth, physheight) +∇_rectangle(v; physwidth, physheight) +∇(ϕ; physwidth, physheight) +=# +cpt = O + ( EM, -HE / 2 + 2EM) +@eq_draw("Defining functions", quote + u(r) = 𝐕(real(r), imag(r))[1] + v(r) = 𝐕(real(r), imag(r))[2] + ∇u(r) = ∇(u)(real(r), imag(r)) + ∇v(r) = ∇(v)(real(r), imag(r)) +# 𝐚(r) = ∇u(r).∙u(r) + ∇v(r).∙v(r) +# 𝐚(x, y) = 𝐚(complex(x, y)) +end) + +r₀ = complex(0.0m, 0.0m) +#a₀ , u₀, v₀ = 𝐚(r₀), u(r₀), v(r₀) +#@show(a₀ , u₀, v₀); +#u₀, v₀ = u(r₀), v(r₀) +#@show(u₀, v₀); + + + + +xs, ys = x_y_iterators_at_pixels(;physwidth, physheight) +import MechanicalSketch.MechanicalUnits.Length +xss = SA[collect(xs)[1:2]] +yss = SA[collect(ys)[1:2]] + +#xss = SA{typeof(0.0)}[collect(1.0:1.1:10.0)[1:2]] + +um = SA{typeof(u₀)}[𝐕(x, y)[1] for y in ys, x in xs] +vm = [𝐕(x, y)[1] for y in ys, x in xs] +xss = SA[xs[1:2]] +yss = SA[ys[1:2]] +foom() = [∇(u)(x, y)[1] for y in yss, x in xss] +∇um = foom() +#ERROR: MethodError: no method matching +#zero(::Type{Tuple{Quantity{Float64, ᵀ⁻¹, FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}, Quantity{Float64, ᵀ⁻¹, FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}}}) +# The above can work, but is incredibly slow. Maybe we can improve by defining the missing method? +import MechanicalSketch.MechanicalUnits.Unitfu +import MechanicalSketch.MechanicalUnits.FreeUnits +import MechanicalSketch.MechanicalUnits.dimension +import MechanicalSketch.MechanicalUnits.Time +import MechanicalSketch.MechanicalUnits.Dimensions +import MechanicalSketch.MechanicalUnits.Dimension +import MechanicalSketch.MechanicalUnits.Level +import MechanicalSketch.Quantity +TD = dimension(1.0s) +ITD = dimension(1.0/s) +typeof(InvTime) + -pt = O + (-WI / 2 + EM, -HE / 2 + 2EM) -settext("Potential field, defined previously:", pt) -expression = :(ϕ(𝐫)); -ptul, ptbr, latexscale = place_image(pt + (EM, 0), latexify(expression); height = 1.2EM, centered = false) -pt += (0, 1.5EM + ptbr.y - ptul.y) +typeof(Time) +InvTime isa Time^-1 -settext("Steady flow velocity field at r:", pt, markup = true) -expression = :( 𝐕(𝐫) = 𝐢∙u(𝐫) + 𝐣∙v(𝐫) = ∇ϕ(𝐫)) -ptul, ptbr = place_image(pt + (EM, 0), latexify(expression); scalefactor = latexscale, centered = false) +#It seems we havent defined zero(T), where T = +# Tuple{Unitfu.Quantity{Float64, ᵀ⁻¹, Unitfu.FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}, Unitfu.Quantity{Float64, ᵀ⁻¹, Unitfu.FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}} +# Tuple{Quantity{Float64, ᵀ⁻¹, FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}, Quantity{Float64, ᵀ⁻¹, FreeUnits{(s⁻¹,), ᵀ⁻¹, nothing}}} +# Tuple{Quantity{Float64, ITD, FreeUnits{(s⁻¹,), ITD, nothing}}, Quantity{Float64, ITD, FreeUnits{(s⁻¹,), ITD, nothing}}} +# Tuple{Quantity{Float64, ITD, U}, Quantity{Float64, ITD, U}} where U +typeof(1.0s) <: Quantity{T, TD, U} where {T, U} +typeof(1.0s) <: Quantity{Float64, TD, U} where {U} +typeof((1.0s, 1.0s)) <: Tuple{Quantity{Float64, TD, U}, Quantity{Float64, TD, U}} where {U} +typeof((1.0/s, 1.0/s)) <: Tuple{Quantity{Float64, ITD, U}, Quantity{Float64, ITD, U}} where {U} -𝐕 = ∇(ϕ) -colmat, legend1 = color_matrix(𝐕; centered = true, maxlegend = 1.0m/s) -ulp, _ = place_image(cent1, colmat) +# But zero is not defined for Tuples anywhere.... We have 44 methods. + +zero((1.0s, 1.0s)) +zero(typeof((1.0, 1.0))) +∇vm + +zero(1.0m) +zero(typeof(1.0m)) + + + +fooam() = [𝐚(x, y) for y in ys, x in xs] +am = @time fooam() +# Show velocity field + +colmat1, legend1 = color_matrix(𝐕; centered = true, maxlegend = 1.0m/s, name = Symbol("‖V‖")); +ulp, lrp = place_image(cpt, colmat1; centered = false) @layer begin fontsize(25) draw_legend(ulp + (0.5EM, 0.5EM) + (physwidth, 0.0m), legend1) + # To better indicate positive direction for this static image: + sethue(PALETTE[8]) + draw_streamlines(cent2, 𝐕, probability = 0.001) end -# To better indicate positive direction for this static image: +snapshot() + + +# Show acceleration field +cpt = O + (ulp[1], lrp[2] - EM) + +@time colmat2, legend2 = color_matrix(𝐚; centered = true, noofbins = 7, name = Symbol("‖a‖")); +println("The calculation is done?") +ulp, lrp = place_image(cpt, colmat2; centered = false) @layer begin + fontsize(25) + draw_legend(ulp + (0.5EM, 0.5EM) + (physwidth, 0.0m), legend2) + # To better indicate positive direction for this static image: sethue(PALETTE[8]) - draw_streamlines(cent1, 𝐕, probability = 0.001) + draw_streamlines(cent2, 𝐚, probability = 0.001) end -pt += (0, 1.5EM + ptbr.y - ptul.y) -settext("Local acceleration, steady flow:", pt, markup = true) -# Strictly incorrect, use paranthesis or . -expression = :(𝐚 = d𝐕 / dt = X) # 𝐕∙(∇𝐕) = 𝐕.∙∇∇ϕ = 𝐕.∙ ∇²ϕ) -ptul, ptbr, _ = place_image(pt + (EM, 0), latexify(expression); scalefactor = latexscale, centered = false) -pt += (0, 1.5EM + ptbr.y - ptul.y) -#𝐚 = ∇_rectangle(𝐕) +snapshot(fname = joinpath(@__DIR__, "test_38.png")) + -finish() diff --git a/test/test_38.png b/test/test_38.png index e11ac16..5fd611a 100644 Binary files a/test/test_38.png and b/test/test_38.png differ diff --git a/test/test_39.jl b/test/test_39.jl index da47bca..844b106 100644 --- a/test/test_39.jl +++ b/test/test_39.jl @@ -3,13 +3,10 @@ import MechanicalSketch: settext, place_image, PALETTE, color_with_lumin import MechanicalSketch: circle, ∙, arrow_nofill, Point, @layer, sethue import MechanicalSketch: latexify, arrow if !@isdefined N - @import_expand ~m # Will error if m² already is in the namespace - @import_expand s - @import_expand N - @import_expand ° + @import_expand(~m, s, °, N) end include("test_functions_39.jl") -empty_figure(joinpath(@__DIR__, "test_39.png"); +empty_figure(filename = joinpath(@__DIR__, "test_39.png"); backgroundcolor = color_with_lumin(PALETTE[5], 90), hue = "black", height = 10m); pt = O + (-WI / 2 + EM, -HE / 2 + 2EM) @@ -24,10 +21,10 @@ end vr = √2 / 2 ∙(r, r) arrow_nofill(pt + 0.5vr, pt + vr; arrowheadlength = 0.5EM) settext("$r", pt + vr) -arrow(pt, 2EM, 0°, 30°; arrowheadlength = 0.4EM) +arrow(pt, 2EM, 0°, 30°; arrowheadlength = 0.4EM) pt += (0, 1.5EM) settext("θ", pt + vr) -# +# #expression = :( δ / δr ∙ (δψ / δθ) + δ / δθ ∙ (-δψ / δr) = 0) diff --git a/test/test_4.jl b/test/test_4.jl index 1112ffc..281d2a6 100644 --- a/test/test_4.jl +++ b/test/test_4.jl @@ -4,7 +4,7 @@ import MechanicalSketch: FS, EM, translate, color_with_lumin, midpoint, getrotat import MechanicalSketch: empty_figure, finish, color_from_palette let - this_fig = empty_figure(joinpath(@__DIR__, "test_4.png")) + this_fig = empty_figure(filename = joinpath(@__DIR__, "test_4.png")) background(color_from_palette("seagreen1")) sethue(color_with_lumin(color_from_palette("darkblue"), 20)) diff --git a/test/test_4.png b/test/test_4.png index 9770a89..f3c5e61 100644 Binary files a/test/test_4.png and b/test/test_4.png differ diff --git a/test/test_40.jl b/test/test_40.jl new file mode 100644 index 0000000..c9d966b --- /dev/null +++ b/test/test_40.jl @@ -0,0 +1,99 @@ +using Revise +import MechanicalSketch: @import_expand, empty_figure, WI, HE, EM, O, PT, FS, finish +import MechanicalSketch: settext, place_image, PALETTE, color_with_lumin, circle, line +import MechanicalSketch: circle, ∙, arrow_nofill, Point, @layer, sethue, draw_expr +import MechanicalSketch: latexify, arrow, Quantity, readsvg, unit, ustrip +import MechanicalSketch: ForwardDiff, box_fill_outline, brush, setopacity +import MechanicalSketch: @ev_draw, snapshot, preview, currentdrawing, show_expression +import ForwardDiff: derivative, Tag, Dual, can_dual +import MechanicalSketch: MechanicalUnits, @L_str +import MechanicalUnits: FreeUnits +using MechGluecode + +# Plot dependencies in 'test_functions_37.jl' + +if !@isdefined N + @import_expand(~m, ~s, °, N) +end +include("test_functions_37.jl") +include("test_functions_40.jl") + +empty_figure(backgroundcolor = color_with_lumin(PALETTE[5], 90), + hue = "black", height = 10m); +# Placement grid for plots +nvert = 2 +plys = range(- HE / 2 + 0.5EM, HE /2 - + EM, length = nvert + 1) +plxs = [-3EM, 9EM] +height = 0.18WI + +# Starting point, line spacing, latex scaling (size varies with contents) +cpt = O + (-WI / 2 + EM, -HE / 2 + 2EM) +Δcpy = 2 +scalelatex = 3.143 +pcpt = cpt + +pcpt = cpt +@ev_draw("Quantities q can't be dual numbers, hence trans- +cendental `f(q) = A∙sin(ωq)` is not auto-differentiable. +Substitute:", + quote + g(q) = q / oneunit(q) + string("⟹ q = g(q) · oneunit(q)") + f(q) = 9.81N ∙ sin(3∙2π / s ∙ g(q) ∙ oneunit(q) ) + end) + +@ev_draw("Applicable ranges in different units:", + quote + 𝐭_1 = range(0.001, 1, length = 200)s + 𝐭_2 = 𝐭_1 |> ms + end) +𝐲_1 = f.(𝐭_1) +pl1 = plot(𝐭_1, 𝐲_1 ; label = "f(t₁ )"); +ptul, ptbr = place_image_37(O + (plxs[1], plys[1]), pl1; height) + +𝐲_2 = f.(𝐭_2) +pl2 = plot(𝐭_2, 𝐲_2 ; label = "f(t₂)"); +ptul, ptbr = place_image_37(O + (plxs[2], plys[1]), pl2; height) +snapshot() + +# TODO +# use Chain rules to differentiate rules? +# -> Chain rules not used by ForwardDiff. Other packages? ForwardDiff2 defunct. +# Also, Macrotools, postwalk, prewalk: No type info. +# Mjolnir.jl @trace can do much more. Could be used for substitutions +# @edit derivative(f, 1.2) +# Anyway, this is complicated, while simple finite difference differentiation might +# do the trick better. https://github.com/JuliaDiff/FiniteDiff.jl +# On the other hand, defining chain rules for units (in a separate package) +# may work well with DifferentialEquations.... + +@ev_draw("Forward differentiation, chain rule", + quote + g′(q) = 1 / oneunit(q) + f′(q) = g′(q) * derivative.(f, g(q)) + 𝐱_ul = range(0.1, 1, length = 200) + 𝐱 = range(0.1, 1, length = 200)s + end) + + + +#pl1 = plot(f, 𝐱_ul; label = "f(xᵤₗ)"); +#ptul, ptbr = place_image_37(O + (-3EM, plys[1]), pl1; height) + +#pl2 = plot(f′, 𝐱_ul; label = "f′(xᵤₗ)"); +#ptul, ptbr = place_image_37(O + (9EM, plys[1]), pl2; height) + + + +#𝐲′ = f′.(𝐱) +#pl4 = plot(𝐱, 𝐲′; label = "f′(x)"); +#ptul, ptbr = place_image_37(O + (9EM, plys[2]), pl4; height) + +@layer begin + sethue(PALETTE[4]) + setopacity(0.5) + #brush(ptul, ptbr) + #brush(Point(ptul.x, ptbr.y), Point(ptbr.x, ptul.y)) +end + +snapshot(fname = joinpath(@__DIR__, "test_40.png")) diff --git a/test/test_40.png b/test/test_40.png new file mode 100644 index 0000000..ad00ba9 Binary files /dev/null and b/test/test_40.png differ diff --git a/test/test_41.jl b/test/test_41.jl new file mode 100644 index 0000000..ff23fef --- /dev/null +++ b/test/test_41.jl @@ -0,0 +1,82 @@ +using Revise +import MechanicalSketch: @import_expand, empty_figure, WI, HE, EM, O, PT, FS, finish +import MechanicalSketch: settext, place_image, PALETTE, color_with_lumin, circle, line +import MechanicalSketch: circle, ∙, arrow_nofill, Point, @layer, sethue, draw_expr +import MechanicalSketch: latexify, arrow, Quantity, readsvg, unit, ustrip +import MechanicalSketch: ForwardDiff, box_fill_outline, brush, setopacity +import MechanicalSketch: @ev_draw, rotate_hue, setline +import MechanicalSketch: Drawing, configure_mechanical, preview +import MechanicalSketch: Luxor +import Luxor: CairoContext, CairoRecordingSurface, flush, set_source +import Luxor: paint, getmatrix, setmatrix, currentpoint, get_current_cr +import Luxor: current_surface_type, CURRENTDRAWING +import Luxor.Cairo: device_get_type, flush + +if !@isdefined N + @import_expand(~m, ~s, °, N) +end + +""" + make_recording_surface_drawing() + --> Luxor.Drawing + +This makes, then mutates a Luxor drawing to allow +a special type of Cairo surface. +""" +function make_recording_surface_drawing() + d = Drawing(WI, HE, :svg) + s1 = CairoRecordingSurface() + c1 = CairoContext(s1) + d.surface = s1 + d.cr = c1 + configure_mechanical() + d +end + +""" + snapshot_of_working_surface(fnam) + +Takes a snapshot and saves to file with 'fnam' name and suffix. +One could continue drawing, or do the other things. +""" +function snapshot_of_working_surface(fnam) + drec = currentdrawing() + @assert typeof(drec.surface) + flush(drec.surface) + d = empty_figure(fnam) + d.width = drec.width + d.height = drec.height + d.redvalue = drec.redvalue + d.greenvalue = drec.greenvalue + d.bluevalue = drec.bluevalue + d.alpha = drec.alpha + set_source(d.cr, drec.surface, -WI / 2, -HE / 2) + paint() + finish() + CURRENTDRAWING[1] = drec +end + +make_recording_surface_drawing() + +for r = 1m:0.2m:60m + α = 360.0° * (r / 20m) + circle(O + 100 .* (cos(α), sin(α)); r) + setline(8) + sethue(rotate_hue(PALETTE[5], α)) + settext(string(r), Point(0m, r)) +end +snapshotrecordingsurface("snap1.png") +for r = 1m:0.2m:60m + α = 360.0° * (r / 20m) + circle(O + 100 .* (cos(-α), sin(α)); r) + setline(8) + sethue(rotate_hue(PALETTE[3], α)) + settext(string(r), Point(0m, r)) + end + snap2 = snapshotrecordingsurface(drec) +#snap1 = snapshotrecordingsurface(drec) +#circle(O + (3m, 0m), r = 5m) +#snap2 = snapshotrecordingsurface(drec) + + + diff --git a/test/test_41.png b/test/test_41.png new file mode 100644 index 0000000..d9f1406 Binary files /dev/null and b/test/test_41.png differ diff --git a/test/test_5.jl b/test/test_5.jl index 8c7d4ae..5089f1d 100644 --- a/test/test_5.jl +++ b/test/test_5.jl @@ -4,7 +4,7 @@ import MechanicalSketch: mm, arrow, HE, @layer, setdash, line, setopacity import MechanicalSketch: empty_figure, PALETTE, dimension_aligned let -empty_figure(joinpath(@__DIR__, "test_5.png")) +empty_figure(filename = joinpath(@__DIR__, "test_5.png")) background(color_with_lumin(PALETTE[6], 40)) @layer begin sethue("black") diff --git a/test/test_6.jl b/test/test_6.jl index a058099..611a5bc 100644 --- a/test/test_6.jl +++ b/test/test_6.jl @@ -7,7 +7,7 @@ import MechanicalSketch: empty_figure, PALETTE, dimension_aligned, color_from_p let BACKCOLOR = color_with_lumin(PALETTE[8], 70) function restart() - empty_figure(joinpath(@__DIR__, "test_6.png")) + empty_figure(filename = joinpath(@__DIR__, "test_6.png")) background(BACKCOLOR) sethue(PALETTE[7]) end diff --git a/test/test_7.jl b/test/test_7.jl index 751a4a9..6c0b203 100644 --- a/test/test_7.jl +++ b/test/test_7.jl @@ -6,7 +6,7 @@ import MechanicalSketch: empty_figure, PALETTE let BACKCOLOR = color_with_lumin(PALETTE[5], 30) function restart() - empty_figure(joinpath(@__DIR__, "test_7.png")) + empty_figure(filename = joinpath(@__DIR__, "test_7.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_8.jl b/test/test_8.jl index 5b3dca4..c7c76f3 100644 --- a/test/test_8.jl +++ b/test/test_8.jl @@ -5,7 +5,7 @@ import MechanicalSketch: empty_figure, m, s, arrow, color_with_lumin, PALETTE let BACKCOLOR = color_with_lumin(PALETTE[8], 70) function restart() - empty_figure(joinpath(@__DIR__, "test_8.png")) + empty_figure(filename = joinpath(@__DIR__, "test_8.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_9.jl b/test/test_9.jl index e97aa45..449237f 100644 --- a/test/test_9.jl +++ b/test/test_9.jl @@ -4,7 +4,7 @@ import MechanicalSketch:m, color_with_lumin, drawcart, setline, circle, PALETTE let BACKCOLOR = color_with_lumin(PALETTE[3], 70) function restart() - empty_figure(joinpath(@__DIR__, "test_9.png")) + empty_figure(filename = joinpath(@__DIR__, "test_9.png")) background(BACKCOLOR) sethue(PALETTE[5]) end diff --git a/test/test_functions_24.jl b/test/test_functions_24.jl index d6d8092..1f5fb77 100644 --- a/test/test_functions_24.jl +++ b/test/test_functions_24.jl @@ -1,5 +1,5 @@ function restart(backcolor) - empty_figure(joinpath(@__DIR__, "test_24.png")) + empty_figure(filename = joinpath(@__DIR__, "test_24.png")) background(backcolor) sethue(PALETTE[8]) end @@ -219,8 +219,7 @@ end # Below, we're reusing code to generate the same flow field as in test_23. The cutoff value is no longer NaN. if !@isdefined m² - @import_expand m # Will error if m² already is in the namespace - @import_expand s + @import_expand(m, s) end ϕ_vortex_23 = generate_complex_potential_vortex(; pos = complex(0.0, 1.0)m, vorticity = 1.0m²/s / 2π) ϕ_source_23 = generate_complex_potential_source(; pos = complex(3.0, 0.0)m, massflowout = 1.0m²/s) diff --git a/test/test_functions_25.jl b/test/test_functions_25.jl index 6c5f54c..2d65ca7 100644 --- a/test/test_functions_25.jl +++ b/test/test_functions_25.jl @@ -1,5 +1,5 @@ function restart_25(backcolor) - empty_figure(joinpath(@__DIR__, "test_25.png")) + empty_figure(filename = joinpath(@__DIR__, "test_25.png")) background(backcolor) sethue(PALETTE[8]) end diff --git a/test/test_functions_37.jl b/test/test_functions_37.jl index 147bb73..8b6f50e 100644 --- a/test/test_functions_37.jl +++ b/test/test_functions_37.jl @@ -1,3 +1,12 @@ +# This functionality could be moved to a separate package which carries the +# Plots dependency. An alternative would be to use @require here, but we don't. +# Refer to https://github.com/JuliaLang/Pkg.jl/issues/1285 - the functionality +# might become part of Julia. +import Plots +import Plots: plot, plot!, default, px +using RecipesBase +"Similar to other 'place_image', but not included in MechanicalSketch +Consider moving to MechGlueCode, provided Plots and MechanicalSketch are loaded." function place_image_37(pos::Point, plott::Plots.Plot; width = missing, height = missing, scalefactor = missing, centered = false) diff --git a/test/test_functions_40.jl b/test/test_functions_40.jl new file mode 100644 index 0000000..7113553 --- /dev/null +++ b/test/test_functions_40.jl @@ -0,0 +1,13 @@ +# For debugging +function markit(pcpt, cpt) + circle(pcpt, r = 10mm) + line(pcpt, cpt + (-0.2EM, 0), :stroke) + circle(cpt + (-0.2EM, 0), r = 20mm) +end + +# Plots default +default(titlefont = (20, "times"), legendfontsize = 26, + guidefont = (30, :darkgreen), tickfont = (24, :orange), + framestyle = :origin, minorgrid = true, + legend = :topleft, linewidth = 4, + bottom_margin = 18px, left_margin = 18px) \ No newline at end of file