Skip to content

Commit 4f6efd4

Browse files
committed
Fix Mixture display bug
1 parent 22fbf04 commit 4f6efd4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PyThermo"
22
uuid = "6fae04a5-42e9-4d0c-90a8-26d1a9434b6b"
33
authors = ["Alex Ames <alexander.m.ames@gmail.com> and contributors"]
4-
version = "0.2.1"
4+
version = "0.2.2"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"

src/PyThermo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function composition_string(mix)
152152
# s *= @sprintf("%s: %0.3g, ", species, χ)
153153
# end
154154
# s[1:end-2] * "}"
155-
join([@sprintf("%0.3g%s %s", 100χ, '%', species) for (species, χ) in zip(species_str, mix.zs)], ", ")
155+
join([@sprintf("%0.3g%s %s", 100*pyconvert(Float64, χ), '%', species) for (species, χ) in zip(species_str, mix.zs)], ", ")
156156
end
157157
composition_string(s::Species) = s.name
158158

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ using Aqua
1717
ρ_HeAce = HeAce.rho
1818
@test !isnothing(ρ_HeAce)
1919
@test isapprox(ρ_HeAce, 0.2747138795604815, rtol=3e-3)
20+
21+
# test mixture display for the case where mole fractions do not sum to 1
22+
@test occursin("Mixture", repr(Mixture(["N2" => 1.0, "Acetone" => 0.1])))
2023
end
2124
end
2225

0 commit comments

Comments
 (0)