diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 193311b..ce39827 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: version: - - '1.6.0' + - '1.10.4' os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index d10772a..8b13719 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: [1.6.0] + julia-version: [1.10.4] julia-arch: [x64] os: [ubuntu-latest] steps: diff --git a/.github/workflows/CompatHelperManual.yml b/.github/workflows/CompatHelperManual.yml index 012fd97..9a6fd21 100644 --- a/.github/workflows/CompatHelperManual.yml +++ b/.github/workflows/CompatHelperManual.yml @@ -9,7 +9,7 @@ jobs: if: "contains(github.event.head_commit.message, '[compat]')" strategy: matrix: - julia-version: [1.6.0] + julia-version: [1.10.4] julia-arch: [x64] os: [ubuntu-latest] steps: diff --git a/.github/workflows/ManuallyBuildDoc.yml b/.github/workflows/ManuallyBuildDoc.yml index 7d26ea8..5943dc8 100644 --- a/.github/workflows/ManuallyBuildDoc.yml +++ b/.github/workflows/ManuallyBuildDoc.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v1 - uses: julia-actions/setup-julia@latest with: - version: '1.6.0' + version: '1.10.4' - run: julia --project=docs -e ' using Pkg; Pkg.add("Documenter"); diff --git a/src/PhysicalParticles.jl b/src/PhysicalParticles.jl index 5b2bcfb..3ca6dab 100644 --- a/src/PhysicalParticles.jl +++ b/src/PhysicalParticles.jl @@ -24,7 +24,7 @@ import Base: +, -, *, /, zero, length, iterate, real, show, ==, #getproperty, convert, Array, Vector, one, zero, isone, iszero, isnan, isinf, oneunit, isapprox, parse -import Random: rand +import Random: rand, randn import LinearAlgebra: norm, normalize, dot, cross, × import Statistics: mean, std, var, median, middle diff --git a/src/Random.jl b/src/Random.jl index 79324c0..55f9c4b 100644 --- a/src/Random.jl +++ b/src/Random.jl @@ -1,5 +1,7 @@ Random.rand(rng::AbstractRNG, ::Random.SamplerType{PVector2D{T}}) where T = PVector2D(rand(rng,T), rand(rng,T)) Random.rand(rng::AbstractRNG, ::Random.SamplerType{PVector{T}}) where T = PVector(rand(rng,T), rand(rng,T), rand(rng,T)) +Random.randn(rng::AbstractRNG, ::Type{PVector2D{T}}) where T = PVector2D(randn(rng,T), randn(rng,T)) +Random.randn(rng::AbstractRNG, ::Type{PVector{T}}) where T = PVector(randn(rng,T), randn(rng,T), randn(rng,T)) """ randn_pvector2d(n::Integer, T::DataType = Float64) diff --git a/test/testPhysicalParticles.jl b/test/testPhysicalParticles.jl index bdfc892..01f19fd 100644 --- a/test/testPhysicalParticles.jl +++ b/test/testPhysicalParticles.jl @@ -70,6 +70,8 @@ end @test p_Star2D[1].Pos == a[1] # randn + randn(PVector2D{Float64}) + a_randn = randn_pvector2d(5) @test length(a_randn) == 5 @@ -199,6 +201,8 @@ end @test_throws ErrorException assign_particles(ps, :Pos, [PVector(u"m")]) # randn + randn(PVector{Float64}) + a_randn = randn_pvector(5) @test length(a_randn) == 5