Skip to content

Commit

Permalink
ref: better warning traceback for deprecated weight_cp method
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jun 5, 2021
1 parent 304a724 commit 9056022
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.7.3
- build: move windows pipeline to GH Actions
- ref: better warning traceback for deprecated weight_cp method
1.7.2
- build: use oldest-supported-numpy in pyproject.toml
1.7.1
Expand Down
13 changes: 8 additions & 5 deletions nanite/model/weight.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import warnings

from .residuals import compute_contact_point_weights as weight_cp # noqa: F401
from .residuals import compute_contact_point_weights # noqa: F401

warnings.warn(
"The 'weight' module is deprecated. Please use "
"'from nanite.model.residuals import compute_contact_point_weights'!",
DeprecationWarning)

def weight_cp(*args, **kwargs):
warnings.warn(
"The 'weight' module is deprecated. Please use "
"'from nanite.model.residuals import compute_contact_point_weights'!",
DeprecationWarning)
return compute_contact_point_weights(*args, **kwargs)

0 comments on commit 9056022

Please sign in to comment.