From a4950979fe2c9c73031a7ce4dc17eac04f1f6c90 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sat, 19 Mar 2022 23:11:03 +0100 Subject: [PATCH] Fix typos --- .JuliaFormatter.toml | 2 +- README.adoc | 8 ++++---- analysis/mean_kappa.jl | 2 +- analysis/mean_squared_displacement.jl | 2 +- .../radial_distribution_function.jl | 2 +- analysis/reward_discount_analysis.jl | 2 +- graphics/center_of_mass.jl | 2 +- graphics/elliptical_distance.jl | 2 +- graphics/{pontential.jl => potential.jl} | 2 +- graphics/radial_distribution.jl | 2 +- graphics/reward_shaping.jl | 2 +- graphics/verlet_and_cell_lists.jl | 2 +- src/Benchmark.jl | 2 +- src/Error.jl | 2 +- src/Geometry.jl | 2 +- src/PreVectors.jl | 2 +- src/RL/Env.jl | 2 +- src/RL/EnvHelper.jl | 2 +- src/RL/Envs/COMCompassEnv.jl | 2 +- src/RL/Envs/LocalCOMEnv.jl | 2 +- src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv.jl | 2 +- src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv2.jl | 2 +- src/RL/Envs/NearestNeighborEnv.jl | 2 +- src/RL/Envs/OriginCompassEnv.jl | 2 +- src/RL/Envs/OriginEnv.jl | 2 +- src/RL/Hooks.jl | 2 +- src/RL/RL.jl | 2 +- src/RL/Reward.jl | 2 +- src/RL/States.jl | 2 +- src/RL/latex_table.jl | 2 +- src/ReCo.jl | 2 +- src/Shape.jl | 2 +- src/Visualization/Animation.jl | 2 +- src/Visualization/RewardsPlot.jl | 2 +- src/Visualization/SnapshotPlot.jl | 2 +- src/Visualization/common.jl | 2 +- src/Visualization/common_CairoMakie.jl | 2 +- src/data.jl | 2 +- src/run.jl | 4 ++-- src/setup.jl | 2 +- test/runtests.jl | 2 +- 41 files changed, 45 insertions(+), 45 deletions(-) rename graphics/{pontential.jl => potential.jl} (99%) diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index c743950..323237b 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1 +1 @@ -style = "blue" \ No newline at end of file +style = "blue" diff --git a/README.adoc b/README.adoc index 8b954c5..90d80f2 100644 --- a/README.adoc +++ b/README.adoc @@ -8,7 +8,7 @@ image:https://img.shields.io/badge/code%20style-blue-4495d1.svg[Code Style: Blue == Setup -The following steps from the setup have to be followed everytime before running anything in the following sections. An exception is installing the dependencies which has to be done only the first time. +The following steps from the setup have to be followed every time before running anything in the following sections. An exception is installing the dependencies which has to be done only the first time. === Launch Julia @@ -24,7 +24,7 @@ julia --threads auto === Activating environment -After launching Julia, the package environment has to be activated by running the follwing in the REPL: +After launching Julia, the package environment has to be activated by running the following in the REPL: [source,julia] ---- @@ -121,7 +121,7 @@ The documentation of `run_rl` includes all possible optional arguments. env_helper.shared.agent.policy.learner.approximator.table ---- -To generate a LaTeX table with the states and actions combintation names for the Q-matrix, run the follwing: +To generate a LaTeX table with the states and actions combintation names for the Q-matrix, run the following: [source,julia] ---- @@ -203,4 +203,4 @@ The output is `ReCo.jl/exports/graphics/reward_discount_analysis.pdf`. == Graphics -The directory `ReCo.jl/graphics` has some Julia files that generate graphics related to this package. The function in every file that has to be run to generate the corresponding graphics starts with `plot_` or `gen_`. The output is placed in `ReCo.jl/exports/graphics`. \ No newline at end of file +The directory `ReCo.jl/graphics` has some Julia files that generate graphics related to this package. The function in every file that has to be run to generate the corresponding graphics starts with `plot_` or `gen_`. The output is placed in `ReCo.jl/exports/graphics`. diff --git a/analysis/mean_kappa.jl b/analysis/mean_kappa.jl index 7c74438..8239c99 100644 --- a/analysis/mean_kappa.jl +++ b/analysis/mean_kappa.jl @@ -110,4 +110,4 @@ function plot_mean_κ(; rl_dir::String, n_last_episodes::Int64) save_fig("mean_kappa.pdf", fig; parent_dir=rl_dir) return nothing -end \ No newline at end of file +end diff --git a/analysis/mean_squared_displacement.jl b/analysis/mean_squared_displacement.jl index 862ab3f..ff1203b 100644 --- a/analysis/mean_squared_displacement.jl +++ b/analysis/mean_squared_displacement.jl @@ -245,4 +245,4 @@ function run_random_walk() plot_random_walk(; T=100_000.0, v₀=0.0, seed=12345) return nothing -end \ No newline at end of file +end diff --git a/analysis/radial_distribution_function/radial_distribution_function.jl b/analysis/radial_distribution_function/radial_distribution_function.jl index 2f49db0..ef52f3e 100644 --- a/analysis/radial_distribution_function/radial_distribution_function.jl +++ b/analysis/radial_distribution_function/radial_distribution_function.jl @@ -238,4 +238,4 @@ function run_radial_distribution_analysis() ) return nothing -end \ No newline at end of file +end diff --git a/analysis/reward_discount_analysis.jl b/analysis/reward_discount_analysis.jl index 0df6b4c..ede55e9 100644 --- a/analysis/reward_discount_analysis.jl +++ b/analysis/reward_discount_analysis.jl @@ -75,4 +75,4 @@ function run_reward_discount_analysis() ) return nothing -end \ No newline at end of file +end diff --git a/graphics/center_of_mass.jl b/graphics/center_of_mass.jl index 0f1bda2..9967b78 100644 --- a/graphics/center_of_mass.jl +++ b/graphics/center_of_mass.jl @@ -127,4 +127,4 @@ function gen_COM_graphics() finish() return nothing -end \ No newline at end of file +end diff --git a/graphics/elliptical_distance.jl b/graphics/elliptical_distance.jl index 16682c2..e585ec7 100644 --- a/graphics/elliptical_distance.jl +++ b/graphics/elliptical_distance.jl @@ -28,4 +28,4 @@ function gen_elliptical_distance_graphics() save_fig("elliptical_distance.pdf", fig) return nothing -end \ No newline at end of file +end diff --git a/graphics/pontential.jl b/graphics/potential.jl similarity index 99% rename from graphics/pontential.jl rename to graphics/potential.jl index c29a4d1..3063458 100644 --- a/graphics/pontential.jl +++ b/graphics/potential.jl @@ -57,4 +57,4 @@ function plot_potentials() save_fig("potential.pdf", fig) return nothing -end \ No newline at end of file +end diff --git a/graphics/radial_distribution.jl b/graphics/radial_distribution.jl index 9eda94d..e7a1648 100644 --- a/graphics/radial_distribution.jl +++ b/graphics/radial_distribution.jl @@ -84,4 +84,4 @@ function gen_rdf_graphics() finish() return nothing -end \ No newline at end of file +end diff --git a/graphics/reward_shaping.jl b/graphics/reward_shaping.jl index d77dd8f..f22cf62 100644 --- a/graphics/reward_shaping.jl +++ b/graphics/reward_shaping.jl @@ -26,4 +26,4 @@ function plot_reward_function() save_fig("reward_shaping.pdf", fig) return nothing -end \ No newline at end of file +end diff --git a/graphics/verlet_and_cell_lists.jl b/graphics/verlet_and_cell_lists.jl index a1e2cae..1dbd019 100644 --- a/graphics/verlet_and_cell_lists.jl +++ b/graphics/verlet_and_cell_lists.jl @@ -93,4 +93,4 @@ function gen_verlet_and_cell_lists_graphics() finish() return nothing -end \ No newline at end of file +end diff --git a/src/Benchmark.jl b/src/Benchmark.jl index 9310fba..531c9fa 100644 --- a/src/Benchmark.jl +++ b/src/Benchmark.jl @@ -46,4 +46,4 @@ function run_benchmarks( return dir end -end # module \ No newline at end of file +end # module diff --git a/src/Error.jl b/src/Error.jl index 23105fb..c3e52b4 100644 --- a/src/Error.jl +++ b/src/Error.jl @@ -6,4 +6,4 @@ function method_not_implemented() return error("Method not implemented!") end -end # module \ No newline at end of file +end # module diff --git a/src/Geometry.jl b/src/Geometry.jl index fc78267..96d931f 100644 --- a/src/Geometry.jl +++ b/src/Geometry.jl @@ -26,4 +26,4 @@ function norm2d(v::SVector{2,R}) where {R<:Real} return sqrt(sq_norm2d(v)) end -end # module \ No newline at end of file +end # module diff --git a/src/PreVectors.jl b/src/PreVectors.jl index 554150e..fa7c833 100644 --- a/src/PreVectors.jl +++ b/src/PreVectors.jl @@ -32,4 +32,4 @@ function iterate(pv::PreVector, state::UInt64=UInt64(1)) end end -end # module \ No newline at end of file +end # module diff --git a/src/RL/Env.jl b/src/RL/Env.jl index 8fe4f34..f16dc65 100644 --- a/src/RL/Env.jl +++ b/src/RL/Env.jl @@ -118,4 +118,4 @@ function gen_action_spaces_labels( actions_labels::NTuple{N,String}, action_spaces::NTuple{N,AbstractRange} ) where {N} return [gen_action_space_labels(actions_labels[i], action_spaces[i]) for i in 1:N] -end \ No newline at end of file +end diff --git a/src/RL/EnvHelper.jl b/src/RL/EnvHelper.jl index 8e0084f..5ab2fa4 100644 --- a/src/RL/EnvHelper.jl +++ b/src/RL/EnvHelper.jl @@ -53,4 +53,4 @@ end function get_env_agent_hook(env_helper::EnvHelper) return (env_helper.shared.env, env_helper.shared.agent, env_helper.shared.hook) -end \ No newline at end of file +end diff --git a/src/RL/Envs/COMCompassEnv.jl b/src/RL/Envs/COMCompassEnv.jl index 30cc405..6a8baf2 100644 --- a/src/RL/Envs/COMCompassEnv.jl +++ b/src/RL/Envs/COMCompassEnv.jl @@ -158,4 +158,4 @@ function update_reward!( set_normalized_reward!(env, reward, env_helper) return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/LocalCOMEnv.jl b/src/RL/Envs/LocalCOMEnv.jl index edb0321..4f1845c 100644 --- a/src/RL/Envs/LocalCOMEnv.jl +++ b/src/RL/Envs/LocalCOMEnv.jl @@ -145,4 +145,4 @@ function update_reward!( end return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv.jl b/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv.jl index b885eea..c6f8b3a 100644 --- a/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv.jl +++ b/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv.jl @@ -208,4 +208,4 @@ function update_reward!( end return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv2.jl b/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv2.jl index 63cace9..05724ff 100644 --- a/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv2.jl +++ b/src/RL/Envs/LocalCOMWithAdditionalShapeRewardEnv2.jl @@ -189,4 +189,4 @@ function update_reward!( end return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/NearestNeighborEnv.jl b/src/RL/Envs/NearestNeighborEnv.jl index d5c048a..5aaa7ff 100644 --- a/src/RL/Envs/NearestNeighborEnv.jl +++ b/src/RL/Envs/NearestNeighborEnv.jl @@ -146,4 +146,4 @@ function update_reward!( set_normalized_reward!(env, reward, env_helper) return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/OriginCompassEnv.jl b/src/RL/Envs/OriginCompassEnv.jl index b02b0be..8a4717a 100644 --- a/src/RL/Envs/OriginCompassEnv.jl +++ b/src/RL/Envs/OriginCompassEnv.jl @@ -156,4 +156,4 @@ function update_reward!( set_normalized_reward!(env, reward, env_helper) return nothing -end \ No newline at end of file +end diff --git a/src/RL/Envs/OriginEnv.jl b/src/RL/Envs/OriginEnv.jl index c0084d9..8e2cd24 100644 --- a/src/RL/Envs/OriginEnv.jl +++ b/src/RL/Envs/OriginEnv.jl @@ -104,4 +104,4 @@ function update_reward!( set_normalized_reward!(env, reward, env_helper) return nothing -end \ No newline at end of file +end diff --git a/src/RL/Hooks.jl b/src/RL/Hooks.jl index f282f17..ee7166b 100644 --- a/src/RL/Hooks.jl +++ b/src/RL/Hooks.jl @@ -83,4 +83,4 @@ end function copy_states_to_old_states_hook!(::Nothing) return nothing -end \ No newline at end of file +end diff --git a/src/RL/RL.jl b/src/RL/RL.jl index 75cdb7d..e4fa8b0 100644 --- a/src/RL/RL.jl +++ b/src/RL/RL.jl @@ -241,4 +241,4 @@ include("Envs/LocalCOMEnv.jl") include("Envs/OriginCompassEnv.jl") include("Envs/COMCompassEnv.jl") -end # module \ No newline at end of file +end # module diff --git a/src/RL/Reward.jl b/src/RL/Reward.jl index de388cd..e3279dc 100644 --- a/src/RL/Reward.jl +++ b/src/RL/Reward.jl @@ -9,4 +9,4 @@ function set_normalized_reward!( env.shared.reward = unnormalized_reward / normalization return nothing -end \ No newline at end of file +end diff --git a/src/RL/States.jl b/src/RL/States.jl index 5424c4a..a89e9aa 100644 --- a/src/RL/States.jl +++ b/src/RL/States.jl @@ -52,4 +52,4 @@ function find_state_ind(value::Float64, state_space::Vector{Interval})::Int64 return ind end end -end \ No newline at end of file +end diff --git a/src/RL/latex_table.jl b/src/RL/latex_table.jl index 18b19b5..e0ff49f 100644 --- a/src/RL/latex_table.jl +++ b/src/RL/latex_table.jl @@ -54,4 +54,4 @@ function latex_rl_table(env_helper::ReCo.RL.EnvHelper, filename_without_extensio latex_table(df, "$filename_without_extension.tex") return nothing -end \ No newline at end of file +end diff --git a/src/ReCo.jl b/src/ReCo.jl index cbe4ed5..4a76393 100644 --- a/src/ReCo.jl +++ b/src/ReCo.jl @@ -54,4 +54,4 @@ using .SnapshotPlot include("Visualization/RewardsPlot.jl") using .RewardsPlot -end # module \ No newline at end of file +end # module diff --git a/src/Shape.jl b/src/Shape.jl index dc98111..efc0451 100644 --- a/src/Shape.jl +++ b/src/Shape.jl @@ -172,4 +172,4 @@ function elliptical_distance( return sqrt(x^2 + (y / elliptical_b_a_ratio)^2) end -end # module \ No newline at end of file +end # module diff --git a/src/Visualization/Animation.jl b/src/Visualization/Animation.jl index 3a3ddd6..c9ada05 100644 --- a/src/Visualization/Animation.jl +++ b/src/Visualization/Animation.jl @@ -279,4 +279,4 @@ function animate( return nothing end -end # module \ No newline at end of file +end # module diff --git a/src/Visualization/RewardsPlot.jl b/src/Visualization/RewardsPlot.jl index 3926350..272f8c0 100644 --- a/src/Visualization/RewardsPlot.jl +++ b/src/Visualization/RewardsPlot.jl @@ -51,4 +51,4 @@ function plot_rewards( return nothing end -end # module \ No newline at end of file +end # module diff --git a/src/Visualization/SnapshotPlot.jl b/src/Visualization/SnapshotPlot.jl index a0ddf6d..279c9af 100644 --- a/src/Visualization/SnapshotPlot.jl +++ b/src/Visualization/SnapshotPlot.jl @@ -112,4 +112,4 @@ function plot_snapshot( return nothing end -end # module \ No newline at end of file +end # module diff --git a/src/Visualization/common.jl b/src/Visualization/common.jl index 29c589a..3a27d84 100644 --- a/src/Visualization/common.jl +++ b/src/Visualization/common.jl @@ -26,4 +26,4 @@ function gen_axis_and_colorbar( Colorbar(fig[1, 2]; limits=(0, 2), colormap=color_scheme, label=L"\varphi / \pi") return (ax, color_scheme) -end \ No newline at end of file +end diff --git a/src/Visualization/common_CairoMakie.jl b/src/Visualization/common_CairoMakie.jl index e00f9f5..d183db6 100644 --- a/src/Visualization/common_CairoMakie.jl +++ b/src/Visualization/common_CairoMakie.jl @@ -28,4 +28,4 @@ function save_fig(filename::String, fig::Figure; parent_dir="exports/graphics") save("$parent_dir/$filename", fig; pt_per_unit=1) return nothing -end \ No newline at end of file +end diff --git a/src/data.jl b/src/data.jl index c04cc53..0e61f88 100644 --- a/src/data.jl +++ b/src/data.jl @@ -185,4 +185,4 @@ function get_bundle_to_snapshot( return (bundle, bundle_snapshot) end end -end \ No newline at end of file +end diff --git a/src/run.jl b/src/run.jl index 4b76661..1b02ca9 100644 --- a/src/run.jl +++ b/src/run.jl @@ -27,7 +27,7 @@ Return `nothing`. - `duration::Float64`: Duration of the simulation. - `snapshot_at::Float64=$DEFAULT_SNAPSHOT_AT`: Snapshot time interval. - `seed::Int64=$DEFAULT_SEED`: Random number generator seed. -- `n_bundle_snapshots::Int64=$DEFAULT_N_BUNDLE_SNAPSHOTS`: Number of snapshots in a bundle. This number is relevant for long simulations that can be stopped while running. A simulation can be continued from the last bundle of snapshots. If the number of snapshots in a bundle is too high and the simulation is stopped, many of the last snapshots can be lost. A low number results in high IO since snapshots are then bundled and stored more often. For example, setting this number to 1 results in saving every snapshot immediately without bundeling it with other snapshots which would be more efficient. Setting the number to 1000 could mean loosing 999 snapshots in the worst case if the simulation is stopped before having 1000 snapshots to bundle and save. +- `n_bundle_snapshots::Int64=$DEFAULT_N_BUNDLE_SNAPSHOTS`: Number of snapshots in a bundle. This number is relevant for long simulations that can be stopped while running. A simulation can be continued from the last bundle of snapshots. If the number of snapshots in a bundle is too high and the simulation is stopped, many of the last snapshots can be lost. A low number results in high IO since snapshots are then bundled and stored more often. For example, setting this number to 1 results in saving every snapshot immediately without bundling it with other snapshots which would be more efficient. Setting the number to 1000 could mean loosing 999 snapshots in the worst case if the simulation is stopped before having 1000 snapshots to bundle and save. - `env_helper::Union{RL.EnvHelper,Nothing}=nothing`: Environment helper. It should be left as the default `nothing` unless this function is used internally for reinforcement learning. - `show_progress::Bool=$DEFAULT_SHOW_PROGRESS`: Show simulation progress bar. """ @@ -144,4 +144,4 @@ function run_sim( ) return nothing -end \ No newline at end of file +end diff --git a/src/setup.jl b/src/setup.jl index 81e7a81..fdb45ac 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -199,4 +199,4 @@ function init_sim(; return init_sim_with_sim_consts( sim_consts; exports_dir=exports_dir, parent_dir=parent_dir, comment=comment ) -end \ No newline at end of file +end diff --git a/test/runtests.jl b/test/runtests.jl index 75db34c..bcbdf33 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -73,4 +73,4 @@ end @testset "gyration_tensor" begin @test ReCo.Shape.gyration_tensor_eigvals_ratio(particles, half_box_len) == 1.0 end -end \ No newline at end of file +end