Esempio n. 1
0
        strict_requires=False,
        global_parallel_rank=0,
        global_parallel_size=1,
        topcomm_parallel_rank=0,
        topcomm_parallel_size=1,
        command_line=False,
    ),
)


# For backward compatibility, do not use these vars internally in yt
CONFIG_DIR = config_dir()


_global_config_file = YTConfig.get_global_config_file()
_local_config_file = YTConfig.get_local_config_file()

# Load the config
ytcfg = YTConfig()
ytcfg.update(ytcfg_defaults, metadata={"source": "defaults"})

# Try loading the local config first, otherwise fall back to global config
if os.path.exists(_local_config_file):
    ytcfg.read(_local_config_file)
elif os.path.exists(_global_config_file):
    ytcfg.read(_global_config_file)


def _setup_postinit_configuration():
    """This is meant to be run last in yt.__init__"""
    for callback in configuration_callbacks:
Esempio n. 2
0
 def setUp(self):
     super().setUp()
     with open(YTConfig.get_local_config_file(), mode="w") as f:
         f.writelines("[yt]\n")
     with open(YTConfig.get_global_config_file(), mode="w") as f:
         f.writelines("[yt]\n")