Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
05b1d60
fix import
JaGeo Mar 25, 2026
37a62dd
Merge branch 'main' into fix_pymatgen_bug
JaGeo Mar 25, 2026
7c73b66
pre-commit auto-fixes
pre-commit-ci[bot] Mar 25, 2026
fe4441b
modify order of the atoms in the test output to accommodate pymatgen …
JaGeo Mar 25, 2026
0f4f102
modify order of the atoms in the test output to accommodate pymatgen …
JaGeo Mar 25, 2026
3f8e900
pre-commit auto-fixes
pre-commit-ci[bot] Mar 25, 2026
90d8cca
fix some more tests
JaGeo Mar 25, 2026
5079307
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 25, 2026
44449a5
pre-commit auto-fixes
pre-commit-ci[bot] Mar 25, 2026
2bec9c8
remove hallucinated additional number
JaGeo Mar 25, 2026
e015164
pre-commit auto-fixes
pre-commit-ci[bot] Mar 25, 2026
4513b7b
fix structure graph
JaGeo Mar 25, 2026
f70c374
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 25, 2026
48f30f9
pre-commit auto-fixes
pre-commit-ci[bot] Mar 25, 2026
a794e22
sort
JaGeo Mar 26, 2026
05ea998
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
13f4670
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
7acf150
fix tests
JaGeo Mar 26, 2026
ec5aa06
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
445f37a
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
db327df
fix structure graph
JaGeo Mar 26, 2026
f5d8884
make test stable
JaGeo Mar 26, 2026
a3a11d5
fix text comparisons
JaGeo Mar 26, 2026
7a39e3c
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
bd9e357
fix text comparisons
JaGeo Mar 26, 2026
b912746
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
be8c91b
fix bond graph
JaGeo Mar 26, 2026
f5570b9
fix bond graph
JaGeo Mar 26, 2026
ef44229
fix description
JaGeo Mar 26, 2026
4707403
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
61d9a9b
fix description and graph
JaGeo Mar 26, 2026
f5d5c77
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
028a294
fix description and graph
JaGeo Mar 26, 2026
a2e1238
fix more graphs
JaGeo Mar 26, 2026
434f3c8
fix more graphs
JaGeo Mar 26, 2026
1225548
fix more graphs
JaGeo Mar 26, 2026
28077f4
fix more graphs
JaGeo Mar 26, 2026
7bce3af
fix graphs finally
JaGeo Mar 26, 2026
994e914
remove bond label checks for now
JaGeo Mar 26, 2026
91eba32
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
49d739a
drop python 3.11 and include 3.13
JaGeo Mar 26, 2026
7a6ddfc
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
79c258d
drop python 3.11 and include 3.13
JaGeo Mar 26, 2026
b9bb4b6
fix cohp
JaGeo Mar 26, 2026
f595477
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
5474af6
fix cohp
JaGeo Mar 26, 2026
5f5f7d1
Merge branch 'fix_pymatgen_bug' of github.com:JaGeo/LobsterPy into fi…
JaGeo Mar 26, 2026
b3897f8
fix cohp
JaGeo Mar 26, 2026
e9233b4
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
537518a
fix the last test
JaGeo Mar 26, 2026
f063f59
fix the last test
JaGeo Mar 26, 2026
98701a8
fix the last test
JaGeo Mar 26, 2026
4718ca8
pre-commit auto-fixes
pre-commit-ci[bot] Mar 26, 2026
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
18 changes: 9 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
split: [1, 2, 3, 4, 5]


Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
pytest --cov=lobsterpy --cov-report term-missing --cov-append --splits 5 --group ${{ matrix.split }} -vv --durations-path ./tests/test_data/.pytest-split-durations --store-durations

- name: Upload coverage
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.split }}
Expand All @@ -79,7 +79,7 @@ jobs:
path: ./.coverage

- name: Upload test durations artifact
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: test-durations-${{ matrix.python-version }}-${{ matrix.split }}
Expand All @@ -91,10 +91,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install Coverage
run: |
Expand All @@ -104,7 +104,7 @@ jobs:
continue-on-error: true
uses: actions/download-artifact@v4
with:
pattern: coverage-3.10-*
pattern: coverage-3.11-*

- name: Run coverage
continue-on-error: true
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
uses: mamba-org/setup-micromamba@main
- name: Create mamba environment
run: |
micromamba create -n lobpy_test python=3.10 --yes
micromamba create -n lobpy_test python=3.11 --yes
- name: Install uv
run: micromamba run -n lobpy_test pip install uv
- name: Install lobsterpy and dependencies
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ authors = [{ name = "Janine George", email = "janine.george@bam.de" }]
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
]
requires-python = ">=3.10,<3.13"
requires-python = ">=3.11,<3.14"
dependencies = [
"pymatgen>=2024.10.22",
"numpy<3.0.0",
Expand Down
61 changes: 41 additions & 20 deletions src/lobsterpy/cohp/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
Lobsterout,
MadelungEnergies,
)

try:
from pymatgen.io.lobster.lobsterenv import LobsterNeighbors
from pymatgen.analysis.lobster_env import LobsterNeighbors # type: ignore[attr-defined]
except ImportError:
from pymatgen.analysis.lobster_env import LobsterNeighbors # type: ignore
from pymatgen.io.lobster.lobsterenv import LobsterNeighbors # type: ignore[attr-defined]

from pymatgen.io.vasp.outputs import Vasprun
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from scipy.integrate import trapezoid
Expand Down Expand Up @@ -390,15 +392,24 @@ def get_information_all_bonds(self, summed_spins: bool = True):
# go through all anions in the structure!
for anion in self.anion_types:
# get labels and summed cohp objects
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
obj_cohpcar=self._completecohp_obj,
isites=[ice],
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(anion)],
)

try:
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
obj_cohpcar=self._completecohp_obj,
isites=[ice],
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(anion)],
)
except TypeError:
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
coxxcar_obj=self._completecohp_obj,
isites=[ice],
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(anion)],
)
aniontype_labels.append(labels)
aniontype_cohps.append(summedcohps)

Expand Down Expand Up @@ -429,15 +440,25 @@ def get_information_all_bonds(self, summed_spins: bool = True):

for element in self.elements:
# get labels and summed cohp objects
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
obj_cohpcar=self._completecohp_obj,
isites=[ice],
onlycation_isites=False,
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(element)],
)
try:
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
obj_cohpcar=self._completecohp_obj,
isites=[ice],
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(element)],
)
except TypeError:
labels, summedcohps = self.chemenv.get_info_cohps_to_neighbors(
path_to_cohpcar=self.path_to_cohpcar,
coxxcar_obj=self._completecohp_obj,
isites=[ice],
onlycation_isites=False,
summed_spin_channels=summed_spins,
per_bond=False,
only_bonds_to=[str(element)],
)

type_labels.append(labels)
type_cohps.append(summedcohps)
Expand Down
6 changes: 5 additions & 1 deletion src/lobsterpy/structuregraph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from pathlib import Path

from pymatgen.core.structure import Structure
from pymatgen.io.lobster.lobsterenv import LobsterNeighbors

try:
from pymatgen.analysis.lobster_env import LobsterNeighbors # type: ignore[attr-defined]
except ImportError:
from pymatgen.io.lobster.lobsterenv import LobsterNeighbors # type: ignore[attr-defined]
from pymatgen.io.lobster.outputs import Charge

from lobsterpy.cohp.analyze import Analysis
Expand Down
Loading
Loading