From e48e652f7abf56b56f51eb317b5d1ad170399145 Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 11:36:28 +0100 Subject: [PATCH 01/10] Bump version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7fd1d047..4c0a9f99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "py4vasp" -version = "0.9.0" +version = "0.10.0" description = "Tool for assisting with the analysis and setup of VASP calculations." authors = [ "VASP Software GmbH ", From f2727a2f7768f1a38ce7c44c7330e24e8122c896 Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 11:36:39 +0100 Subject: [PATCH 02/10] Update documentation --- docs/conf.py | 2 +- docs/index.rst | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4f85b52d..45fce27f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = "VASP Software GmbH" # The full version, including alpha/beta/rc tags -release = "0.9.0" +release = "0.10.0" # -- General configuration --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 1c90224f..aa3bddea 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,15 +28,7 @@ You can then install *py4vasp* from PyPI_ using the pip package installer pip install py4vasp -This will automatically download *py4vasp* as well as most of the required dependencies. -However, we do not install the *mdtraj* dependency by default because it does not -reliably work with pip. We recommend to install *mdtraj* using conda - -.. code-block:: bash - - conda install -c conda-forge mdtraj - -if you need the features that depend on it (plotting a trajectory of structures). +This will automatically download *py4vasp* and its required dependencies. For a minimalistic setup where you use py4vasp as a library, you can install the core package @@ -59,7 +51,6 @@ the next VASP version is released. git clone https://github.com/vasp-dev/py4vasp.git cd py4vasp pip install . - conda install -c conda-forge mdtraj If these commands succeed, you should be able to use *py4vasp*. You can make a quick test of your installation running the following command @@ -162,6 +153,14 @@ how you can apply *py4vasp* in your research. Calculation + +Optional dependencies +--------------------- +You can install mdtraj if you want to analyze molecular dynamics trajectories +beyond the pair correlation function. We recommend using conda for the installation +which we found to be more robust than pip. + + ---------------------------------------------------------------------------------------- .. _venv: https://docs.python.org/3/tutorial/venv.html From 3fbe2de5210bcd037e79112aed30154a7604b52c Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 12:05:03 +0100 Subject: [PATCH 03/10] Add exceptions to index, remove control --- docs/convert.yaml | 3 --- docs/index.rst | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/convert.yaml b/docs/convert.yaml index d74267e4..be63555a 100644 --- a/docs/convert.yaml +++ b/docs/convert.yaml @@ -4,9 +4,6 @@ latest: - dirhtml/_packages/py4vasp.calculation - dirhtml/_classes/py4vasp.Calculation - dirhtml/_packages/py4vasp.calculation.* - - raw: - - dirhtml/raw - - dirhtml/api/py4vasp.raw.* - exception: - dirhtml/exception - dirhtml/api/py4vasp.exception.* diff --git a/docs/index.rst b/docs/index.rst index aa3bddea..f4c3ade6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -144,6 +144,7 @@ how you can apply *py4vasp* in your research. :recursive: calculation + exception .. rubric:: Classes From 3cb1b8cbed898365ad90858bb234c47d86c2246b Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 14:51:28 +0100 Subject: [PATCH 04/10] Bump version number --- src/py4vasp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py4vasp/__init__.py b/src/py4vasp/__init__.py index ec74a95d..511cfcb2 100644 --- a/src/py4vasp/__init__.py +++ b/src/py4vasp/__init__.py @@ -6,5 +6,5 @@ from py4vasp._third_party.interactive import set_error_handling from py4vasp.calculation._class import Calculation -__version__ = "0.9.0" +__version__ = "0.10.0" set_error_handling("Minimal") From c63040446ceea631b5d9e3210bc7ea8273d7db4c Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 14:52:26 +0100 Subject: [PATCH 05/10] Update VASP colors --- src/py4vasp/_config.py | 11 +++++++++-- src/py4vasp/_third_party/graph/__init__.py | 10 +++++++--- src/py4vasp/_third_party/graph/contour.py | 3 ++- src/py4vasp/calculation/_density.py | 7 ++++--- src/py4vasp/calculation/_force.py | 2 +- src/py4vasp/calculation/_magnetism.py | 2 +- src/py4vasp/calculation/_potential.py | 3 ++- src/py4vasp/calculation/_velocity.py | 2 +- tests/calculation/test_density.py | 17 ++++++++++------- tests/calculation/test_force.py | 2 +- tests/calculation/test_magnetism.py | 2 +- tests/calculation/test_potential.py | 15 ++++++++++----- tests/calculation/test_velocity.py | 2 +- tests/third_party/graph/test_graph.py | 2 +- 14 files changed, 51 insertions(+), 29 deletions(-) diff --git a/src/py4vasp/_config.py b/src/py4vasp/_config.py index 2c3404e2..8296ad7d 100644 --- a/src/py4vasp/_config.py +++ b/src/py4vasp/_config.py @@ -1,4 +1,11 @@ # Copyright © VASP Software GmbH, # Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) -VASP_COLORS = ("#4C265F", "#2FB5AB", "#2C68FC", "#A82C35", "#808080", "#212529") -VASP_PURPLE, VASP_CYAN, VASP_BLUE, VASP_RED, VASP_GRAY, VASP_DARK = VASP_COLORS +VASP_COLORS = { + "purple": "#8342A4", + "cyan": "#35CABF", + "blue": "#3E70EA", + "red": "#A82C35", + "gray": "#424242", + "dark": "#202429", + "green": "#89AD01", +} diff --git a/src/py4vasp/_third_party/graph/__init__.py b/src/py4vasp/_third_party/graph/__init__.py index 5db9f5ad..7bc246ce 100644 --- a/src/py4vasp/_third_party/graph/__init__.py +++ b/src/py4vasp/_third_party/graph/__init__.py @@ -2,7 +2,7 @@ # Licensed under the Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import copy -from py4vasp._config import VASP_BLUE, VASP_COLORS, VASP_GRAY, VASP_RED +from py4vasp._config import VASP_COLORS from py4vasp._util import import_ from .contour import Contour @@ -17,9 +17,13 @@ if import_.is_imported(go) and import_.is_imported(pio): axis_format = {"showexponent": "all", "exponentformat": "power"} contour = copy.copy(pio.templates["ggplot2"].data.contour[0]) - contour.colorscale = [[0, VASP_BLUE], [0.5, VASP_GRAY], [1, VASP_RED]] + begin_blue = [0, VASP_COLORS["blue"]] + middle_gray = [0.5, VASP_COLORS["gray"]] + end_red = [1, VASP_COLORS["red"]] + contour.colorscale = [begin_blue, middle_gray, end_red] data = {"contour": (contour,)} - layout = {"colorway": VASP_COLORS, "xaxis": axis_format, "yaxis": axis_format} + colorway = list(VASP_COLORS.values()) + layout = {"colorway": colorway, "xaxis": axis_format, "yaxis": axis_format} pio.templates["vasp"] = go.layout.Template(data=data, layout=layout) pio.templates["ggplot2"].layout.shapedefaults = {} pio.templates.default = "ggplot2+vasp" diff --git a/src/py4vasp/_third_party/graph/contour.py b/src/py4vasp/_third_party/graph/contour.py index 3e6fb0ad..147612a9 100644 --- a/src/py4vasp/_third_party/graph/contour.py +++ b/src/py4vasp/_third_party/graph/contour.py @@ -144,7 +144,8 @@ def _create_unit_cell(self): corners = (vectors[0], vectors[0] + vectors[1], vectors[1]) to_corners = (f"L {pos_to_str(corner)}" for corner in corners) path = f"M 0 0 {' '.join(to_corners)} Z" - unit_cell = {"type": "path", "line": {"color": _config.VASP_DARK}, "path": path} + color = _config.VASP_COLORS["dark"] + unit_cell = {"type": "path", "line": {"color": color}, "path": path} return (unit_cell,) def _label_unit_cell_vectors(self): diff --git a/src/py4vasp/calculation/_density.py b/src/py4vasp/calculation/_density.py index 37dd926f..bb06f75f 100644 --- a/src/py4vasp/calculation/_density.py +++ b/src/py4vasp/calculation/_density.py @@ -315,11 +315,12 @@ def _isosurfaces(self, component, isolevel=0.2, color=None, opacity=0.6): if self._use_symmetric_isosurface(component): _raise_error_if_color_is_specified(color) return [ - view.Isosurface(isolevel, _config.VASP_BLUE, opacity), - view.Isosurface(-isolevel, _config.VASP_RED, opacity), + view.Isosurface(isolevel, _config.VASP_COLORS["blue"], opacity), + view.Isosurface(-isolevel, _config.VASP_COLORS["red"], opacity), ] else: - return [view.Isosurface(isolevel, color or _config.VASP_CYAN, opacity)] + color = color or _config.VASP_COLORS["cyan"] + return [view.Isosurface(isolevel, color, opacity)] def _use_symmetric_isosurface(self, component): if component > 0 and self.is_nonpolarized(): diff --git a/src/py4vasp/calculation/_force.py b/src/py4vasp/calculation/_force.py index 39248c1d..fe94aff7 100644 --- a/src/py4vasp/calculation/_force.py +++ b/src/py4vasp/calculation/_force.py @@ -87,7 +87,7 @@ def to_view(self, supercell=None): ion_arrow = view.IonArrow( quantity=forces, label="forces", - color=_config.VASP_PURPLE, + color=_config.VASP_COLORS["purple"], radius=0.2, ) viewer.ion_arrows = [ion_arrow] diff --git a/src/py4vasp/calculation/_magnetism.py b/src/py4vasp/calculation/_magnetism.py index 2c2152cf..85669cf4 100644 --- a/src/py4vasp/calculation/_magnetism.py +++ b/src/py4vasp/calculation/_magnetism.py @@ -115,7 +115,7 @@ def to_view(self, selection="total", supercell=None): ion_arrows = view.IonArrow( quantity=moments, label=f"{selection} moments", - color=_config.VASP_BLUE, + color=_config.VASP_COLORS["blue"], radius=0.2, ) viewer.ion_arrows = [ion_arrows] diff --git a/src/py4vasp/calculation/_potential.py b/src/py4vasp/calculation/_potential.py index b1a50800..d86e737f 100644 --- a/src/py4vasp/calculation/_potential.py +++ b/src/py4vasp/calculation/_potential.py @@ -109,7 +109,7 @@ def to_view(self, selection="total", supercell=None, **user_options): return viewer def _create_potential_isosurface( - self, kind, component, isolevel=0, color=_config.VASP_CYAN, opacity=0.6 + self, kind, component, isolevel=0, color=None, opacity=0.6 ): self._raise_error_if_kind_incorrect(kind) potential_data = self._get_potential(kind) @@ -120,6 +120,7 @@ def _create_potential_isosurface( potential = potential_data[0] - potential_data[1] else: potential = potential_data[0] + color = color or _config.VASP_COLORS["cyan"] return view.GridQuantity( quantity=potential.T[np.newaxis], label=f"{kind} potential" + (f"({component})" if component else ""), diff --git a/src/py4vasp/calculation/_velocity.py b/src/py4vasp/calculation/_velocity.py index 1426b9f7..11945d98 100644 --- a/src/py4vasp/calculation/_velocity.py +++ b/src/py4vasp/calculation/_velocity.py @@ -85,7 +85,7 @@ def to_view(self, supercell=None): ion_arrow = view.IonArrow( quantity=velocities, label="velocities", - color=_config.VASP_GRAY, + color=_config.VASP_COLORS["gray"], radius=0.2, ) viewer.ion_arrows = [ion_arrow] diff --git a/tests/calculation/test_density.py b/tests/calculation/test_density.py index d05d7391..251c085a 100644 --- a/tests/calculation/test_density.py +++ b/tests/calculation/test_density.py @@ -113,7 +113,8 @@ def test_empty_density(empty_density): @pytest.mark.parametrize("selection", [None, "0", "unity", "sigma_0", "scalar"]) def test_charge_plot(selection, reference_density, Assert): source = reference_density.ref.source - isosurfaces = [Isosurface(isolevel=0.2, color=_config.VASP_CYAN, opacity=0.6)] + color = _config.VASP_COLORS["cyan"] + isosurfaces = [Isosurface(isolevel=0.2, color=color, opacity=0.6)] if source == "charge": expected = Expectation( label=selection if selection else "charge", @@ -156,8 +157,8 @@ def test_accessing_spin_raises_error(nonpolarized_density): def test_collinear_plot(selection, collinear_density, Assert): source = collinear_density.ref.source isosurfaces = [ - Isosurface(isolevel=0.1, color=_config.VASP_BLUE, opacity=0.6), - Isosurface(isolevel=-0.1, color=_config.VASP_RED, opacity=0.6), + Isosurface(isolevel=0.1, color=_config.VASP_COLORS["blue"], opacity=0.6), + Isosurface(isolevel=-0.1, color=_config.VASP_COLORS["red"], opacity=0.6), ] if source == "charge": expected = Expectation( @@ -211,8 +212,8 @@ def test_plotting_noncollinear_density(selections, noncollinear_density, Assert) if "(" in selections[0]: # magnetization not allowed for kinetic_energy return isosurfaces = [ - Isosurface(isolevel=0.2, color=_config.VASP_BLUE, opacity=0.3), - Isosurface(isolevel=-0.2, color=_config.VASP_RED, opacity=0.3), + Isosurface(isolevel=0.2, color=_config.VASP_COLORS["blue"], opacity=0.3), + Isosurface(isolevel=-0.2, color=_config.VASP_COLORS["red"], opacity=0.3), ] for selection, density, label in zip(selections, expected_density, expected_labels): expected = Expectation(label, density, isosurfaces) @@ -228,10 +229,11 @@ def test_adding_components(noncollinear_density, Assert): else: expected_label = f"{source}(1 + 2)" expected_density = noncollinear_density.ref.output[source][1:] + color = _config.VASP_COLORS["cyan"] expected = Expectation( label=expected_label, density=expected_density[0] + expected_density[1], - isosurfaces=[Isosurface(isolevel=0.4, color=_config.VASP_CYAN, opacity=0.6)], + isosurfaces=[Isosurface(isolevel=0.4, color=color, opacity=0.6)], ) check_view(noncollinear_density, expected, Assert, selection="1 + 2", isolevel=0.4) @@ -239,7 +241,8 @@ def test_adding_components(noncollinear_density, Assert): @pytest.mark.parametrize("supercell", [2, (3, 2, 1)]) def test_plotting_supercell(supercell, reference_density, Assert): source = reference_density.ref.source - isosurfaces = [Isosurface(isolevel=0.2, color=_config.VASP_CYAN, opacity=0.6)] + color = _config.VASP_COLORS["cyan"] + isosurfaces = [Isosurface(isolevel=0.2, color=color, opacity=0.6)] if source == "charge": expected = Expectation( label=source, diff --git a/tests/calculation/test_force.py b/tests/calculation/test_force.py index 3c947a6c..97db267a 100644 --- a/tests/calculation/test_force.py +++ b/tests/calculation/test_force.py @@ -49,7 +49,7 @@ def test_plot(forces, steps, supercell, Assert): assert arrows.quantity.ndim == 3 Assert.allclose(arrows.quantity, forces.force_rescale * forces.ref.forces[steps]) assert arrows.label == "forces" - assert arrows.color == _config.VASP_PURPLE + assert arrows.color == _config.VASP_COLORS["purple"] assert arrows.radius == 0.2 diff --git a/tests/calculation/test_magnetism.py b/tests/calculation/test_magnetism.py index 288e65c3..406deed6 100644 --- a/tests/calculation/test_magnetism.py +++ b/tests/calculation/test_magnetism.py @@ -184,7 +184,7 @@ def check_view(view, reference_moments, selection, Assert): Assert.allclose(arrows.quantity, reference_moments) expected_label = f"{selection} moments" if selection else "total moments" assert arrows.label == expected_label - assert arrows.color == _config.VASP_BLUE + assert arrows.color == _config.VASP_COLORS["blue"] assert arrows.radius == 0.2 diff --git a/tests/calculation/test_potential.py b/tests/calculation/test_potential.py index f2bfad98..9bb416dc 100644 --- a/tests/calculation/test_potential.py +++ b/tests/calculation/test_potential.py @@ -100,10 +100,11 @@ def test_read(reference_potential, Assert): def test_plot_total_potential(reference_potential, Assert): view = reference_potential.plot() + color = _config.VASP_COLORS["cyan"] expectation = Expectation( label="total potential", potential=reference_potential.ref.output["total"], - isosurface=Isosurface(isolevel=0, color=_config.VASP_CYAN, opacity=0.6), + isosurface=Isosurface(isolevel=0, color=color, opacity=0.6), ) check_view(reference_potential, view, [expectation], Assert) @@ -114,10 +115,11 @@ def test_plot_selected_potential(reference_potential, Assert): else: selection = "total" view = reference_potential.plot(selection, isolevel=0.2) + color = _config.VASP_COLORS["cyan"] expectation = Expectation( label=f"{selection} potential", potential=reference_potential.ref.output[selection], - isosurface=Isosurface(isolevel=0.2, color=_config.VASP_CYAN, opacity=0.6), + isosurface=Isosurface(isolevel=0.2, color=color, opacity=0.6), ) check_view(reference_potential, view, [expectation], Assert) @@ -126,10 +128,11 @@ def test_plot_selected_potential(reference_potential, Assert): def test_plot_spin_potential(raw_data, selection, Assert): potential = make_reference_potential(raw_data, "Fe3O4 collinear", "total") view = potential.plot(selection, opacity=0.3) + color = _config.VASP_COLORS["cyan"] expectation = Expectation( label=f"total potential({selection})", potential=potential.ref.output[f"total_{selection}"], - isosurface=Isosurface(isolevel=0.0, color=_config.VASP_CYAN, opacity=0.3), + isosurface=Isosurface(isolevel=0.0, color=color, opacity=0.3), ) check_view(potential, view, [expectation], Assert) @@ -137,7 +140,8 @@ def test_plot_spin_potential(raw_data, selection, Assert): def test_plot_multiple_selections(raw_data, Assert): potential = make_reference_potential(raw_data, "Fe3O4 collinear", "all") view = potential.plot("up(total) hartree xc(down)") - isosurface = Isosurface(isolevel=0.0, color=_config.VASP_CYAN, opacity=0.6) + color = _config.VASP_COLORS["cyan"] + isosurface = Isosurface(isolevel=0.0, color=color, opacity=0.6) expectations = [ Expectation( label="total potential(up)", @@ -162,10 +166,11 @@ def test_plot_multiple_selections(raw_data, Assert): def test_plot_supercell(raw_data, supercell, Assert): potential = make_reference_potential(raw_data, "Sr2TiO4", "total") view = potential.plot(supercell=supercell) + color = _config.VASP_COLORS["cyan"] expectation = Expectation( label="total potential", potential=potential.ref.output[f"total"], - isosurface=Isosurface(isolevel=0, color=_config.VASP_CYAN, opacity=0.6), + isosurface=Isosurface(isolevel=0, color=color, opacity=0.6), ) check_view(potential, view, [expectation], Assert, supercell=supercell) diff --git a/tests/calculation/test_velocity.py b/tests/calculation/test_velocity.py index ee76ae70..2539386e 100644 --- a/tests/calculation/test_velocity.py +++ b/tests/calculation/test_velocity.py @@ -50,7 +50,7 @@ def test_plot(velocities, steps, supercell, Assert): expected_velocities = velocities.velocity_rescale * velocities.ref.velocities[steps] Assert.allclose(arrows.quantity, expected_velocities) assert arrows.label == "velocities" - assert arrows.color == _config.VASP_GRAY + assert arrows.color == _config.VASP_COLORS["gray"] assert arrows.radius == 0.2 diff --git a/tests/third_party/graph/test_graph.py b/tests/third_party/graph/test_graph.py index 1fd8b09f..e3fbeb0c 100644 --- a/tests/third_party/graph/test_graph.py +++ b/tests/third_party/graph/test_graph.py @@ -464,7 +464,7 @@ def test_contour_supercell(rectangle_contour, Assert, not_core): def check_unit_cell(unit_cell, x, y, zero): assert unit_cell.type == "path" assert unit_cell.path == f"M 0 0 L {x} {zero} L {x} {y} L {zero} {y} Z" - assert unit_cell.line.color == _config.VASP_DARK + assert unit_cell.line.color == _config.VASP_COLORS["dark"] def check_annotations(lattice, annotations, Assert): From bb4cea49e4f2e639afa820ffe9d7f79a9ed75bbc Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 15:03:45 +0100 Subject: [PATCH 06/10] Update convert test --- tests/util/test_convert.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/util/test_convert.py b/tests/util/test_convert.py index 390acee5..4e31e835 100644 --- a/tests/util/test_convert.py +++ b/tests/util/test_convert.py @@ -36,7 +36,8 @@ def test_matrix_to_complex(Assert): def test_hex_to_rgb(Assert): - colors = [ + colors = ("#4C265F", "#2FB5AB", "#2C68FC", "#A82C35", "#808080", "#212529") + converted = [ [76, 38, 95], [47, 181, 171], [44, 104, 252], @@ -44,6 +45,6 @@ def test_hex_to_rgb(Assert): [128, 128, 128], [33, 37, 41], ] - expected = np.array(colors) / 255 - actual = np.array([to_rgb(color) for color in VASP_COLORS]) + expected = np.array(converted) / 255 + actual = np.array([to_rgb(color) for color in colors]) Assert.allclose(expected, actual) From 8d6203b034b6e0bd6c9add1a09b1350f347d2c7d Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 15:04:37 +0100 Subject: [PATCH 07/10] Bump version of core package --- core/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pyproject.toml b/core/pyproject.toml index 15063423..91e22c7a 100644 --- a/core/pyproject.toml +++ b/core/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "py4vasp-core" -version = "0.9.0" +version = "0.10.0" description = "Tool for assisting with the analysis and setup of VASP calculations." authors = [ "VASP Software GmbH ", From aa21a8e3493ff185fc05167858d43fce07c4dbb6 Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 15:26:21 +0100 Subject: [PATCH 08/10] Update numpy types for numpy 2.0 --- src/py4vasp/_util/slicing.py | 2 +- src/py4vasp/calculation/_structure.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/py4vasp/_util/slicing.py b/src/py4vasp/_util/slicing.py index 4b797a6d..21cdc77b 100644 --- a/src/py4vasp/_util/slicing.py +++ b/src/py4vasp/_util/slicing.py @@ -174,7 +174,7 @@ def _rotate_normal_to_cartesian_axis(vectors, normal): def _get_old_normal(vectors): - old_normal = np.cross(*vectors).astype(np.float_) + old_normal = np.cross(*vectors).astype(np.float64) return old_normal / np.linalg.norm(old_normal) diff --git a/src/py4vasp/calculation/_structure.py b/src/py4vasp/calculation/_structure.py index 530d6896..bb57ca36 100644 --- a/src/py4vasp/calculation/_structure.py +++ b/src/py4vasp/calculation/_structure.py @@ -360,7 +360,7 @@ def _topology(self): return calculation.topology.from_data(self._raw_data.topology) def _scale(self): - if isinstance(self._raw_data.cell.scale, np.float_): + if isinstance(self._raw_data.cell.scale, np.float64): return self._raw_data.cell.scale if not self._raw_data.cell.scale.is_none(): return self._raw_data.cell.scale[()] From 7426d7b69b947e5a8d9e447541bd7cef272696c1 Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 15:41:01 +0100 Subject: [PATCH 09/10] Limit mdtraj to prevent conflict with older ASE version --- .github/workflows/test_full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_full.yml b/.github/workflows/test_full.yml index 8c62951b..2e41820d 100644 --- a/.github/workflows/test_full.yml +++ b/.github/workflows/test_full.yml @@ -36,7 +36,7 @@ jobs: shell: bash -el {0} run: | conda info - conda install -q -c conda-forge mdtraj + conda install -q -c conda-forge mdtraj<1.10.2 - name: Test with pytest shell: bash -el {0} run: | From 34124488db037e2acc7330d7122711a16548a235 Mon Sep 17 00:00:00 2001 From: Martin Schlipf Date: Fri, 20 Dec 2024 15:43:32 +0100 Subject: [PATCH 10/10] Fix Github action --- .github/workflows/test_full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_full.yml b/.github/workflows/test_full.yml index 2e41820d..b9fa6a3c 100644 --- a/.github/workflows/test_full.yml +++ b/.github/workflows/test_full.yml @@ -36,7 +36,7 @@ jobs: shell: bash -el {0} run: | conda info - conda install -q -c conda-forge mdtraj<1.10.2 + conda install -q -c conda-forge "mdtraj<1.10.2" - name: Test with pytest shell: bash -el {0} run: |