Skip to content

Commit

Permalink
use error instead of assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Joroks committed Jun 22, 2024
1 parent f43283f commit b4e93d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LAMMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ The returned Array is decoupled from the internal state of the LAMMPS instance.
Starting form LAMMPS version `17 Apr 2024` this should no longer be an issue, as LAMMPS then throws an error instead of a warning.
"""
function gather(lmp::LMP, name::String, T::Union{Type{Int32}, Type{Float64}}, ids::Union{Nothing, Array{Int32}}=nothing)
@assert name != "mass" "scattering/gathering mass is currently not supported! Use `extract_atom()` instead."
name == "mass" && error("scattering/gathering mass is currently not supported! Use `extract_atom()` instead.")

count = _get_count(lmp, name)
_T = _get_T(lmp, name)
Expand Down Expand Up @@ -429,7 +429,7 @@ Compute entities have the prefix `c_`, fix entities use the prefix `f_`, and per
Starting form LAMMPS version `17 Apr 2024` this should no longer be an issue, as LAMMPS then throws an error instead of a warning.
"""
function scatter!(lmp::LMP, name::String, data::VecOrMat{T}, ids::Union{Nothing, Array{Int32}}=nothing) where T<:Union{Int32, Float64}
@assert name != "mass" "scattering/gathering mass is currently not supported! Use `extract_atom()` instead."
name == "mass" && error("scattering/gathering mass is currently not supported! Use `extract_atom()` instead.")

count = _get_count(lmp, name)
_T = _get_T(lmp, name)
Expand Down

0 comments on commit b4e93d5

Please sign in to comment.