Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue with wrong size of X,Y,Z ranges and added testing #19

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

SzymonBlazucki
Copy link
Contributor

As discussed I has changed X,Y,Z to range from 0 to n_voxels - 1 and added test case based on the file:
https://github.com/qiaojunfeng/WannierDatasets/blob/main/datasets/Si2_valence/reference/Si2_valence_00001.cube

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0433e34) 86.67% compared to head (da63bd1) 90.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   86.67%   90.08%   +3.41%     
==========================================
  Files          30       30              
  Lines        2492     2492              
==========================================
+ Hits         2160     2245      +85     
+ Misses        332      247      -85     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@qiaojunfeng qiaojunfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a few changes then we are good to go 🚀

Project.toml Outdated
@@ -13,6 +13,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add dependency here, it is already in the test/Project.toml

@@ -0,0 +1,28 @@
@testitem "read/write cube" begin
using LazyArtifacts
const Bohr::Float64 = 0.52917721092
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use this line instead of defining a const here

using WannierIO: Bohr

@test cube.Z ≈ cube.X
@test size(cube.W) == (20,20,20)
@test size(cube.atom_positions) == (3,8)
print(cube.atom_positions[:,1])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the print line can be removed

@@ -4,7 +4,6 @@ LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, should delete the TestItemRunner in the Project.toml in the root folder, this one in the test/Project.toml should be kept.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so sorry, missclick

@qiaojunfeng qiaojunfeng merged commit e80f6f1 into qiaojunfeng:main Dec 15, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants