Skip to content
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

Outputs - JDFTx IO Module #4190

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
549 changes: 549 additions & 0 deletions src/pymatgen/io/jdftx/_output_utils.py

Large diffs are not rendered by default.

1,181 changes: 1,181 additions & 0 deletions src/pymatgen/io/jdftx/jdftxoutfileslice.py

Large diffs are not rendered by default.

532 changes: 532 additions & 0 deletions src/pymatgen/io/jdftx/jelstep.py

Large diffs are not rendered by default.

103 changes: 103 additions & 0 deletions src/pymatgen/io/jdftx/jminsettings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
"""Store generic minimization settings read from a JDFTx out file.

This module contains the JMinSettings class for storing generic minimization
and mutants for storing specific minimization settings read from a JDFTx out
file.

@mkhorton - this file is ready to review.
"""

from __future__ import annotations

import pprint
from dataclasses import dataclass
from typing import Any


@dataclass
class JMinSettings:
"""Store generic minimization settings read from a JDFTx out file.

Store generic minimization settings read from a JDFTx out file.
"""

params: dict[str, Any] | None = None

def __init__(
self,
params: dict[str, Any] | None = None,
) -> None:
"""Initialize a generic JMinSettings class.

Args:
params (dict[str, Any] | None): A dictionary of minimization settings.
"""
self.params = None if params is None else dict(params)

def __str__(self) -> str:
"""Return a string representation of the minimization settings."""
return pprint.pformat(self)


@dataclass
class JMinSettingsElectronic(JMinSettings):
"""JMInSettings mutant for electronic minimization settings.

A class for storing electronic minimization settings read from a JDFTx out file.
"""

start_flag: str = "electronic-minimize"

def __init__(
self,
params: dict[str, Any] | None = None,
) -> None:
super().__init__(params=params)


@dataclass
class JMinSettingsFluid(JMinSettings):
"""JMInSettings mutant for fluid minimization settings.

A class for storing fluid minimization settings read from a JDFTx out file.
"""

start_flag: str = "fluid-minimize"

def __init__(
self,
params: dict[str, Any] | None = None,
) -> None:
super().__init__(params=params)


@dataclass
class JMinSettingsLattice(JMinSettings):
"""JMInSettings mutant for lattice minimization settings.

A class for storing lattice minimization settings read from a JDFTx out file.
"""

start_flag: str = "lattice-minimize"

def __init__(
self,
params: dict[str, Any] | None = None,
) -> None:
super().__init__(params=params)


@dataclass
class JMinSettingsIonic(JMinSettings):
"""JMInSettings mutant for ionic minimization settings.

A class for storing ionic minimization settings read from a JDFTx out file.
"""

start_flag: str = "ionic-minimize"

def __init__(
self,
params: dict[str, Any] | None = None,
) -> None:
super().__init__(params=params)
Loading
Loading