From d5f56d66dcc561ad017b0d3fde42e59f209f82f5 Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Wed, 25 Sep 2024 21:22:17 +0100 Subject: [PATCH] Remove deprecated method for accessing PETSc Vec in Python (#3435) * Remove deprecated method * Remove leftover import --- python/dolfinx/fem/function.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/python/dolfinx/fem/function.py b/python/dolfinx/fem/function.py index 1c990fb663..729294c3bb 100644 --- a/python/dolfinx/fem/function.py +++ b/python/dolfinx/fem/function.py @@ -8,7 +8,6 @@ from __future__ import annotations import typing -import warnings from functools import singledispatch import numpy as np @@ -484,25 +483,6 @@ def x(self) -> la.Vector: """Vector holding the degrees-of-freedom.""" return self._x - @property - def vector(self): - """PETSc vector holding the degrees-of-freedom. - - Upon first call, this function creates a PETSc ``Vec`` object - that wraps the degree-of-freedom data. The ``Vec`` object is - cached and the cached ``Vec`` is returned upon subsequent calls. - - Note: - Prefer :func`x` where possible. - """ - warnings.warn( - "dolfinx.fem.Function.vector is deprecated.\n" - "Please use dolfinx.fem.Function.x.petsc_vec " - "to access the underlying petsc4py wrapper", - DeprecationWarning, - ) - return self.x.petsc_vec - @property def dtype(self) -> np.dtype: return np.dtype(self._cpp_object.x.array.dtype)