Skip to content

Commit

Permalink
doc: Update charge number names to use lowercase 'z'
Browse files Browse the repository at this point in the history
The charge number names in the code have been updated to use lowercase 'z' instead of uppercase 'Z' for consistency and clarity.
  • Loading branch information
Beforerr committed Nov 15, 2024
1 parent 7411b5e commit 3daffab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions docs/src/manual/construction.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fe2 = Particle("Fe2-") # Iron(-II)
fe56 = Particle("Fe-56") # Iron-56
u235 = Particle("U-235") # Uranium-235
println("Iron: Z = $(atomic_number(fe))")
println("Iron: z = $(atomic_number(fe))")
println("Iron(III): charge = $(charge(fe3))")
println("Iron-56: A = $(mass_number(fe56))")
```
Expand Down Expand Up @@ -63,7 +63,7 @@ d = Particle("deuteron") # D⁺
t = Particle("triton") # T⁺
println("Electron charge: $(charge(e))")
println("Alpha particle: Z = $(atomic_number(α)), A = $(mass_number(α))")
println("Alpha particle: z = $(atomic_number(α)), A = $(mass_number(α))")
println("Deuteron mass number: $(mass_number(d))")
```

Expand All @@ -79,11 +79,11 @@ fe = Particle(26) # Iron
u = Particle(92) # Uranium
# With mass number and charge
fe56_3plus = Particle(26, mass_numb=56, Z=3) # Fe-56³⁺
u235_2plus = Particle(92, mass_numb=235, Z=2) # U-235²⁺
fe56_3plus = Particle(26, mass_numb=56, z=3) # Fe-56³⁺
u235_2plus = Particle(92, mass_numb=235, z=2) # U-235²⁺
println("Iron: Z = $(atomic_number(fe))")
println("U-235²⁺: Z = $(atomic_number(u235_2plus)), A = $(mass_number(u235_2plus))")
println("Iron: z = $(atomic_number(fe))")
println("U-235²⁺: z = $(atomic_number(u235_2plus)), A = $(mass_number(u235_2plus))")
```

## Convenience Constructors
Expand Down
2 changes: 1 addition & 1 deletion docs/src/manual/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ p = proton()
# Using atomic numbers
iron = Particle(26) # Fe
helium = Particle(2, mass_numb=4, Z=2) # He⁴²⁺
helium = Particle(2, mass_numb=4, z=2) # He⁴²⁺
```

### Accessing Properties
Expand Down
12 changes: 6 additions & 6 deletions test/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ end
@testset "String constructor with keywords" begin
@test Particle("Fe").charge_number == 0
@test Particle("Fe 2+").charge_number == 2
@test Particle("Fe"; Z=2).charge_number == 2
@test Particle("Fe 2+"; Z=2).charge_number == 2
@test_throws ArgumentError Particle("Fe 2+"; Z=3)
@test Particle("Fe"; z=2).charge_number == 2
@test Particle("Fe 2+"; z=2).charge_number == 2
@test_throws ArgumentError Particle("Fe 2+"; z=3)

@test Particle("Fe").mass_number == 56
@test Particle("Fe-54").mass_number == 54
Expand All @@ -60,7 +60,7 @@ end
@test atomic_number(iron) == 26

# Test with mass number and charge
he4 = Particle(2; mass_numb=4, Z=2)
he4 = Particle(2; mass_numb=4, z=2)
@test atomic_number(he4) == 2
@test mass_number(he4) == 4
@test charge(he4) == 2q
Expand All @@ -71,8 +71,8 @@ end
end

@testset "Construct from AbstractParticle" begin
p1 = Particle("Fe"; mass_numb=56, Z=2)
p2 = Particle(p1; mass_numb=54, Z=3)
p1 = Particle("Fe"; mass_numb=56, z=2)
p2 = Particle(p1; mass_numb=54, z=3)
@test p2.symbol == p1.symbol
@test p2.charge_number == 3
@test p2.mass_number == 54
Expand Down

0 comments on commit 3daffab

Please sign in to comment.