Skip to content

Commit

Permalink
test plasma_beta against plasmapy
Browse files Browse the repository at this point in the history
  • Loading branch information
adamslc committed Dec 30, 2024
1 parent e9bda58 commit 6d0d563
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/Manifest.toml
/docs/Manifest.toml
/docs/build/
.CondaPkg/
3 changes: 3 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
astropy = ""
plasmapy = ""
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ UnitfulEquivalences = "da9c4bc3-91c8-4f02-8a40-6b990d2a7e0c"
Aqua = "0.8"
LinearAlgebra = "1.10"
PermuteArgs = "1.2.1"
PythonCall = "0.9.23"
Test = "1.10"
Unitful = "1.0"
UnitfulEquivalences = "0.2"
Expand All @@ -20,7 +21,8 @@ julia = "1.10"
[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "LinearAlgebra", "Test"]
test = ["Aqua", "LinearAlgebra", "PythonCall", "Test"]
7 changes: 5 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ using Test
using Aqua
using Unitful
using LinearAlgebra
using PythonCall

units = pyimport("astropy.units")
formulary = pyimport("plasmapy.formulary")

@testset "PlasmaFormulary.jl" begin
@testset "Code quality (Aqua.jl)" begin
Expand Down Expand Up @@ -35,7 +39,6 @@ using LinearAlgebra
B = 0.1u"T"
@test plasma_beta(T, n, B) == plasma_beta(n, B, PlasmaFormulary.temperature(T)) == plasma_beta(n, T, B)

units = pyimport("astropy.units")
formulary = pyimport("plasmapy.formulary")
@test pyconvert(Float64, pyfloat(formulary.lengths.Debye_length(10 * units.eV, 1e19 / units.m^3) / units.m)) ustrip(u"m", PlasmaFormulary.debye_length(1e19 * u"m^-3", 10 * u"eV")) rtol=1e-3
end
end

0 comments on commit 6d0d563

Please sign in to comment.