pydicom.config.INVALID_KEYWORD_BEHAVIOR

pydicom.config.INVALID_KEYWORD_BEHAVIOR = 'WARN'

Control the behavior when setting a Dataset attribute that’s not a known element keyword.

Added in version 2.1.

If "WARN" (default), then warn when an element value is set using Dataset.__setattr__() and the keyword is camel case but doesn’t match a known DICOM element keyword. If "RAISE" then raise a ValueError exception. If "IGNORE" then neither warn nor raise.

Examples

>>> from pydicom import config
>>> config.INVALID_KEYWORD_BEHAVIOR = "WARN"
>>> ds = Dataset()
>>> ds.PatientName = "Citizen^Jan"  # OK
>>> ds.PatientsName = "Citizen^Jan"
../pydicom/dataset.py:1895: UserWarning: Camel case attribute 'PatientsName'
used which is not in the element keyword data dictionary