-
Notifications
You must be signed in to change notification settings - Fork 14
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
update nscf kpoints distance #446
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fdca1db
update nscf kpoints distance
AndresOrtegaGuerrero 3eb0817
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3ee79df
adding logic for nscf kpoints_distance
AndresOrtegaGuerrero fad7de6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e695659
update nscf logic
AndresOrtegaGuerrero 56861e9
update nscf logic
AndresOrtegaGuerrero 7689506
update
AndresOrtegaGuerrero a287224
update and pre-commit
AndresOrtegaGuerrero ccf939a
Merge branch 'main' into nscf-override-bugfix
AndresOrtegaGuerrero e033ee6
adding logic to workchain pdos plugin
AndresOrtegaGuerrero d32a7ec
removing lines of smearing and degasuss
AndresOrtegaGuerrero c83326c
updating test_builder
AndresOrtegaGuerrero dd2ca25
pdos setting panel to update nscf_kpoints_distance
AndresOrtegaGuerrero 48271c8
fix
AndresOrtegaGuerrero 4480c4f
adding trailets, generic for plugins
AndresOrtegaGuerrero 23ecf10
fixing setting in pdos plugin
AndresOrtegaGuerrero 85d15b9
updating configuration
AndresOrtegaGuerrero 076fe47
Merge branch 'main' into nscf-override-bugfix
AndresOrtegaGuerrero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Panel for Pdos plugin.""" | ||
import ipywidgets as ipw | ||
import traitlets as tl | ||
from aiida import orm | ||
from aiida_quantumespresso.calculations.functions.create_kpoints_from_distance import ( | ||
create_kpoints_from_distance, | ||
) | ||
|
||
from aiidalab_qe.common.panel import Panel | ||
|
||
# nscf_kpoints_distance values from PdosWorkChain | ||
NSCF_DISTANCE_MAP = { | ||
"fast": 0.5, | ||
"moderate": 0.1, | ||
"precise": 0.05, | ||
} | ||
|
||
|
||
class Setting(Panel): | ||
title = "Pdos Settings" | ||
identifier = "pdos" | ||
input_structure = tl.Instance(orm.StructureData, allow_none=True) | ||
protocol = tl.Unicode(allow_none=True) | ||
|
||
def __init__(self, **kwargs): | ||
self.settings_title = ipw.HTML( | ||
"""<div style="padding-top: 0px; padding-bottom: 0px"> | ||
<h4>Settings</h4></div>""" | ||
) | ||
# nscf kpoints setting widget | ||
self.nscf_kpoints_distance = ipw.BoundedFloatText( | ||
min=0.001, | ||
step=0.01, | ||
value=0.1, | ||
description="NSCF K-points distance (1/Å):", | ||
disabled=False, | ||
style={"description_width": "initial"}, | ||
) | ||
self.mesh_grid = ipw.HTML() | ||
self.nscf_kpoints_distance.observe(self._display_mesh, "value") | ||
self.nscf_kpoints_distance.observe(self._procotol_changed, "change") | ||
self.children = [ | ||
self.settings_title, | ||
ipw.HBox([self.nscf_kpoints_distance, self.mesh_grid]), | ||
] | ||
super().__init__(**kwargs) | ||
|
||
@tl.observe("protocol") | ||
def _procotol_changed(self, change): | ||
self.nscf_kpoints_distance.value = NSCF_DISTANCE_MAP[change["new"]] | ||
self._display_mesh() | ||
|
||
@tl.observe("input_structure") | ||
def _update_structure(self, _=None): | ||
self._display_mesh() | ||
|
||
def _display_mesh(self, _=None): | ||
if self.input_structure is None: | ||
return | ||
mesh = create_kpoints_from_distance( | ||
self.input_structure, | ||
orm.Float(self.nscf_kpoints_distance.value), | ||
orm.Bool(True), | ||
) | ||
self.mesh_grid.value = "Mesh " + str(mesh.get_kpoints_mesh()[0]) | ||
|
||
def get_panel_value(self): | ||
"""Return a dictionary with the input parameters for the plugin.""" | ||
return { | ||
"nscf_kpoints_distance": self.nscf_kpoints_distance.value, | ||
} | ||
|
||
def set_panel_value(self, input_dict): | ||
"""Load a dictionary with the input parameters for the plugin.""" | ||
self.nscf_kpoints_distance.value = input_dict.get("nscf_kpoints_distance", 0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
since the protocol is added here, please remove lines 79-84.