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 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d16358c
sourcing output code from master to this branch
benrich37 Nov 21, 2024
8d3cc80
sourcing output code from master to this branch
benrich37 Nov 21, 2024
d1204ba
Update from master
benrich37 Nov 22, 2024
7242584
source from master
benrich37 Nov 22, 2024
20139fb
update from master
benrich37 Nov 22, 2024
502d587
changing enumeration of valence electrons (the `valences` method does…
benrich37 Nov 22, 2024
4816d65
added "to_dict" method to JDFTXOutfile
benrich37 Nov 26, 2024
1ce7200
adding `JDFTXOutfileSlice` to "test_dict_repr" in "test_repr_out.py"
benrich37 Nov 26, 2024
09ee43d
removing fatal error from retrieving t_s from a JOutStructure that is…
benrich37 Nov 26, 2024
aa529b0
Correction for ruff - PLC0206 (Extracting value from dictionary witho…
benrich37 Nov 26, 2024
ccf6244
We found some weird behavior when trying to export the JDFTXOutfile o…
benrich37 Dec 3, 2024
26d08f3
adding **kwargs for JOutStructure for flexibility
benrich37 Dec 3, 2024
2b23543
Partial cleanup of tests
benrich37 Dec 4, 2024
6a63bf0
Partial cleanup of tests
benrich37 Dec 4, 2024
726a774
Partial cleanup of tests
benrich37 Dec 4, 2024
78ecd32
Adding "structure" attribute to JOutStructure for convenient way to a…
benrich37 Dec 9, 2024
54810fd
fixes for trajectory
benrich37 Dec 9, 2024
1eddaa6
fix "structure" attribute being initialized as a JOutStructure
benrich37 Dec 9, 2024
32dd0f9
Merge branch 'materialsproject:master' into feature-jdftx-outputs
benrich37 Dec 12, 2024
a3c2105
Merge branch 'master' into feature-jdftx-outputs
mkhorton Jan 8, 2025
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