Skip to content
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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ docs = [
"mystmd"
]
tests = [
"pytest"
"pytest",
"pytest-regressions"
]
pre-commit = [
"pre-commit"
Expand Down
56 changes: 50 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,55 @@
"""Project-wide pytest fixtures & hooks.

Docs: https://docs.pytest.org/en/stable/how-to/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files
"""
"""Fixtures and configuration for the `aiida-epw` package."""

import pytest

from pathlib import Path

from aiida import orm
from aiida.common import LinkType
from aiida.plugins.entry_point import format_entry_point_string, get_entry_point_string_from_class
from aiida.parsers.parser import Parser


pytest_plugins = 'aiida.tools.pytest_fixtures'


@pytest.fixture
def files_path():
"""Path to the data files used for the tests."""
return Path(__file__).parent / "files"


@pytest.fixture
def readability_counts() -> bool:
return True
def parse_from_files(aiida_localhost, files_path):
"""Return a function that parses the files from a corresponding test name."""

def factory(parser_class: Parser, test_name: str):
"""Parse the files from the corresponding test name using the parser class.

:param parser_class: parser class used for the parsing.
:param test_name: name of the directory in which the test files are stored.
Resolves to `tests/files/parsers/<parser_entry_point.split('.')[-1]>/test_name`
:return: Tuple of parsed results and the `CalcFunctionNode` representing the process of parsing
"""
parser_entry_point = get_entry_point_string_from_class(
class_module=parser_class.__module__, class_name=parser_class.__name__
)
calc_entry_point = format_entry_point_string(
group='aiida.calculations', name=parser_entry_point.split(':')[1]
)
node = orm.CalcJobNode(computer=aiida_localhost, process_type=calc_entry_point)
node.base.attributes.set('output_filename', 'aiida.out')

directory_path = files_path / 'parsers' / parser_entry_point.split('.')[-1] / test_name

node.store()

retrieved = orm.FolderData()
retrieved.base.repository.put_object_from_tree(directory_path.as_posix())

retrieved.base.links.add_incoming(node, link_type=LinkType.CREATE, link_label='retrieved')
retrieved.store()

return parser_class.parse_from_node(node, store_provenance=False)

return factory
191 changes: 191 additions & 0 deletions tests/files/parsers/epw/bands/aiida.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@

``:oss/
`.+s+. .+ys--yh+ `./ss+.
-sh//yy+` +yy +yy -+h+-oyy
-yh- .oyy/.-sh. .syo-.:sy- /yh
`.-.` `yh+ -oyyyo. `/syys: oys `.`
`/+ssys+-` `sh+ ` oys` .:osyo`
-yh- ./syyooyo` .sys+/oyo--yh/
`yy+ .-:-. `-/+/:` -sh-
/yh. oys
``..---hho---------` .---------..` `.-----.` -hd+---.
`./osmNMMMMMMMMMMMMMMMs. +NNMMMMMMMMNNmh+. yNMMMMMNm- oNMMMMMNmo++:`
+sy--/sdMMMhyyyyyyyNMMh- .oyNMMmyyyyyhNMMm+` -yMMMdyyo:` .oyyNMMNhs+syy`
-yy/ /MMM+.`-+/``mMMy- `mMMh:`````.dMMN:` `MMMy-`-dhhy```mMMy:``+hs
-yy+` /MMMo:-mMM+`-oo/. mMMh: `dMMN/` dMMm:`dMMMMy..MMMo-.+yo`
.sys`/MMMMNNMMMs- mMMmyooooymMMNo: oMMM/sMMMMMM++MMN//oh:
`sh+/MMMhyyMMMs- `-` mMMMMMMMMMNmy+-` -MMMhMMMsmMMmdMMd/yy+
`-/+++oyy-/MMM+.`/hh/.`mNm:` mMMd+/////:-.` NMMMMMd/:NMMMMMy:/yyo/:.`
+os+//:-..-oMMMo:--:::-/MMMo. .-mMMd+---` hMMMMN+. oMMMMMo. `-+osyso:`
syo `mNMMMMMNNNNNNNNMMMo.oNNMMMMMNNNN:` +MMMMs:` dMMMN/` ``:syo
/yh` :syyyyyyyyyyyyyyyy+.`+syyyyyyyyo:` .oyys:` .oyys:` +yh
-yh- ```````````````` ````````` `` `` oys
-+h/------------------------::::::::://////++++++++++++++++++++++///////::::/yd:
shdddddddddddddddddddddddddddddhhhhhhhhyyyyyssssssssssssssssyyyyyyyhhhhhhhddddh`

S. Ponce, E. R. Margine, C. Verdi, and F. Giustino,
Comput. Phys. Commun. 209, 116 (2016)


Program EPW v.5.7 starts on 25Jul2023 at 0:11:31

This program is part of the open-source Quantum ESPRESSO suite
for quantum simulation of materials; please cite
"P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009);
"P. Giannozzi et al., J. Phys.:Condens. Matter 29 465901 (2017);
"P. Giannozzi et al., J. Chem. Phys. 152 154105 (2020);
URL http://www.quantum-espresso.org",
in publications or presentations arising from this work. More details at
http://www.quantum-espresso.org/quote

Parallel version (MPI), running on 128 processors

MPI processes distributed on 1 nodes
K-points division: npool = 128
236845 MiB available memory on the printing compute node when the environment starts

Reading input from aiida.in
Title line not specified: using 'default'.

No temperature supplied. Setting temps(:) to 300 K.

------------------------------------------------------------------------
RESTART - RESTART - RESTART - RESTART
Restart is done without reading PWSCF save file.
Be aware that some consistency checks are therefore not done.
------------------------------------------------------------------------


default

bravais-lattice index = 0
lattice parameter (a_0) = 0.0000 a.u.
unit-cell volume = 0.0000 (a.u.)^3
number of atoms/cell = 0
number of atomic types = 0
kinetic-energy cut-off = 0.0000 Ry
charge density cut-off = 0.0000 Ry
Exchange-correlation= not set
( -1 -1 -1 -1 -1 -1 -1)


celldm(1)= 0.00000 celldm(2)= 0.00000 celldm(3)= 0.00000
celldm(4)= 0.00000 celldm(5)= 0.00000 celldm(6)= 0.00000

crystal axes: (cart. coord. in units of a_0)
a(1) = ( 0.0000 0.0000 0.0000 )
a(2) = ( 0.0000 0.0000 0.0000 )
a(3) = ( 0.0000 0.0000 0.0000 )

reciprocal axes: (cart. coord. in units 2 pi/a_0)
b(1) = ( 0.0000 0.0000 0.0000 )
b(2) = ( 0.0000 0.0000 0.0000 )
b(3) = ( 0.0000 0.0000 0.0000 )


Atoms inside the unit cell:

Cartesian axes

site n. atom mass positions (a_0 units)


No symmetry!

G cutoff = 0.0000 ( 0 G-vectors) FFT grid: ( 0, 0, 0)
number of k points= 0
cart. coord. in units 2pi/a_0
EPW : 0.01s CPU 0.03s WALL

EPW : 0.01s CPU 0.03s WALL


-------------------------------------------------------------------
Using aiida.ukk from disk
-------------------------------------------------------------------

Symmetries of Bravais lattice: 24
Symmetries of crystal: 24

Do not need to read .epb files; read .fmt files


Band disentanglement is used: nbndsub = 20
Use zone-centred Wigner-Seitz cells
Number of WS vectors for electrons 511
Number of WS vectors for phonons 57
Number of WS vectors for electron-phonon 57
Maximum number of cores for efficient parallelization 684
Results may improve by using use_ws == .TRUE.

Reading Hamiltonian, Dynamical matrix and EP vertex in Wann rep from file


Finished reading Wann rep data from file

===================================================================
Memory usage: VmHWM = 44Mb
VmPeak = 887Mb
===================================================================

Using q-mesh file: qfpoints.kpt
WARNING: q-point weigths do not add up to 1 [loadqmesh_serial]
Size of q point mesh for interpolation: 283
Using k-mesh file: kfpoints.kpt
WARNING: k-point weigths do not add up to 1 [loadkmesh_para]
Size of k point mesh for interpolation: 566
Max number of k points per pool: 6

Fermi energy coarse grid = 14.700566 eV

===================================================================

Fermi energy corresponds to the coarse k-mesh

===================================================================

ibndmin = 1 ebndmin = -1.062 eV
ibndmax = 20 ebndmax = 25.007 eV


Number of ep-matrix elements per pool : 14400 ~= 112.50 Kb (@ 8 bytes/ DP)

A selecq.fmt file was found but re-created because selecqread == .FALSE.
Number selected, total 100 100
Number selected, total 200 200
We only need to compute 283 q-points

Progression iq (fine) = 100/ 283
Progression iq (fine) = 200/ 283
===================================================================
Memory usage: VmHWM = 132Mb
VmPeak = 982Mb
===================================================================


Unfolding on the coarse grid
elphon_wrap : 0.00s CPU 0.04s WALL ( 1 calls)

INITIALIZATION:




Electron-Phonon interpolation
ephwann : 69.44s CPU 91.31s WALL ( 1 calls)
ep-interp : 68.11s CPU 87.66s WALL ( 283 calls)

DynW2B : 0.02s CPU 0.02s WALL ( 283 calls)
HamW2B : 2.00s CPU 2.21s WALL ( 1990 calls)
ephW2Bp : 47.20s CPU 66.36s WALL ( 283 calls)
ephW2B : 11.62s CPU 11.66s WALL ( 849 calls)


Total program execution
EPW : 1m 9.45s CPU 1m31.40s WALL

===============================================================================
The functionality-dependent EPW.bib file was created with suggested citations.
Please consider citing the papers listed in EPW.bib.
===============================================================================

17 changes: 17 additions & 0 deletions tests/files/parsers/epw/bands/band.eig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
&plot nbnd= 20, nks= 8 /
0.000000 0.000000 0.000000
-1.062274538219 -0.674223523464 9.316575269770 9.316575298301 9.563195491658 9.563195515517 10.570669366941 12.163213074534 14.372576245065 14.372576322299 14.649212759774 16.842182825602 17.688780223265 17.688785004869 19.233517222189 20.468845874559 20.470945827274 21.318365096650 21.331875260807 21.878595849966
0.013514 0.007802 0.000000
-1.060700111600 -0.673082447313 9.313676744493 9.319166840883 9.563522147944 9.565195447614 10.569881802457 12.158776438589 14.369843064473 14.376568039570 14.658465342101 16.842980282697 17.688129059980 17.692128477291 19.237066765258 20.457631479305 20.464748379303 21.312729637039 21.327913355597 21.884031262761
0.027027 0.015604 0.000000
-1.055981468429 -0.669673988945 9.305172786881 9.326898254325 9.564499474675 9.571163915259 10.567577955958 12.145619279203 14.361706307445 14.388399391907 14.685882432680 16.845295567082 17.686158854684 17.702170788442 19.247630879984 20.423116946200 20.447490177484 21.294975645661 21.316685929206 21.900616643792
0.040541 0.023406 0.000000
-1.048138292418 -0.664036944837 9.291582155529 9.339660349482 9.566016632458 9.581123481016 10.563915874723 12.124178389587 14.348318426603 14.407637064933 14.730575497852 16.848913372504 17.682857746521 17.718923919246 19.264968843659 20.366813062917 20.418983412653 21.264108313455 21.298679962854 21.929061032314
0.054054 0.031208 0.000000
-1.037215663213 -0.656226088351 9.273637178757 9.357290058651 9.567958266772 9.595084263669 10.559118707843 12.095120538030 14.329906770864 14.433533089824 14.791365726991 16.853524284933 17.678288309289 17.742364495067 19.288706021275 20.290599534022 20.379361209917 21.219836420034 21.273531889252 21.970183003235
0.067568 0.039010 0.000000
-1.023295754665 -0.646302725321 9.252150487839 9.379595319383 9.570238228212 9.613044973847 10.553425389669 12.059266979482 14.306784354307 14.465052521196 14.867032069818 16.858781806521 17.672685739827 17.772380580301 19.318359732532 20.196696535829 20.328886601192 21.162048113097 21.240771289310 22.024484785188
0.081081 0.046812 0.000000
-1.006503965775 -0.634329626443 9.227915138946 9.406378569241 9.572831933653 9.634982338134 10.547040591715 12.017513107021 14.279365985862 14.500956348915 14.956479012134 16.864355215486 17.666541597535 17.808720604114 19.353355320111 20.087502286405 20.267903604796 21.090727851889 21.200111318687 22.091763857946
0.094595 0.054614 0.000000
-0.987005148772 -0.620373743611 9.201656523514 9.437454826246 9.575794847283 9.660843689396 10.540097056419 11.970756596255 14.248157488649 14.539919439683 15.058811492745 16.869963738068 17.660633285951 17.850958747752 19.393025704508 19.965441203106 20.196824709829 21.006045221431 21.151512852070 22.170894974497
17 changes: 17 additions & 0 deletions tests/files/parsers/epw/bands/phband.freq
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
&plot nbnd= 12, nks= 8 /
0.000000 0.000000 0.000000
-0.0000 -0.0000 -0.0000 21.6834 21.6834 28.1903 53.8871 53.8871 56.6914 60.2970 60.2970 67.7687
0.013514 0.007802 0.000000
0.3788 0.7404 1.1784 21.7065 21.7127 28.1916 53.8625 53.8670 56.6870 60.2817 60.2965 67.7404
0.027027 0.015604 0.000000
0.7578 1.4801 2.3531 21.7753 21.7998 28.1957 53.7893 53.8066 56.6743 60.2362 60.2947 67.6558
0.040541 0.023406 0.000000
1.1370 2.2183 3.5205 21.8884 21.9427 28.2023 53.6687 53.7053 56.6535 60.1618 60.2901 67.5158
0.054054 0.031208 0.000000
1.5165 2.9543 4.6771 22.0432 22.1379 28.2112 53.5029 53.5624 56.6254 60.0609 60.2809 67.3221
0.067568 0.039010 0.000000
1.8960 3.6872 5.8196 22.2366 22.3810 28.2221 53.2947 53.3773 56.5911 59.9360 60.2647 67.0767
0.081081 0.046812 0.000000
2.2752 4.4163 6.9449 22.4647 22.6663 28.2346 53.0468 53.1497 56.5516 59.7901 60.2387 66.7825
0.094595 0.054614 0.000000
2.6538 5.1408 8.0501 22.7231 22.9872 28.2482 52.7624 52.8804 56.5084 59.6262 60.2002 66.4425
Loading