FermiQC / Molecules.jl

Library that handles atom structures as XYZ files and properties derived from it.
MIT License
13 stars 10 forks source link

New parametric types and StaticArrays #25

Closed gustavojra closed 2 years ago

gustavojra commented 2 years ago

Atom and Molecule structures modified for an improved type stability/inference. Consequently, previous lines with Vector{Atom} were modified to Vector{<:Atom}.

I also inserted StaticArrays into the code. The coordinates of an atom now are specified using an SVector{3, T}, from my previous testing, I know this speeds up integral computations in GaussianBasis. For consistency, I also defaulted the transformation matrices to be SMatrix{3,3}.

A side effect of using SVector for coordinates is that the xyz field is immutable. e.g.

atom.xyz[1] = 1.0

is broken.

Thus, I had to modify the translate and transform functions. I created a new dispatch that acts on an Atom returning a new one. So when you call translate! or transform! on a Vector{Atom} it loops through the array and replace each atom with a new one.

Part of this PR is to address an issue raised on Fermi.

codecov[bot] commented 2 years ago

Codecov Report

Merging #25 (5272c74) into main (6e32b19) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #25   +/-   ##
=======================================
  Coverage   90.69%   90.69%           
=======================================
  Files          16       16           
  Lines        1332     1333    +1     
=======================================
+ Hits         1208     1209    +1     
  Misses        124      124           
Impacted Files Coverage Δ
src/Molecules.jl 100.00% <100.00%> (ø)
src/Parse.jl 95.91% <100.00%> (ø)
src/Properties.jl 100.00% <100.00%> (ø)
src/Symmetry/flowchart.jl 86.07% <100.00%> (ø)
src/Symmetry/sea.jl 98.00% <100.00%> (ø)
src/Symmetry/symmetry_finding.jl 90.55% <100.00%> (ø)
src/Transformations.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6e32b19...5272c74. Read the comment docs.