Skip to content

Commit 7999ce1

Browse files
committed
PackageCompiler.jl :) And custom PyPlot version
1 parent b0af7a5 commit 7999ce1

File tree

7 files changed

+316
-11
lines changed

7 files changed

+316
-11
lines changed

Manifest.toml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ version = "1.10.0"
206206

207207
[[deps.DataFrames]]
208208
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
209-
git-tree-sha1 = "daa21eb85147f72e41f6352a57fccea377e310a9"
209+
git-tree-sha1 = "6bce52b2060598d8caaed807ec6d6da2a1de949e"
210210
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
211-
version = "1.3.4"
211+
version = "1.3.5"
212212

213213
[[deps.DataFramesMeta]]
214214
deps = ["Chain", "DataFrames", "MacroTools", "OrderedCollections", "Reexport"]
@@ -332,12 +332,6 @@ git-tree-sha1 = "94f5101b96d2d968ace56f7f2db19d0a5f592e28"
332332
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
333333
version = "1.15.0"
334334

335-
[[deps.FilePaths]]
336-
deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"]
337-
git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629"
338-
uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824"
339-
version = "0.8.3"
340-
341335
[[deps.FilePathsBase]]
342336
deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"]
343337
git-tree-sha1 = "129b104185df66e408edd6625d480b7f9e9823a0"
@@ -647,6 +641,10 @@ git-tree-sha1 = "9e72f9e890c46081dbc0ebeaf6ccaffe16e51626"
647641
uuid = "10f19ff3-798f-405d-979b-55457f8fc047"
648642
version = "0.1.8"
649643

644+
[[deps.LazyArtifacts]]
645+
deps = ["Artifacts", "Pkg"]
646+
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
647+
650648
[[deps.LeftChildRightSiblingTrees]]
651649
deps = ["AbstractTrees"]
652650
git-tree-sha1 = "b864cb409e8e445688bc478ef87c0afe4f6d1f8d"
@@ -835,7 +833,7 @@ uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
835833
version = "0.2.2"
836834

837835
[[deps.MyToolbox]]
838-
deps = ["BenchmarkTools", "ComponentArrays", "DataFrames", "DataStructures", "FilePaths", "FilePathsBase", "IJulia", "JLD2", "LaTeXStrings", "Logging", "LoggingExtras", "Match", "Parameters", "PartialFunctions", "Pkg", "PrettyTables", "Printf", "Profile", "ProfileView", "ProgressMeter", "PyFormattedStrings", "PyPlot", "Random", "Reexport", "Requires", "Setfield", "StatsBase"]
836+
deps = ["BenchmarkTools", "ComponentArrays", "DataFrames", "DataStructures", "FilePathsBase", "IJulia", "JLD2", "LaTeXStrings", "Logging", "LoggingExtras", "Match", "Parameters", "PartialFunctions", "Pkg", "PrettyTables", "Printf", "Profile", "ProfileView", "ProgressMeter", "PyFormattedStrings", "PyPlot", "Random", "Reexport", "Requires", "Setfield", "StatsBase"]
839837
path = "pkg/MyToolbox"
840838
uuid = "54cd1024-cafd-4d62-948d-ced4874502bf"
841839
version = "0.1.0"
@@ -921,6 +919,12 @@ git-tree-sha1 = "cf494dca75a69712a72b80bc48f59dcf3dea63ec"
921919
uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
922920
version = "0.11.16"
923921

922+
[[deps.PackageCompiler]]
923+
deps = ["Artifacts", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs"]
924+
git-tree-sha1 = "c497e2bb9c2127a411b74dbff56b11f258d67d12"
925+
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
926+
version = "2.0.9"
927+
924928
[[deps.Pango_jll]]
925929
deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "FriBidi_jll", "Glib_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg"]
926930
git-tree-sha1 = "3a121dfbba67c94a5bec9dde613c3d0cbcf3a12b"
@@ -1030,9 +1034,11 @@ version = "0.1.10"
10301034

10311035
[[deps.PyPlot]]
10321036
deps = ["Colors", "LaTeXStrings", "PyCall", "Sockets", "Test", "VersionParsing"]
1033-
git-tree-sha1 = "14c1b795b9d764e1784713941e787e1384268103"
1037+
git-tree-sha1 = "b797472d2d26a04fd731e2624f7d1371a7523fd6"
1038+
repo-rev = "master"
1039+
repo-url = "https://github.com/xzackli/PyPlot.jl"
10341040
uuid = "d330b81b-6aea-500a-939a-2ce795aea3ee"
1035-
version = "2.10.0"
1041+
version = "2.9.0"
10361042

10371043
[[deps.QuadGK]]
10381044
deps = ["DataStructures", "LinearAlgebra"]
@@ -1070,6 +1076,12 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
10701076
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
10711077
version = "1.2.2"
10721078

1079+
[[deps.RelocatableFolders]]
1080+
deps = ["SHA", "Scratch"]
1081+
git-tree-sha1 = "cdbd3b1338c72ce29d9584fdbe9e9b70eeb5adca"
1082+
uuid = "05181044-ff0b-4ac5-8273-598c1e38db00"
1083+
version = "0.1.3"
1084+
10731085
[[deps.Requires]]
10741086
deps = ["UUIDs"]
10751087
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
@@ -1131,6 +1143,12 @@ path = "pkg/Sciplotlib"
11311143
uuid = "61be95e5-9550-4d5f-a203-92a5acbc3116"
11321144
version = "0.1.0"
11331145

1146+
[[deps.Scratch]]
1147+
deps = ["Dates"]
1148+
git-tree-sha1 = "f94f779c94e58bf9ea243e77a37e16d9de9126bd"
1149+
uuid = "6c6a2e73-6563-6170-7368-637461726353"
1150+
version = "1.1.1"
1151+
11341152
[[deps.Serialization]]
11351153
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
11361154

Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
[deps]
22
Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc"
3+
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
34
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
5+
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
46
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
57
FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f"
68
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
79
LsqFit = "2fda8390-95c7-5789-9bda-21331edee243"
810
MyToolbox = "54cd1024-cafd-4d62-948d-ced4874502bf"
11+
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
912
ProfileView = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7"
13+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
1014
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
1115
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
1216
Sciplotlib = "61be95e5-9550-4d5f-a203-92a5acbc3116"
1317
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
18+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1419
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
1520
VoltoMapSim = "f713100b-c48c-421a-b480-5fcb4c589a9e"

nb/2022-09-15__Two-pass_conntest_ptp-then-cor.ipynb

Lines changed: 197 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- coding: utf-8 -*-
2+
# ---
3+
# jupyter:
4+
# jupytext:
5+
# formats: ipynb,jl:light
6+
# text_representation:
7+
# extension: .jl
8+
# format_name: light
9+
# format_version: '1.5'
10+
# jupytext_version: 1.13.7
11+
# kernelspec:
12+
# display_name: Julia-preloaded 1.7.0
13+
# language: julia
14+
# name: julia-preloaded-1.7
15+
# ---
16+
17+
# # 2022-09-15 • Two-pass connection test: peak-to-peak, then correlation with found average
18+
19+
# ## Imports
20+
21+
# +
22+
#
23+
# -
24+
25+
using Revise
26+
27+
using MyToolbox
28+
29+
using VoltoMapSim
30+
31+
# ## Params
32+
33+
p = get_params(
34+
duration = 10minutes,
35+
p_conn = 0.04,
36+
g_EE = 1,
37+
g_EI = 1,
38+
g_IE = 4,
39+
g_II = 4,
40+
ext_current = Normal(-0.5 * pA/√seconds, 5 * pA/√seconds),
41+
E_inh = -80 * mV,
42+
record_v = [1:40; 801:810],
43+
);
44+
45+
# ## Run sim
46+
47+
s = cached(sim, [p.sim]);
48+
49+
s = augment(s, p);
50+
51+
plotSTA(23=>1,s,p);
52+
53+

scripts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.dll

scripts/pyplot_delay_init.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# See https://github.com/JuliaPy/PyPlot.jl/pull/480
3+
# and ./to_precompile.jl
4+
# Needs
5+
# Pkg.add(url="https://github.com/xzackli/PyPlot.jl")
6+
7+
using PyPlot
8+
PyPlot.delay_init_until_cell[] = true

scripts/to_precompile.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# For use with PackageCompiler.jl, to generate a "system image", like here:
2+
# https://julialang.github.io/PackageCompiler.jl/stable/examples/plots.html.
3+
#
4+
# The goal is having to wait less long for package imports and first function calls in a
5+
# fresh Julia session.
6+
#
7+
# Commands to run, in the repo root:
8+
#=
9+
using PackageCompiler
10+
pkgs = [:Revise, :PyCall, :IJulia, :PyPlot, :DataFrames, :ComponentArrays]
11+
sysimage_path = "scripts/mysys.dll"
12+
precompile_execution_file = "scripts/to_precompile.jl"
13+
script = "scripts/pyplot_delay_init.jl"
14+
create_sysimage(pkgs; sysimage_path, precompile_execution_file, script)
15+
=#
16+
17+
using PyPlot, DataFrames, ComponentArrays
18+
19+
df = DataFrame([(a=1, b=2), (a=2, b=2)])
20+
cv = ComponentVector(a=3, b=8)
21+
22+
fig, ax = plt.subplots()
23+
ax.plot(df.a, collect(cv))

0 commit comments

Comments
 (0)