-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bugfixes for #113, 112, 109 * some io checks for ChemicalSpecies * fixing default neutron number * add atomic_number(::Symbol) * bump v0.4.1 --------- Co-authored-by: Christoph Ortner <christohortner@gmail.com>
- Loading branch information
Showing
5 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
using AtomsBase | ||
using Unitful | ||
using UnitfulAtomic | ||
using Test | ||
|
||
## | ||
|
||
@testset "ChemicalSpecies" begin | ||
|
||
symbols = [:H, :He, :Li, :Be, :B, :C, :N, :O, :F, :Ne, | ||
:Na, :Mg, :Al, :Si, :P, :S, :Cl, :Ar, :K, :Ca] | ||
|
||
# https://thechemicalelements.com/protons-neutrons-electrons-of-elements/ | ||
n_neut = [0, 2, 4, 5, 6, 6, 7, 8, 10, 10, | ||
12, 12, 14, 14, 16, 16, 18, 22, 20, 20] | ||
|
||
for z = 1:10 | ||
@test ChemicalSpecies(symbols[z]) == ChemicalSpecies(z) == ChemicalSpecies(z, n_neut[z], 0) | ||
end | ||
|
||
@test ChemicalSpecies(:D) == ChemicalSpecies(1, 1, 0) | ||
@test ChemicalSpecies(:C13) == ChemicalSpecies(6, 7, 0) | ||
|
||
@test atomic_number( UInt(8) ) == 8 | ||
@test atomic_number( Int16(12) ) == 12 | ||
|
||
@test "$(ChemicalSpecies(:O))" == "$(ChemicalSpecies(8))" == "O" | ||
@test "$(ChemicalSpecies(8, 8, 0))" == "O" | ||
@test "$(ChemicalSpecies(:C; n_neutrons=6))" == "C" | ||
@test "$(ChemicalSpecies(:C; n_neutrons=7))" == "C13" | ||
|
||
end |