-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add system level property definitions removed in AtomsBase 0.5
- Loading branch information
1 parent
493696e
commit ba88d15
Showing
3 changed files
with
23 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Workaround for Unitful StaticMatrix not working. | ||
# See: https://github.com/PainterQubits/Unitful.jl/issues/538 | ||
function Base.inv(x::StaticMatrix{N,M,T}) where {N,M,T <: Unitful.AbstractQuantity} | ||
m = inv(ustrip.(x)) | ||
iq = eltype(m) | ||
reinterpret( | ||
Unitful.Quantity{iq, inv(Unitful.dimension(T)), typeof(inv(unit(T)))}, | ||
m | ||
) | ||
end | ||
|
||
# These were removed in the AtomsBase 0.4 update | ||
Base.position(sys::AbstractSystem) = position.(sys, :) | ||
AtomsBase.atomic_symbol(sys::AbstractSystem) = atomic_symbol.(species(sys, :)) | ||
AtomsBase.atomic_number(sys::AbstractSystem) = atomic_number.(species(sys, :)) |