Skip to content

Commit ba92746

Browse files
committed
DOC: insert non-sympy fields into signature
1 parent 01c4277 commit ba92746

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ampform/sympy/_decorator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,11 @@ def _implement_new_method(cls: type[ExprClass]) -> type[ExprClass]:
251251
frozen=False,
252252
)(cls)
253253
cls = _update_field_metadata(cls)
254-
sympy_fields = _get_sympy_fields(cls)
255254
non_sympy_fields = tuple(f for f in _get_fields(cls) if not _is_sympify(f)) # type: ignore[arg-type]
256255
cls.__slots__ = tuple(f.name for f in non_sympy_fields) # type: ignore[arg-type]
257256

258257
@functools.wraps(cls.__new__)
259-
@_insert_args_in_signature([f.name for f in sympy_fields], idx=1)
258+
@_insert_args_in_signature([f.name for f in _get_fields(cls)], idx=1) # type:ignore[arg-type]
260259
def new_method(cls, *args, evaluate: bool = False, **kwargs) -> type[ExprClass]:
261260
fields_with_values, hints = _extract_field_values(cls, *args, **kwargs)
262261
fields_with_sympified_values = {
@@ -548,7 +547,7 @@ def _xreplace_method(self, rule) -> tuple[sp.Expr, bool]:
548547
return self, False
549548

550549

551-
def _get_sympy_fields(cls) -> tuple[Field, ...]:
550+
def get_sympy_fields(cls) -> tuple[Field, ...]:
552551
return tuple(f for f in _get_fields(cls) if _is_sympify(f))
553552

554553

0 commit comments

Comments
 (0)