From 8b0c796d3476a1b4d56bbeeb7a720a107268e284 Mon Sep 17 00:00:00 2001 From: Helmut Strey Date: Sun, 12 Mar 2023 22:19:54 -0400 Subject: [PATCH 1/3] created package that is compatible with Julia 1.7 --- Project.toml | 10 ++++++++++ example/percolation_example.jl | 12 ++++++++++++ src/latticetype.jl | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Project.toml create mode 100644 example/percolation_example.jl diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..12d4437 --- /dev/null +++ b/Project.toml @@ -0,0 +1,10 @@ +name = "Percolation" +uuid = "31b34cd4-33dc-40c1-8f72-ebe007ebca36" +authors = ["Helmut Strey "] +version = "0.1.0" + +[deps] +Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44" +Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" diff --git a/example/percolation_example.jl b/example/percolation_example.jl new file mode 100644 index 0000000..93a569e --- /dev/null +++ b/example/percolation_example.jl @@ -0,0 +1,12 @@ +using Percolation +using Plots + +N = 50; p = 0.6 +sq = Square(N, p, "nn") +sq.lattice_config.lattice_sites + +label_components!(sq) +sq.lattice_properties.labeled_lattice_sites + +sq +Plots.heatmap(sq.lattice_properties.labeled_lattice_sites) \ No newline at end of file diff --git a/src/latticetype.jl b/src/latticetype.jl index 1b6545b..906d748 100644 --- a/src/latticetype.jl +++ b/src/latticetype.jl @@ -79,7 +79,7 @@ for lattice_type in lattice_types false, # isaverage_clustersize false, # isstrength 0, # nclusters - Matrix{Int}(linear_size, linear_size) # labeled_lattice_sites + Array{Int64,2}(undef,linear_size, linear_size) # labeled_lattice_sites ) ) end From d64e6ae2cbc666174edeb7247f4022cd1e76e13a Mon Sep 17 00:00:00 2001 From: Helmut Strey Date: Sun, 12 Mar 2023 23:09:41 -0400 Subject: [PATCH 2/3] added Random --- Project.toml | 1 + example/percolation_example.jl | 10 ++++++++-- src/Percolation.jl | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 12d4437..13937e2 100644 --- a/Project.toml +++ b/Project.toml @@ -7,4 +7,5 @@ version = "0.1.0" Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44" Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" diff --git a/example/percolation_example.jl b/example/percolation_example.jl index 93a569e..e4807c5 100644 --- a/example/percolation_example.jl +++ b/example/percolation_example.jl @@ -1,5 +1,4 @@ using Percolation -using Plots N = 50; p = 0.6 sq = Square(N, p, "nn") @@ -9,4 +8,11 @@ label_components!(sq) sq.lattice_properties.labeled_lattice_sites sq -Plots.heatmap(sq.lattice_properties.labeled_lattice_sites) \ No newline at end of file +heatmap!(sq) + +linsize = 50 +ps = 0.1 +pinc = 0.025 +pf = 1 +nsample = 50 +plot_percolation_prob("square", linsize, ps, pinc, pf, nsample) \ No newline at end of file diff --git a/src/Percolation.jl b/src/Percolation.jl index f42cc88..87b960d 100644 --- a/src/Percolation.jl +++ b/src/Percolation.jl @@ -1,6 +1,6 @@ module Percolation -using Gtk, Gtk.ShortNames, StatsBase, Plots +using Gtk, Gtk.ShortNames, StatsBase, Plots, Random gr() import Plots: heatmap, heatmap! import Images: label_components, label_components! From 0200e1c0c5e9d3d498fc168cf615d61454b0e228 Mon Sep 17 00:00:00 2001 From: Helmut Strey Date: Mon, 13 Mar 2023 10:13:58 -0400 Subject: [PATCH 3/3] changed author and license --- LICENSE.md | 2 +- Project.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 1978f26..54436a3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The Percolation.jl package is licensed under the MIT "Expat" License: -> Copyright (c) 2016: goropikari. +> Copyright (c) 2016: goropikari and contributors > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal diff --git a/Project.toml b/Project.toml index 13937e2..010bf85 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Percolation" uuid = "31b34cd4-33dc-40c1-8f72-ebe007ebca36" -authors = ["Helmut Strey "] +authors = ["Goropikari "] version = "0.1.0" [deps]