diff --git a/Project.toml b/Project.toml index 5ac41a1..6c391d9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PyThermo" uuid = "6fae04a5-42e9-4d0c-90a8-26d1a9434b6b" authors = ["Alex Ames and contributors"] -version = "0.2.1" +version = "0.2.2" [deps] CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab" diff --git a/src/PyThermo.jl b/src/PyThermo.jl index da80998..c1ba129 100644 --- a/src/PyThermo.jl +++ b/src/PyThermo.jl @@ -152,7 +152,7 @@ function composition_string(mix) # s *= @sprintf("%s: %0.3g, ", species, χ) # end # s[1:end-2] * "}" - join([@sprintf("%0.3g%s %s", 100χ, '%', species) for (species, χ) in zip(species_str, mix.zs)], ", ") + join([@sprintf("%0.3g%s %s", 100*pyconvert(Float64, χ), '%', species) for (species, χ) in zip(species_str, mix.zs)], ", ") end composition_string(s::Species) = s.name diff --git a/test/runtests.jl b/test/runtests.jl index 3e1d4e2..bd3cec5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,6 +17,9 @@ using Aqua ρ_HeAce = HeAce.rho @test !isnothing(ρ_HeAce) @test isapprox(ρ_HeAce, 0.2747138795604815, rtol=3e-3) + + # test mixture display for the case where mole fractions do not sum to 1 + @test occursin("Mixture", repr(Mixture(["N2" => 1.0, "Acetone" => 0.1]))) end end