Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10"
python-version: "3.11"
- name: Install py4vasp and testing tools
shell: bash -el {0}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v5
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test_minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test-minimal

# Verify that the minimum dependency versions declared in pyproject.toml actually
# install and pass the test suite. Uses uv's `lowest-direct` resolution to pin every
# direct dependency to its lowest declared version (transitive deps resolve normally)
# on the oldest supported Python. If this job fails, a declared lower bound is too low
# and should be raised (see https://scientific-python.org/specs/spec-0000/ for guidance).

on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 2 * * 6"

jobs:
test-minimal:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.11"
- name: Install py4vasp with lowest-direct dependency versions
run: |
uv --version
python --version
uv lock --resolution lowest-direct
uv sync --no-group doc
uv version
- name: Test with pytest
run: |
uv run pytest --version
uv run pytest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We recommend installing py4vasp in a conda environment to resolve issues related
installing `mdtraj` with pip. To do this please use the following steps. The last step
will test whether everything worked
~~~shell
conda create --name py4vasp-env python=3.10
conda create --name py4vasp-env python=3.11
conda activate py4vasp-env
conda install conda-forge::uv
git clone git@github.com:vasp-dev/py4vasp.git
Expand Down
2 changes: 1 addition & 1 deletion core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ authors = [
{ name = "Tomáš Bučko", email = "tomas.bucko@uniba.sk" },
{ name = "Max Liebetreu", email = "max.liebetreu@vasp.at" },
]
requires-python = ">=3.10"
requires-python = ">=3.11"
readme = "README.md"
license = "Apache-2.0"
dependencies = [
Expand Down
1,303 changes: 635 additions & 668 deletions core/uv.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ authors = [
{ name = "Tomáš Bučko", email = "tomas.bucko@uniba.sk" },
{ name = "Max Liebetreu", email = "max.liebetreu@vasp.at" },
]
requires-python = ">=3.10"
requires-python = ">=3.11"
readme = "README.md"
license = "Apache-2.0"
dependencies = [
Expand Down
9 changes: 7 additions & 2 deletions src/py4vasp/_third_party/graph/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
interpolate = import_.optional("scipy.interpolate")


def _cross_2d(a, b):
# numpy removed the cross product of 2d vectors, so compute the scalar directly
return a[0] * b[1] - a[1] * b[0]


@dataclasses.dataclass
class Contour(trace.Trace):
"""Represents data on a 2d slice through the unit cell.
Expand Down Expand Up @@ -406,7 +411,7 @@ def _interpolation_required(self):
return not np.allclose((y_position_first_vector, x_position_second_vector), 0)

def _interpolate_data(self, lattice, data):
area_cell = abs(np.cross(lattice[0], lattice[1]))
area_cell = abs(_cross_2d(lattice[0], lattice[1]))
points_per_area = data.size / area_cell
points_per_line = np.sqrt(points_per_area) * self._interpolation_factor
lengths = np.sum(np.abs(lattice), axis=0)
Expand Down Expand Up @@ -649,7 +654,7 @@ def _label_unit_cell_vectors(self):
]

def _shift_label(self, current_vector, other_vector):
invert = np.cross(current_vector, other_vector) < 0
invert = _cross_2d(current_vector, other_vector) < 0
norm = np.linalg.norm(current_vector)
shifts = self._shift_label_pixels * current_vector[::-1] / norm
if invert:
Expand Down
6 changes: 4 additions & 2 deletions tests/third_party/graph/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ def check_unit_cell(unit_cell, x, y, zero):

def check_annotations(lattice, annotations, Assert):
assert len(lattice.vectors) == len(annotations)
sign = np.sign(np.cross(*lattice.vectors))
first, second = lattice.vectors
sign = np.sign(first[0] * second[1] - first[1] * second[0])
labels = "abc".replace(lattice.cut, "")
for vector, label, annotation in zip(lattice.vectors, labels, annotations):
assert annotation.showarrow == False
Expand Down Expand Up @@ -882,7 +883,8 @@ def check_basic_tilted_contour(
graph = Graph(curr_contour)
fig = graph.to_plotly()
if not with_periodic_traces:
area_cell = np.linalg.norm(np.cross(*curr_contour.lattice.vectors))
first, second = curr_contour.lattice.vectors
area_cell = abs(first[0] * second[1] - first[1] * second[0])
points_per_area = curr_contour.data.size / area_cell
points_per_line = np.sqrt(points_per_area) * curr_contour._interpolation_factor
lengths = np.array(expected_lengths)
Expand Down
Loading
Loading