Open azadoks opened 1 year ago
Attention: 75 lines
in your changes are missing coverage. Please review.
Comparison is base (
8dd0f06
) 82.45% compared to head (4d6b119
) 88.13%.:exclamation: Current head 4d6b119 differs from pull request most recent head 0d70da7. Consider uploading reports for the commit 0d70da7 to get more accurate results
Files | Patch % | Lines |
---|---|---|
src/psp/psp.jl | 10.71% | 25 Missing :warning: |
src/common/quadrature.jl | 77.92% | 17 Missing :warning: |
src/file/file.jl | 25.00% | 9 Missing :warning: |
src/io/show.jl | 86.79% | 7 Missing :warning: |
src/psp/ultrasoft.jl | 30.00% | 7 Missing :warning: |
src/io/load.jl | 89.28% | 3 Missing :warning: |
src/psp/hgh.jl | 94.73% | 3 Missing :warning: |
src/file/psp8.jl | 94.73% | 2 Missing :warning: |
src/common/mesh.jl | 90.00% | 1 Missing :warning: |
src/psp/numeric.jl | 98.76% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Some comments on integration:
psp.r
; using the grid derivative psp.dr
leads to gaps / overlaps in integrationQuick comment on the dispatches:
AbstractPsP
) first and then the representation of the quantity or the input data.Otherwise, there is always the risk of overdoing it. I trust you on this, but I just wanted to point out alternatives to introducing too many types. Sometimes properties can also be elegantly distinguished by plain symbols. This has disadvantages (e.g. multiple dispatch does not work), but has advantages, too (e.g. seamless integration with getproperty
or similar'
I'll do a more careful review during the review (if I get raound).
Regarding the kwarg thing: Inside pspio we probable want to deconstruct (via a dispatch) to positional args, but let's discuss if this mskes sense.
Proposal
While working to integrate PseudoPotentialIO into DFTK, there were a few points where having a dispatch flag-based interface in PPIO would help to reduce code duplication, namely
Here, I define a set of
AbstractPsPQuantity
structs:which are used to select dispatches for a variety of functions:
This reduces code duplication to some extent in PPIO and should allow for additional quantities to be added without much effort.
Additional features and changes
qe_simpson
,cp90_simpson
,abinit_corrected_trapezoid
integratorsdotprod
integrator torectangle
identifier
field toPsPFile
s (defaults to filename when loaded from a file)checksum
andidentifier
optional fields inAbstractPsP
s; this information may not be available / correct if the psp is constructed by hand or modified, e.g. in the DFTK HGH sensitivity test / exampleBase.==
andBase.hash
dispatches fromAbstractPsP
now thatchecksum
is optionalPsPFile
constructors to have two common dispatches:io::IO
andpath::AbstractString
(which calls down toio::IO
and passes along the filename)TODOs
LocalPotentialCorrection
flagserf(r) Z / r
local potential correctionr
as an argument to all the integrators (cp90_simpson
needs it to avoidr=0
, future integrators might use it as well)dr
and use it rather than finite differencesr[i+1] - r[i]
or similar)