Skip to content

Commit 872682e

Browse files
start test design
1 parent 91fa674 commit 872682e

File tree

5 files changed

+47
-37
lines changed

5 files changed

+47
-37
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
on:
3+
- push
4+
5+
jobs:
6+
CI:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: julia-actions/setup-julia@v1
11+
with:
12+
version: 1.9
13+
arch: x64
14+
- name: instantiate environment
15+
run: |
16+
pwd
17+
julia --project=df -e '
18+
using Pkg
19+
Pkg.add("BenchmarkTools")
20+
Pkg.add("Test")
21+
Pkg.add(url="https://github.com/JuliaStellarDynamics/OrbitalElements.jl.git")
22+
Pkg.add(url="https://github.com/JuliaStellarDynamics/DistributionFunctions.jl.git")
23+
ls
24+
julia --project=df -e '
25+
using Pkg
26+
Pkg.develop(PackageSpec(path="/home/runner/work/DistributionFunctions.jl/DistributionFunctions.jl"))'
27+
julia --project=df test/runtests.jl
28+
29+

src/Analytic/Isochrone/isotropic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function F(EL::Tuple{Float64,Float64}, df::IsotropicIsochrone)
2222
# rescale dimensionless energy to goes between 0 and 1/2
2323
mE = E/scaleEnergy
2424

25-
return (sqrt(mE)*M*(27.0+2.0*mE*(-1.0+4.0*mE)*(33.0+4.0*mE*(-7.0+2.0*mE))+
25+
return (sqrt(mE)*df.potential.M*(27.0+2.0*mE*(-1.0+4.0*mE)*(33.0+4.0*mE*(-7.0+2.0*mE))+
2626
(3.0*(-9.0+4.0*mE*(7.0+4.0*mE))*asin(sqrt(mE)))/sqrt(-((-1.0+mE)*mE))))/
2727
(128.0*sqrt(2.0)*(-1.0+mE)^(4)*scaleDF*(pi)^(3))
2828

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using DistributionFunctions
2+
using OrbitalElements
3+
4+
using Test
5+
6+
include("test_spheres.jl")

test/scratch.jl

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/test_spheres.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ n1,n2 = -1,2
99

1010
@testset "distributionfunctions" begin
1111
@testset "isochrone" begin
12-
IsoDF = IsotropicIsochrone()
13-
EL = EL_from_ae(1.0,0.5,IsoDF.potential)
14-
resonance = Resonance(n1,n2,IsoDF.potential)
12+
@testset "isotropic" begin
13+
IsoDF = IsotropicIsochrone()
14+
EL = EL_from_ae(1.0,0.5,IsoDF.potential)
15+
resonance = Resonance(n1,n2,IsoDF.potential)
16+
@test F(EL, IsoDF) 0.023905 atol=1e-6
17+
end
18+
@testset "osipkovmerritt" begin
19+
20+
end
21+
end
22+
@testset "plummer" begin
1523
end
1624
end

0 commit comments

Comments
 (0)