Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated functionality (attach_operators_from_hash_data). #220

Merged
merged 4 commits into from
Oct 16, 2023

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
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
19 checks passed
@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.

2 participants