pynbody.util.SettingControl#
- class pynbody.util.SettingControl(dictionary, key, value)[source]#
Bases:
object
Class to control a setting using a with statement.
This is used by
pynbody.analysis.luminosity
andpynbody.analysis.ionfrac
to 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.