Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full_name function broken #107

Open
DavidSagan opened this issue Dec 4, 2024 · 5 comments
Open

full_name function broken #107

DavidSagan opened this issue Dec 4, 2024 · 5 comments

Comments

@DavidSagan
Copy link
Member

julia> full_name(Species("He"))
ERROR: DimensionError: 2 and 0 e are not dimensionally compatible.
Stacktrace:
 [1] _lt
   @ ~/.julia/packages/Unitful/GYzMo/src/quantities.jl:243 [inlined]
 [2] <(x::Quantity{Int64, NoDims, Unitful.FreeUnits{(), NoDims, nothing}}, y::Quantity{Int64, 𝐈 𝐓, Unitful.FreeUnits{(e,), 𝐈 𝐓, nothing}})
   @ Unitful ~/.julia/packages/Unitful/GYzMo/src/quantities.jl:233
 [3] <(x::Int64, y::Quantity{Int64, 𝐈 𝐓, Unitful.FreeUnits{(e,), 𝐈 𝐓, nothing}})
   @ Unitful ~/.julia/packages/Unitful/GYzMo/src/quantities.jl:235
 [4] >(x::Quantity{Int64, 𝐈 𝐓, Unitful.FreeUnits{(e,), 𝐈 𝐓, nothing}}, y::Int64)
   @ Base ./operators.jl:379
 [5] full_name(species::Species)
   @ AtomicAndPhysicalConstants ~/.julia/dev/AtomicAndPhysicalConstants/src/particle_functions.jl:103
 [6] top-level scope
   @ REPL[11]:1
@rot4te
Copy link
Collaborator

rot4te commented Dec 12, 2024

Fixed in the full_name_fix PR

@rot4te rot4te closed this as completed Dec 12, 2024
@DavidSagan DavidSagan reopened this Dec 12, 2024
@DavidSagan
Copy link
Member Author

@rot4te full_name still is broken for atomic species (but sub-atomic is OK). Also changing the name of the function to nameof would be in keeping with the naming of the other functions.

@rot4te
Copy link
Collaborator

rot4te commented Dec 12, 2024 via email

@DavidSagan
Copy link
Member Author

@rot4te Looks like the problem is that in the full_name function something like:

elseif species.charge == -1

is trying to compare species.charge which has units with -1 which does not have units.

@rot4te
Copy link
Collaborator

rot4te commented Dec 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants