From 34feced70c28924c7019932f33992699ca8ad01b Mon Sep 17 00:00:00 2001 From: tomtuamnuq <76523782+tomtuamnuq@users.noreply.github.com> Date: Fri, 29 Mar 2024 05:20:45 +0100 Subject: [PATCH] revisit todos #6 and revise manifest --- Cargo.lock | 4 ++-- Cargo.toml | 15 +++++++++++---- assets/manifest.json | 4 ++-- assets/sw.js | 1 + src/chaos/benchmark.rs | 18 +++++++++--------- src/chaos/data/initial_distribution.rs | 13 +++++-------- src/chaos/fractal/fractal_conf.rs | 2 -- src/chaos/fractal/julia.rs | 1 - src/chaos/functions/discrete_maps.rs | 2 +- src/gui/plot/plot_colors.rs | 2 +- 10 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9940f4d..f458109 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -607,7 +607,6 @@ dependencies = [ [[package]] name = "egui-plotter" version = "0.3.0" -source = "git+https://github.com/Gip-Gip/egui-plotter.git?branch=main#00888c032a2121c568c4174f898ed8402cc0e96e" dependencies = [ "egui", "plotters", @@ -1577,7 +1576,8 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "perplex_num" version = "0.1.0" -source = "git+https://github.com/tomtuamnuq/perplex_num.git?branch=main#fb5bbff05bc921ff42a82ce6a227ab0efa9f30ca" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65693c08398fccb447801c2d1c088aeca3083ffa50df613028293386ec4ea8a4" dependencies = [ "approx", "nalgebra", diff --git a/Cargo.toml b/Cargo.toml index 21986da..2aa163e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,14 @@ [package] +authors = ["Tom Krüger <76523782+tomtuamnuq@users.noreply.github.com>"] +description = "An interactive visualization tool for dynamics in chaotic systems." +homepage = "https://tomtuamnuq.github.io/rusty-chaos-craftor/" +keywords = ["chaotic-dynamical-systems", "particles", "fractals", "complex-numbers", "perplex-numbers"] +categories = ["chaos-theory", "simulation", "mathematics"] +license = "MIT" +repository = "https://github.com/tomtuamnuq/rusty-chaos-craftor" name = "rusty-chaos-craftor" version = "1.0.0" -authors = ["Tom Krüger <76523782+tomtuamnuq@users.noreply.github.com>"] +readme = "README.md" edition = "2021" rust-version = "1.76" @@ -33,9 +40,9 @@ num-dual = "0.8" # switch manually between local git and upstream egui-plotter = { git = "https://github.com/Gip-Gip/egui-plotter.git", branch = "main" } -perplex_num = { git = "https://github.com/tomtuamnuq/perplex_num.git", branch = "main" } -#egui-plotter = { path = "../egui-plotter" } -#perplex_num = { path = "../perplex_num" } +perplex_num = "0.1" +# egui-plotter = { path = "../egui-plotter" } +# perplex_num = { path = "../perplex_num" } # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/assets/manifest.json b/assets/manifest.json index e9d65e7..bb3cb9b 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -1,6 +1,6 @@ { - "name": "RustyChaosCraftor PWA", - "short_name": "rusty-chaos-craftor-pwa", + "name": "Rusty-Chaos-Craftor", + "short_name": "Chaos Craftor", "icons": [ { "src": "./icon-256.png", diff --git a/assets/sw.js b/assets/sw.js index 0c4ce2c..21671e0 100644 --- a/assets/sw.js +++ b/assets/sw.js @@ -1,3 +1,4 @@ +// progressive web application cache var cacheName = 'rusty-chaos-craftor-pwa'; var filesToCache = [ './', diff --git a/src/chaos/benchmark.rs b/src/chaos/benchmark.rs index e14aaeb..156d491 100644 --- a/src/chaos/benchmark.rs +++ b/src/chaos/benchmark.rs @@ -1,13 +1,12 @@ -use std::{ - sync::{Arc, Mutex}, - thread, -}; -// TODO use wasm threads use super::{ data::{ChaosData, ChaosDataVec, InitialDistributionConfig, ValidStateCheck}, execution::*, }; use anyhow::Error; +use std::{ + sync::{Arc, Mutex}, + thread, +}; use web_time::{Duration, Instant}; pub struct ChaosInitSchema { pub num_samples: usize, @@ -138,10 +137,11 @@ fn chaos_benchmark_run( ChaosDataVec::State4(data) => evaluate_chaos_data(data), ChaosDataVec::ParticleXY(data) => evaluate_chaos_data(data), ChaosDataVec::ParticleXYZ(data) => evaluate_chaos_data(data), - ChaosDataVec::FractalComplex(data) => evaluate_chaos_data(data), // TODO specific for fractal - num iterations - ChaosDataVec::FractalDual(data) => evaluate_chaos_data(data), // TODO specific for fractal - num iterations - ChaosDataVec::FractalPerplex(data) => evaluate_chaos_data(data), // TODO specific for fractal - num iterations - ChaosDataVec::FractalQuaternion(data) => evaluate_chaos_data(data), // TODO specific for fractal - num iterations + // TODO evaluate number of iterations for fractals + ChaosDataVec::FractalComplex(data) => evaluate_chaos_data(data), + ChaosDataVec::FractalDual(data) => evaluate_chaos_data(data), + ChaosDataVec::FractalPerplex(data) => evaluate_chaos_data(data), + ChaosDataVec::FractalQuaternion(data) => evaluate_chaos_data(data), }; Ok(ChaosBenchmarkRun { runtime: elapsed, diff --git a/src/chaos/data/initial_distribution.rs b/src/chaos/data/initial_distribution.rs index e91c5c5..b3bb724 100644 --- a/src/chaos/data/initial_distribution.rs +++ b/src/chaos/data/initial_distribution.rs @@ -196,14 +196,11 @@ impl InitialDistributionVariant { num_points, rng, ), - InitialDistributionVariant::Exponential(d) => { - // TODO check d - data_gen_from_distribution( - rand_distr::Exp::new(d.lambda.to_owned()).unwrap(), - num_points, - rng, - ) - } + InitialDistributionVariant::Exponential(d) => data_gen_from_distribution( + rand_distr::Exp::new(d.lambda.to_owned()).unwrap(), + num_points, + rng, + ), InitialDistributionVariant::LogNormal(d) => data_gen_from_distribution( rand_distr::LogNormal::new(d.mean.to_owned(), d.std_dev.to_owned()).unwrap(), num_points, diff --git a/src/chaos/fractal/fractal_conf.rs b/src/chaos/fractal/fractal_conf.rs index df764cf..cde94af 100644 --- a/src/chaos/fractal/fractal_conf.rs +++ b/src/chaos/fractal/fractal_conf.rs @@ -871,7 +871,6 @@ impl Default for MandelbrotBiomorphComplex { } impl Default for MandelbrotBiomorphDual { fn default() -> Self { - // TODO Dual Self { r: DEFAULT_BIOMORPH_R, m_re: -0.1, @@ -946,7 +945,6 @@ impl Default for JuliaBiomorphComplex { } impl Default for JuliaBiomorphDual { fn default() -> Self { - // TODO Dual Self { r: DEFAULT_BIOMORPH_R, c_re: -0.01, diff --git a/src/chaos/fractal/julia.rs b/src/chaos/fractal/julia.rs index 3d6b4cf..045025c 100644 --- a/src/chaos/fractal/julia.rs +++ b/src/chaos/fractal/julia.rs @@ -52,7 +52,6 @@ impl JuliaPicard { } impl FractalGenerator for JuliaPicard { - // TODO add DOI type Element = E; fn is_set_element(&self, fractal: &mut FractalData) -> bool { self.escape.check_escape(fractal) diff --git a/src/chaos/functions/discrete_maps.rs b/src/chaos/functions/discrete_maps.rs index 754f6f2..669a67a 100644 --- a/src/chaos/functions/discrete_maps.rs +++ b/src/chaos/functions/discrete_maps.rs @@ -596,7 +596,7 @@ impl ChaosDescription for Zaslavskii { } fn reference(&self) -> &'static str { "https://wikipedia.org/wiki/Zaslavskii_map" - } // TODO http://www.scholarpedia.org/article/Zaslavsky_map + } } impl ChaosFormula for Zaslavskii { fn formula(&self) -> &[&'static str] { diff --git a/src/gui/plot/plot_colors.rs b/src/gui/plot/plot_colors.rs index f8bc323..c6728e3 100644 --- a/src/gui/plot/plot_colors.rs +++ b/src/gui/plot/plot_colors.rs @@ -23,7 +23,7 @@ pub enum SeriesColors { BlackWhite, Bone, Copper, - // TODO DerivedColorMap(Vec<(f64, RGBColor)>), + // DerivedColorMap(Vec<(f64, RGBColor)>) possible as well #[default] MandelbrotHSL, ViridisRGB,