Skip to content

Commit

Permalink
Fix Mixture display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stillyslalom committed Jan 17, 2023
1 parent 22fbf04 commit 4f6efd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PyThermo"
uuid = "6fae04a5-42e9-4d0c-90a8-26d1a9434b6b"
authors = ["Alex Ames <[email protected]> and contributors"]
version = "0.2.1"
version = "0.2.2"

[deps]
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
Expand Down
2 changes: 1 addition & 1 deletion src/PyThermo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

2 comments on commit 4f6efd4

@stillyslalom
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/75809

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.2 -m "<description of version>" 4f6efd4090a87093bbfae18490fe624ad1ad5dbb
git push origin v0.2.2

Please sign in to comment.