-
Notifications
You must be signed in to change notification settings - Fork 99
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
ABINIT DFPT SHG #1060
base: main
Are you sure you want to change the base?
ABINIT DFPT SHG #1060
Conversation
…-commit-autoupdate Auto-update pre-commit hooks
Abinit workflows
…rkflows_dfpt_shg_new merge modif
…rkflows_dfpt_shg_new merge review PR
…rkflows_dfpt_shg_new merge review PR
…it_workflows_dfpt_shg_new pull trunk main
@VicTrqt Hi, thank you! There seem to be some failing abipy imports in the ase part of the tests. Could you check them? It might be that you should only import abipy when abipy is installed. |
…it_workflows_dfpt_shg_new pull trunk main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some initial comments but would need to take a closer look at another point.
@@ -38,7 +38,8 @@ dependencies = [ | |||
] | |||
|
|||
[project.optional-dependencies] | |||
abinit = ["abipy>=0.9.3"] | |||
#abinit = ["abipy>=0.9.3"] | |||
abinit = ["abipy @ git+https://github.com/abinit/abipy.git"] # tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we merge this, we would definitely need a new abipy version.
dijk: Optional[list] = Field( | ||
None, description="Conventional SHG tensor in pm/V (Chi^(2)/2)" | ||
) | ||
epsinf: Optional[list] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
epsinf: Optional[list] = Field( | |
eps_inf: Optional[list] = Field( |
?
# # need to inherit from MSONable to be stored in the data store | ||
# # I tried to combine it with @dataclass, but didn't work... | ||
# class DdbFileStr(MSONable): | ||
# """Object storing the raw string of a DDB file.""" | ||
|
||
# def __init__(self, ddbfilepath: str | Path, ddb_as_str: str) -> None: | ||
# self.ddbfilepath: str | Path = ddbfilepath | ||
# self.ddb_as_str: str = ddb_as_str | ||
|
||
# @classmethod | ||
# def from_ddbfile(cls, ddbfile: DdbFile) -> Self: | ||
# """Create a DdbFileStr object from the native DdbFile abipy object.""" | ||
# with open(ddbfile.filepath) as f: | ||
# ddb_as_str = f.read() | ||
# return cls(ddbfilepath=ddbfile.filepath, ddb_as_str=ddb_as_str) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
basename=dct_abi_psp["basename"], | ||
type_psp=dct_abi_psp["type"], | ||
symbol=dct_abi_psp["symbol"], | ||
Z=dct_abi_psp["Z"], | ||
Z_val=dct_abi_psp["Z_val"], | ||
l_max=dct_abi_psp["l_max"], | ||
md5=dct_abi_psp["md5"], | ||
filepath=dct_abi_psp["filepath"], | ||
repo_name=repo_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the naming and the hypens are a bit inconsistent. "basename" vs. "repo_name".
Hello @JaGeo !
I'm not sure what you mean... Just in case, I modified the required abipy version (temporarily) so that the tests could pass with the github version. Seems that triggered something else with the pseudos so I'll fix that. |
@VicTrqt the tests never passed. Not even before the modification |
@JaGeo Yes it was expected since new abipy factories are required and a version of abipy with those new factories has not been released yet.
|
I was able to fix the tests (still temporarily relying on the github abipy). However, in test_dfpt, abinit is called to generate the perturbations. It could be mocked, but it would not be trivial in terms of work, especially considering future tests... so we decided to install abinit as a dependency so that the tests could pass online. This means that there is now a mixture of mock and real abinit calls. I also added a skip of the test_dfpt in case abinit was not in the PATH so that this test would not be triggered locally by developers without an abinit executable. |
Summary
TODO
Note