Skip to content
Merged
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
33 changes: 29 additions & 4 deletions src/koopmans/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,16 @@ class KCWHamConfig(ParallelCommandConfig):
stdout: str | None = "PREFIX.kho"
stderr: str | None = None
stdin_redirection_string: ClassVar[str] = "-in"
pd: bool = Field(False, description="Use pencil decomposition.")
ase_env_var: ClassVar[str] = "ASE_KCW_HAM_COMMAND"

@property
def options_str(self) -> str:
"""Return the string of options to provide to the executable."""
return ''
options: list[str] = []
if self.pd:
options.append(f"-pd {self.pd}")
return ' '.join(options)


class KCWScreenConfig(ParallelCommandConfig):
Expand All @@ -201,12 +205,19 @@ class KCWScreenConfig(ParallelCommandConfig):
stdout: str | None = "PREFIX.kso"
stderr: str | None = None
stdin_redirection_string: ClassVar[str] = "-in"
npool: int | None = Field(None, description="Number of pools to use for parallel execution.")
pd: bool = Field(False, description="Use pencil decomposition.")
ase_env_var: ClassVar[str] = "ASE_KCW_SCREEN_COMMAND"

@property
def options_str(self) -> str:
"""Return the string of options to provide to the executable."""
return ''
options: list[str] = []
if self.npool is not None:
options.append(f"-npool {self.npool}")
if self.pd:
options.append(f"-pd {self.pd}")
return ' '.join(options)


class KCWWannierConfig(ParallelCommandConfig):
Expand All @@ -217,12 +228,19 @@ class KCWWannierConfig(ParallelCommandConfig):
stdout: str | None = "PREFIX.w2ko"
stderr: str | None = None
stdin_redirection_string: ClassVar[str] = "-in"
npool: int | None = Field(None, description="Number of pools to use for parallel execution.")
pd: bool = Field(False, description="Use pencil decomposition.")
ase_env_var: ClassVar[str] = "ASE_KCW_WANNIER_COMMAND"

@property
def options_str(self) -> str:
"""Return the string of options to provide to the executable."""
return ''
options: list[str] = []
if self.npool is not None:
options.append(f"-npool {self.npool}")
if self.pd:
options.append(f"-pd {self.pd}")
return ' '.join(options)


class KCPConfig(ParallelCommandConfig):
Expand Down Expand Up @@ -265,12 +283,19 @@ class ProjwfcConfig(ParallelCommandConfig):
stdout: str | None = "PREFIX.pro"
stderr: str | None = None
stdin_redirection_string: ClassVar[str] = "-in"
npool: int | None = Field(None, description="Number of pools to use for parallel execution.")
pd: bool = Field(False, description="Use pencil decomposition.")
ase_env_var: ClassVar[str] = "ASE_PROJWFC_COMMAND"

@property

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add missing options_str implementation

def options_str(self) -> str:
"""Return the string of options to provide to the executable."""
return ''
options: list[str] = []
if self.npool is not None:
options.append(f"-npool {self.npool}")
if self.pd:
options.append(f"-pd {self.pd}")
return ' '.join(options)


class Wann2KCPConfig(ParallelCommandConfig):
Expand Down