Skip to content

Commit b4e8913

Browse files
committed
added docstrig to suppress warnings decorator
1 parent 8542970 commit b4e8913

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/allotropy/parsers/utils/warnings_tools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99

1010
def suppress_unused_keys_warning(func: Callable[..., Any]) -> Callable[..., Any]:
11+
"""
12+
Use when a class that warns for unread keys is created for a special one-off use that does not intend to read all keys, e.g.
13+
to read a single value and return.
14+
Not appropriate to use in the main use of the class where unread keys should be copied into custom data fields.
15+
"""
16+
1117
@functools.wraps(func)
1218
def _wrapper(*args: Any, **kwargs: Any) -> Any:
1319
previous_warn_unused_keys = os.environ.pop("WARN_UNUSED_KEYS", None)

0 commit comments

Comments
 (0)