Skip to content

Conversation

@jorgensd
Copy link
Member

The deprecation was introduced 4 months ago (#168). Since all the core objects of UFL is using it (Mesh and FunctionSpace) it means that pytest is throwing tons of deprecation warnings at import:

python3 -W error::DeprecationWarning -c "import ufl.Mesh"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/shared/ufl/__init__.py", line 265, in <module>
    from ufl.domain import as_domain, AbstractDomain, Mesh, MeshView, TensorProductMesh
  File "/root/shared/ufl/domain.py", line 190, in <module>
    class TensorProductMesh(AbstractDomain):
  File "/root/shared/ufl/core/ufl_type.py", line 56, in attach_operators_from_hash_data
    warnings.warn("attach_operators_from_hash_data deprecated, please use UFLObject instead.", DeprecationWarning)
DeprecationWarning: attach_operators_from_hash_data deprecated, please use UFLObject instead.

The deprecation was introduced 4 months ago (#168).
Since all the core objects of UFL is using it (Mesh and FunctionSpace) it means that pytest is throwing tons of deprecation warnings at import:
```python
python3 -W error::DeprecationWarning -c "import ufl.Mesh"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/shared/ufl/__init__.py", line 265, in <module>
    from ufl.domain import as_domain, AbstractDomain, Mesh, MeshView, TensorProductMesh
  File "/root/shared/ufl/domain.py", line 190, in <module>
    class TensorProductMesh(AbstractDomain):
  File "/root/shared/ufl/core/ufl_type.py", line 56, in attach_operators_from_hash_data
    warnings.warn("attach_operators_from_hash_data deprecated, please use UFLObject instead.", DeprecationWarning)
DeprecationWarning: attach_operators_from_hash_data deprecated, please use UFLObject instead.
```
@jorgensd jorgensd requested review from dham and mscroggs October 15, 2023 19:06
@jorgensd jorgensd requested a review from garth-wells October 15, 2023 19:07
@jorgensd
Copy link
Member Author

@mscroggs seems like adding __str__ as an Abstract class might not be a great idea, as every object would have to overload it.

@mscroggs mscroggs merged commit 4b6142a into main Oct 16, 2023
@mscroggs mscroggs deleted the dokken/remove-deprecated_attach_ufl_object_attributes branch October 16, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants