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

Merge to mineralscloud/pgm #7

Merged
merged 7 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11,946 changes: 5,972 additions & 5,974 deletions examples/fe/data/0K

Large diffs are not rendered by default.

11,940 changes: 5,969 additions & 5,971 deletions examples/fe/data/1000K

Large diffs are not rendered by default.

11,936 changes: 5,967 additions & 5,969 deletions examples/fe/data/2000K

Large diffs are not rendered by default.

11,944 changes: 5,971 additions & 5,973 deletions examples/fe/data/3000K

Large diffs are not rendered by default.

11,946 changes: 5,972 additions & 5,974 deletions examples/fe/data/300K

Large diffs are not rendered by default.

11,944 changes: 5,971 additions & 5,973 deletions examples/fe/data/4000K

Large diffs are not rendered by default.

11,946 changes: 5,972 additions & 5,974 deletions examples/fe/data/5000K

Large diffs are not rendered by default.

11,946 changes: 5,972 additions & 5,974 deletions examples/fe/data/6000K

Large diffs are not rendered by default.

11,948 changes: 5,973 additions & 5,975 deletions examples/fe/data/7000K

Large diffs are not rendered by default.

11,946 changes: 5,972 additions & 5,974 deletions examples/fe/data/8000K

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions examples/feo/1000K.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Number of volumes(nv), q-vectors(nq), normal mode(np), formula units(nm)
9 264 12 1
P = 1970.3500 V = 158.7365 E = -741.34530945999995 S_el = -0.00000824338000
P = 1970.3500 V = 158.7365 E = -741.34530945999995 S_el = 0.00000824338000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -3433,7 +3433,7 @@ P = 1970.3500 V = 158.7365 E = -741.34530945999995 S_el = -0.00000824338000
771.3486
808.4057
808.4057
P = 2184.9500 V = 155.4939 E = -741.29916915000001 S_el = -0.00000789960000
P = 2184.9500 V = 155.4939 E = -741.29916915000001 S_el = 0.00000789960000
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -6866,7 +6866,7 @@ P = 2184.9500 V = 155.4939 E = -741.29916915000001 S_el = -0.00000789960000
796.9645
834.6079
834.6079
P = 2420.1500 V = 152.2585 E = -741.24815776000003 S_el = -0.00000756674000
P = 2420.1500 V = 152.2585 E = -741.24815776000003 S_el = 0.00000756674000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -10299,7 +10299,7 @@ P = 2420.1500 V = 152.2585 E = -741.24815776000003 S_el = -0.00000756674000
821.9341
863.1939
863.1939
P = 2679.1200 V = 149.0177 E = -741.19159462000005 S_el = -0.00000724330000
P = 2679.1200 V = 149.0177 E = -741.19159462000005 S_el = 0.00000724330000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -13732,7 +13732,7 @@ P = 2679.1200 V = 149.0177 E = -741.19159462000005 S_el = -0.00000724330000
849.6428
891.9755
891.9755
P = 2964.1600 V = 145.7779 E = -741.12904962000005 S_el = -0.00000692891000
P = 2964.1600 V = 145.7779 E = -741.12904962000005 S_el = 0.00000692891000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -17165,7 +17165,7 @@ P = 2964.1600 V = 145.7779 E = -741.12904962000005 S_el = -0.00000692891000
874.5631
921.6055
921.6055
P = 3278.4200 V = 142.5364 E = -741.05983870000000 S_el = -0.00000662096000
P = 3278.4200 V = 142.5364 E = -741.05983870000000 S_el = 0.00000662096000
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -20598,7 +20598,7 @@ P = 3278.4200 V = 142.5364 E = -741.05983870000000 S_el = -0.00000662096000
904.3898
953.0156
953.0156
P = 3624.8300 V = 139.2993 E = -740.98344099999997 S_el = -0.00000632047000
P = 3624.8300 V = 139.2993 E = -740.98344099999997 S_el = 0.00000632047000
0.0000000 0.0000000 0.0000000
0.0000
0.0000
Expand Down Expand Up @@ -24031,7 +24031,7 @@ P = 3624.8300 V = 139.2993 E = -740.98344099999997 S_el = -0.00000632047000
936.2338
989.1587
989.1587
P = 4008.6800 V = 136.0597 E = -740.89893235000000 S_el = -0.00000603479000
P = 4008.6800 V = 136.0597 E = -740.89893235000000 S_el = 0.00000603479000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -27464,7 +27464,7 @@ P = 4008.6800 V = 136.0597 E = -740.89893235000000 S_el = -0.00000603479000
966.0682
1025.6511
1025.6511
P = 4432.9500 V = 132.8196 E = -740.80550586000004 S_el = -0.00000575366000
P = 4432.9500 V = 132.8196 E = -740.80550586000004 S_el = 0.00000575366000
0.0000000 0.0000000 0.0000000
0.0000
0.0000
Expand Down
18 changes: 9 additions & 9 deletions examples/feo/2000K.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Number of volumes(nv), q-vectors(nq), normal mode(np), formula units(nm)
9 264 12 1
P = 1988.0900 V = 158.7365 E = -741.33423189999996 S_el = -0.00001578686000
P = 1988.0900 V = 158.7365 E = -741.33423189999996 S_el = 0.00001578686000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -3433,7 +3433,7 @@ P = 1988.0900 V = 158.7365 E = -741.33423189999996 S_el = -0.00001578686000
766.4986
807.1948
807.1948
P = 2202.4800 V = 155.4939 E = -741.28840636999996 S_el = -0.00001522033000
P = 2202.4800 V = 155.4939 E = -741.28840636999996 S_el = 0.00001522033000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -6866,7 +6866,7 @@ P = 2202.4800 V = 155.4939 E = -741.28840636999996 S_el = -0.00001522033000
790.7428
833.9326
833.9326
P = 2437.4300 V = 152.2585 E = -741.23771687999999 S_el = -0.00001466171500
P = 2437.4300 V = 152.2585 E = -741.23771687999999 S_el = 0.00001466171500
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -10299,7 +10299,7 @@ P = 2437.4300 V = 152.2585 E = -741.23771687999999 S_el = -0.00001466171500
817.2238
860.8953
860.8953
P = 2696.1400 V = 149.0177 E = -741.18148128999997 S_el = -0.00001411073000
P = 2696.1400 V = 149.0177 E = -741.18148128999997 S_el = 0.00001411073000
0.0000000 0.0000000 0.0000000
0.0000
0.0000
Expand Down Expand Up @@ -13732,7 +13732,7 @@ P = 2696.1400 V = 149.0177 E = -741.18148128999997 S_el = -0.00001411073000
843.4678
888.0103
888.0103
P = 2980.9100 V = 145.7779 E = -741.11926472000005 S_el = -0.00001357040500
P = 2980.9100 V = 145.7779 E = -741.11926472000005 S_el = 0.00001357040500
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -17165,7 +17165,7 @@ P = 2980.9100 V = 145.7779 E = -741.11926472000005 S_el = -0.00001357040500
873.1600
918.8247
918.8247
P = 3294.8600 V = 142.5364 E = -741.05037944000003 S_el = -0.00001304041000
P = 3294.8600 V = 142.5364 E = -741.05037944000003 S_el = 0.00001304041000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -20598,7 +20598,7 @@ P = 3294.8600 V = 142.5364 E = -741.05037944000003 S_el = -0.00001304041000
901.4182
951.4946
951.4946
P = 3640.9400 V = 139.2993 E = -740.97430139999994 S_el = -0.00001252361500
P = 3640.9400 V = 139.2993 E = -740.97430139999994 S_el = 0.00001252361500
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -24031,7 +24031,7 @@ P = 3640.9400 V = 139.2993 E = -740.97430139999994 S_el = -0.00001252361500
931.5827
986.8702
986.8702
P = 4024.4500 V = 136.0597 E = -740.89010015999997 S_el = -0.00001203113500
P = 4024.4500 V = 136.0597 E = -740.89010015999997 S_el = 0.00001203113500
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -27464,7 +27464,7 @@ P = 4024.4500 V = 136.0597 E = -740.89010015999997 S_el = -0.00001203113500
961.7829
1022.3158
1022.3158
P = 4448.4200 V = 132.8196 E = -740.79697995000004 S_el = -0.00001154469000
P = 4448.4200 V = 132.8196 E = -740.79697995000004 S_el = 0.00001154469000
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down
18 changes: 9 additions & 9 deletions examples/feo/3000K.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Number of volumes(nv), q-vectors(nq), normal mode(np), formula units(nm)
9 264 12 1
P = 2013.2100 V = 158.7365 E = -741.31878806999998 S_el = -0.00002194680333
P = 2013.2100 V = 158.7365 E = -741.31878806999998 S_el = 0.00002194680333
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -3433,7 +3433,7 @@ P = 2013.2100 V = 158.7365 E = -741.31878806999998 S_el = -0.00002194680333
766.1361
808.0808
808.0808
P = 2227.5700 V = 155.4939 E = -741.27323428000000 S_el = -0.00002127153333
P = 2227.5700 V = 155.4939 E = -741.27323428000000 S_el = 0.00002127153333
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -6866,7 +6866,7 @@ P = 2227.5700 V = 155.4939 E = -741.27323428000000 S_el = -0.00002127153333
787.8490
833.6379
833.6379
P = 2462.4200 V = 152.2585 E = -741.22283476999996 S_el = -0.00002059666667
P = 2462.4200 V = 152.2585 E = -741.22283476999996 S_el = 0.00002059666667
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -10299,7 +10299,7 @@ P = 2462.4200 V = 152.2585 E = -741.22283476999996 S_el = -0.00002059666667
815.4467
859.9125
859.9125
P = 2720.9900 V = 149.0177 E = -741.16691027000002 S_el = -0.00001992079000
P = 2720.9900 V = 149.0177 E = -741.16691027000002 S_el = 0.00001992079000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -13732,7 +13732,7 @@ P = 2720.9900 V = 149.0177 E = -741.16691027000002 S_el = -0.00001992079000
838.7495
887.3163
887.3163
P = 3005.5500 V = 145.7779 E = -741.10502661999999 S_el = -0.00001924668333
P = 3005.5500 V = 145.7779 E = -741.10502661999999 S_el = 0.00001924668333
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -17165,7 +17165,7 @@ P = 3005.5500 V = 145.7779 E = -741.10502661999999 S_el = -0.00001924668333
867.0723
917.6957
917.6957
P = 3319.2700 V = 142.5364 E = -741.03649504999998 S_el = -0.00001857448000
P = 3319.2700 V = 142.5364 E = -741.03649504999998 S_el = 0.00001857448000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -20598,7 +20598,7 @@ P = 3319.2700 V = 142.5364 E = -741.03649504999998 S_el = -0.00001857448000
895.9490
949.2398
949.2398
P = 3665.0400 V = 139.2993 E = -740.96079126999996 S_el = -0.00001790722667
P = 3665.0400 V = 139.2993 E = -740.96079126999996 S_el = 0.00001790722667
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -24031,7 +24031,7 @@ P = 3665.0400 V = 139.2993 E = -740.96079126999996 S_el = -0.00001790722667
927.8648
983.7419
983.7419
P = 4048.1700 V = 136.0597 E = -740.87698939999996 S_el = -0.00001725445000
P = 4048.1700 V = 136.0597 E = -740.87698939999996 S_el = 0.00001725445000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -27464,7 +27464,7 @@ P = 4048.1700 V = 136.0597 E = -740.87698939999996 S_el = -0.00001725445000
958.1356
1020.0833
1020.0833
P = 4471.7000 V = 132.8196 E = -740.78428278000001 S_el = -0.00001660196000
P = 4471.7000 V = 132.8196 E = -740.78428278000001 S_el = 0.00001660196000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down
18 changes: 9 additions & 9 deletions examples/feo/4000K.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Number of volumes(nv), q-vectors(nq), normal mode(np), formula units(nm)
9 264 12 1
P = 2044.2200 V = 158.7365 E = -741.29973887999995 S_el = -0.00002737168750
P = 2044.2200 V = 158.7365 E = -741.29973887999995 S_el = 0.00002737168750
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -3433,7 +3433,7 @@ P = 2044.2200 V = 158.7365 E = -741.29973887999995 S_el = -0.00002737168750
764.1072
809.2996
809.2996
P = 2258.6600 V = 155.4939 E = -741.25446326999997 S_el = -0.00002661742750
P = 2258.6600 V = 155.4939 E = -741.25446326999997 S_el = 0.00002661742750
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -6866,7 +6866,7 @@ P = 2258.6600 V = 155.4939 E = -741.25446326999997 S_el = -0.00002661742750
788.1637
834.1684
834.1684
P = 2493.5500 V = 152.2585 E = -741.20435365000003 S_el = -0.00002586017250
P = 2493.5500 V = 152.2585 E = -741.20435365000003 S_el = 0.00002586017250
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -10299,7 +10299,7 @@ P = 2493.5500 V = 152.2585 E = -741.20435365000003 S_el = -0.00002586017250
812.6030
861.2971
861.2971
P = 2752.1400 V = 149.0177 E = -741.14873359000001 S_el = -0.00002509769750
P = 2752.1400 V = 149.0177 E = -741.14873359000001 S_el = 0.00002509769750
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -13732,7 +13732,7 @@ P = 2752.1400 V = 149.0177 E = -741.14873359000001 S_el = -0.00002509769750
838.7697
890.0380
890.0380
P = 3036.6900 V = 145.7779 E = -741.08717053999999 S_el = -0.00002433230000
P = 3036.6900 V = 145.7779 E = -741.08717053999999 S_el = 0.00002433230000
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -17165,7 +17165,7 @@ P = 3036.6900 V = 145.7779 E = -741.08717053999999 S_el = -0.00002433230000
866.2492
919.1282
919.1282
P = 3350.3300 V = 142.5364 E = -741.01897641000005 S_el = -0.00002356392500
P = 3350.3300 V = 142.5364 E = -741.01897641000005 S_el = 0.00002356392500
0.0000000 0.0000000 0.0000000
-0.0000
0.0000
Expand Down Expand Up @@ -20598,7 +20598,7 @@ P = 3350.3300 V = 142.5364 E = -741.01897641000005 S_el = -0.00002356392500
895.8089
952.0441
952.0441
P = 3695.9700 V = 139.2993 E = -740.94362930000000 S_el = -0.00002279493000
P = 3695.9700 V = 139.2993 E = -740.94362930000000 S_el = 0.00002279493000
0.0000000 0.0000000 0.0000000
0.0000
0.0000
Expand Down Expand Up @@ -24031,7 +24031,7 @@ P = 3695.9700 V = 139.2993 E = -740.94362930000000 S_el = -0.00002279493000
923.6918
985.1830
985.1830
P = 4078.9000 V = 136.0597 E = -740.86022285000001 S_el = -0.00002202926750
P = 4078.9000 V = 136.0597 E = -740.86022285000001 S_el = 0.00002202926750
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down Expand Up @@ -27464,7 +27464,7 @@ P = 4078.9000 V = 136.0597 E = -740.86022285000001 S_el = -0.00002202926750
955.1100
1021.4130
1021.4130
P = 4502.2000 V = 132.8196 E = -740.76792024999997 S_el = -0.00002126136500
P = 4502.2000 V = 132.8196 E = -740.76792024999997 S_el = 0.00002126136500
0.0000000 0.0000000 0.0000000
-0.0000
-0.0000
Expand Down
19 changes: 19 additions & 0 deletions tests/test_pgm_read_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest
from pgm.reader.read_input import Input

settings = [('examples/casio3/%sK.txt', [1500, 2000, 2500, 3000, 3500, 4000]),
('examples/feo/%sK.txt', [0, 1000, 2000, 3000, 4000])]


@pytest.mark.parametrize("input_dir,discrete_temp", [settings[0]])
def test_casio3_example(input_dir, discrete_temp):
input_instance = Input(input_dir, discrete_temp)
assert input_instance.frequencies.shape == (6, 5, 8000, 15)
assert input_instance.frequencies[0, 0, 0, 3] == 279.853100


@pytest.mark.parametrize("input_dir,discrete_temp", [settings[1]])
def test_feo_example(input_dir, discrete_temp):
input_instance = Input(input_dir, discrete_temp)
assert input_instance.frequencies.shape == (5, 9, 264, 12)
assert input_instance.frequencies[4, 0, 0, 3] == 302.3405
26 changes: 26 additions & 0 deletions tests/test_pgm_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest
from click.testing import CliRunner
from pgm.cli.main import main

settings = [('examples/casio3/', 'casio3.yaml'), ('examples/feo/', 'feo.yaml')]


@pytest.fixture
def cli_runner():
return CliRunner()


@pytest.mark.parametrize("working_dir, yaml_file", [settings[0]])
def test_casio3_example(cli_runner, working_dir, yaml_file, monkeypatch):
monkeypatch.chdir(working_dir)
result = cli_runner.invoke(main, [yaml_file], prog_name="pgm")
assert result.exit_code == 0
monkeypatch.undo()


@pytest.mark.parametrize("working_dir, yaml_file", [settings[1]])
def test_feo_example(cli_runner, working_dir, yaml_file, monkeypatch):
monkeypatch.chdir(working_dir)
result = cli_runner.invoke(main, [yaml_file], prog_name="pgm")
assert result.exit_code == 0
monkeypatch.undo()