Skip to content

Commit

Permalink
start test design
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Apr 19, 2024
1 parent 91fa674 commit 872682e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 37 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on:
- push

jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: 1.9
arch: x64
- name: instantiate environment
run: |
pwd
julia --project=df -e '
using Pkg
Pkg.add("BenchmarkTools")
Pkg.add("Test")
Pkg.add(url="https://github.com/JuliaStellarDynamics/OrbitalElements.jl.git")
Pkg.add(url="https://github.com/JuliaStellarDynamics/DistributionFunctions.jl.git")
ls
julia --project=df -e '
using Pkg
Pkg.develop(PackageSpec(path="/home/runner/work/DistributionFunctions.jl/DistributionFunctions.jl"))'
julia --project=df test/runtests.jl
2 changes: 1 addition & 1 deletion src/Analytic/Isochrone/isotropic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function F(EL::Tuple{Float64,Float64}, df::IsotropicIsochrone)
# rescale dimensionless energy to goes between 0 and 1/2
mE = E/scaleEnergy

return (sqrt(mE)*M*(27.0+2.0*mE*(-1.0+4.0*mE)*(33.0+4.0*mE*(-7.0+2.0*mE))+
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))+
(3.0*(-9.0+4.0*mE*(7.0+4.0*mE))*asin(sqrt(mE)))/sqrt(-((-1.0+mE)*mE))))/
(128.0*sqrt(2.0)*(-1.0+mE)^(4)*scaleDF*(pi)^(3))

Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using DistributionFunctions
using OrbitalElements

using Test

include("test_spheres.jl")
33 changes: 0 additions & 33 deletions test/scratch.jl

This file was deleted.

14 changes: 11 additions & 3 deletions test/test_spheres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ n1,n2 = -1,2

@testset "distributionfunctions" begin
@testset "isochrone" begin
IsoDF = IsotropicIsochrone()
EL = EL_from_ae(1.0,0.5,IsoDF.potential)
resonance = Resonance(n1,n2,IsoDF.potential)
@testset "isotropic" begin
IsoDF = IsotropicIsochrone()
EL = EL_from_ae(1.0,0.5,IsoDF.potential)
resonance = Resonance(n1,n2,IsoDF.potential)
@test F(EL, IsoDF) 0.023905 atol=1e-6
end
@testset "osipkovmerritt" begin

end
end
@testset "plummer" begin
end
end

0 comments on commit 872682e

Please sign in to comment.