pynbody.util.SettingControl#
- class pynbody.util.SettingControl(dictionary, key, value)[source]#
Bases:
objectClass to control a setting using a with statement.
This is used by
pynbody.analysis.luminosityandpynbody.analysis.ionfracto control the table used by calculations.Given a dictionary, the key to modify, and the value to set the key to, this class will set the key to the value on creation or when entering the with block, and reset it to the original value when exiting the block.