FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
104 stars 64 forks source link

UFL deprecated function used in UFL code #132

Closed IgorBaratta closed 1 year ago

IgorBaratta commented 1 year ago

Running ufl tests highlights the issue:

python3 -m pytest -xvs test/
====================================================================================================== test session starts ======================================================================================================
platform linux -- Python 3.8.10, pytest-7.1.3, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: ...
plugins: forked-1.4.0, xdist-2.5.0
collected 561 items                                                                                                                                                                                                             

test/test_algorithms.py::test_extract_arguments_vs_fixture PASSED
test/test_algorithms.py::test_extract_coefficients_vs_fixture PASSED
test/test_algorithms.py::test_extract_elements_and_extract_unique_elements PASSED
test/test_algorithms.py::test_pre_and_post_traversal PASSED
test/test_algorithms.py::test_expand_indices Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_algorithms.py::test_adjoint PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/Constant.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/ConvectionJacobi.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/ConvectionJacobi2.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/ConvectionVector.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/Elasticity.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/EnergyNorm.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/Equation.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/ExplicitConvection.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/FEEC.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/FunctionOperators.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/H1norm.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/HarmonicMap.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/HarmonicMap2.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/Heat.py] PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/HornSchunck.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
test/test_analyse_demos.py::test_demo_files[/home/ia397/Projects/fenics/ufl/demo/HyperElasticity.py] Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
PASSED
garth-wells commented 1 year ago

@mscroggs could you take a look at this?

chrisrichardson commented 1 year ago

We should be using the Python logging and warnings system, instead of UFL's homemade one. Then we could suppress the warnings more easily.

garth-wells commented 1 year ago

We should be using the Python logging and warnings system, instead of UFL's homemade one. Then we could suppress the warnings more easily.

and turn deprecation warnings into error so we can find where the functions are called.

chrisrichardson commented 1 year ago

https://github.com/FEniCS/ufl/tree/chris/python-warnings

mscroggs commented 1 year ago

We should be using the Python logging and warnings system, instead of UFL's homemade one. Then we could suppress the warnings more easily.

I also started on this in https://github.com/FEniCS/ufl/tree/mscroggs/log

mscroggs commented 1 year ago

This warnings will be showing up after https://github.com/FEniCS/ufl/pull/131.

There were some functions that had comment stating that they should be made to give a deprecation warning, that I replaced with deprecation warnings. I'll take a look and work out which of these is causing this

mscroggs commented 1 year ago

Can this now be closed following #139?

IgorBaratta commented 1 year ago

I think so, the warnings are not showing up anymore.