Skip to content

Commit

Permalink
remove caching of deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Aug 14, 2023
1 parent 6fd2219 commit f3c119e
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions ffcx/element_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Finite element interface."""

from __future__ import annotations

import typing
import warnings
from functools import lru_cache


import basix
import basix.ufl
import ufl
Expand All @@ -24,24 +21,11 @@ def convert_element(element: ufl.finiteelement.FiniteElementBase) -> basix.ufl._
if isinstance(element, basix.ufl._ElementBase):
return element
else:
return _cached_conversion(element)


@lru_cache()
def _cached_conversion(element: ufl.finiteelement.FiniteElementBase) -> basix.ufl._ElementBase:
"""Create an FFCx element from a UFL element.
Args:
element: A UFL finite element
Returns:
A Basix finite element
"""
warnings.warn(
"Use of elements created by UFL is deprecated. You should create elements directly using Basix.",
DeprecationWarning)
warnings.warn(
"Use of elements created by UFL is deprecated. You should create elements directly using Basix.",
DeprecationWarning)

return basix.ufl.convert_ufl_element(element)
return basix.ufl.convert_ufl_element(element)


def basix_index(indices: typing.Tuple[int]) -> int:
Expand Down

0 comments on commit f3c119e

Please sign in to comment.