forked from dptech-corp/dpgen2
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DiffCSP as a new exploration engine (#251)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced `variant_filter` for configuration filtering in exploration tasks. - Added support for the new `DiffCSP` exploration style, enhancing exploration capabilities. - New classes and methods for managing and executing `DiffCSP` tasks, including `DiffCSPTaskGroup`. - CIF file conversion functionality added via the `DiffCSPGen` class. - New class `DistanceConfFilter` for validating atomic configurations based on distance criteria. - Implemented the `RunRelax` class for structured execution of relaxation tasks. - **Bug Fixes** - Enhanced configuration handling in multiple locations, addressing previously unsupported filters. - **Tests** - Comprehensive test suites for `DistanceConfFilter`, `DiffCSPGen`, `RunRelax`, and `PrepRunDiffCSP` to ensure functionality and integration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: zjgemi <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Han Wang <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
44d3fd1
commit 4967951
Showing
19 changed files
with
2,299 additions
and
13 deletions.
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
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,47 @@ | ||
from typing import ( | ||
Optional, | ||
) | ||
|
||
from .task import ( | ||
ExplorationTask, | ||
) | ||
from .task_group import ( | ||
ExplorationTaskGroup, | ||
) | ||
|
||
|
||
class DiffCSPTaskGroup(ExplorationTaskGroup): | ||
def __init__( | ||
self, | ||
trj_freq: int = 10, | ||
fmax: float = 1e-4, | ||
steps: int = 200, | ||
timeout: Optional[int] = None, | ||
): | ||
super().__init__() | ||
self.trj_freq = trj_freq | ||
self.fmax = fmax | ||
self.steps = steps | ||
self.timeout = timeout | ||
|
||
def make_task(self) -> "DiffCSPTaskGroup": | ||
""" | ||
Make the DiffCSP task group. | ||
Returns | ||
------- | ||
task_grp: DiffCSPTaskGroup | ||
Return one DiffCSP task group. | ||
""" | ||
# clear all existing tasks | ||
self.clear() | ||
self.add_task(self._make_diffcsp_task()) | ||
return self | ||
|
||
def _make_diffcsp_task(self) -> ExplorationTask: | ||
task = ExplorationTask() | ||
task.trj_freq = self.trj_freq # type: ignore | ||
task.fmax = self.fmax # type: ignore | ||
task.steps = self.steps # type: ignore | ||
task.timeout = self.timeout # type: ignore | ||
return task |
Oops, something went wrong.