brainandforce / Electrum.jl

A Julian toolkit for solid-state chemical theory.
MIT License
31 stars 0 forks source link

Fixing the type system for datagrid types #148

Closed brainandforce closed 1 year ago

brainandforce commented 1 year ago

RealSpaceDataGrid and HKLData should have subtyped AbstractArray to begin with. I've done this and simplified a vast number of the method definitions. Both these types now subtypes now subtype AbstractDataGrid which itself subtypes AbstractArray, so a good number of methods that arrays should have are already defined.

In practice, this may not break anything, but the relationships betwen the types is different. Also, AbstractCrystalData, AbstractRealSpaceData, and AbstractReciprocalSpaceData are now gone, as they served no real purpose. So has grid() - now convert(::Type{<:Array}, ::AbstractDataGrid) is defined.

I don't think linear indexing is needed for these types, just with the internals.

brainandforce commented 1 year ago

I think I need to update the generation of documentation as well...leaving this here for future me

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 29.85% and project coverage change: +0.01 :tada:

Comparison is base (cb931ab) 30.79% compared to head (597ee25) 30.80%.

:exclamation: Current head 597ee25 differs from pull request most recent head c921fb5. Consider uploading reports for the commit c921fb5 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #148 +/- ## ========================================== + Coverage 30.79% 30.80% +0.01% ========================================== Files 16 18 +2 Lines 1429 1396 -33 ========================================== - Hits 440 430 -10 + Misses 989 966 -23 ``` | [Impacted Files](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores) | Coverage Δ | | |---|---|---| | [src/Electrum.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL0VsZWN0cnVtLmps) | `0.00% <ø> (ø)` | | | [src/types.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL3R5cGVzLmps) | `0.00% <0.00%> (ø)` | | | [src/software/abinit.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL3NvZnR3YXJlL2FiaW5pdC5qbA==) | `45.75% <8.33%> (ø)` | | | [src/data/reciprocalspace.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2RhdGEvcmVjaXByb2NhbHNwYWNlLmps) | `10.52% <20.00%> (-1.69%)` | :arrow_down: | | [src/data/realspace.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2RhdGEvcmVhbHNwYWNlLmps) | `27.77% <25.00%> (-2.78%)` | :arrow_down: | | [src/lattices.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2xhdHRpY2VzLmps) | `62.26% <33.33%> (-1.20%)` | :arrow_down: | | [src/data/grids.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2RhdGEvZ3JpZHMuamw=) | `42.10% <42.10%> (ø)` | | | [src/filetypes.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2ZpbGV0eXBlcy5qbA==) | `41.47% <50.00%> (ø)` | | | [src/data/fft.jl](https://codecov.io/gh/brainandforce/Electrum.jl/pull/148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores#diff-c3JjL2RhdGEvZmZ0Lmps) | `50.00% <100.00%> (-16.67%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Brandon+Flores)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.