21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
58 stars 37 forks source link

[BUG] unexpected behaviour for `write=False` #277

Closed dprelogo closed 2 years ago

dprelogo commented 2 years ago

Describe the bug: When calling p21.run_lightcone with write = False, it still caches all the files. The same probably holds for all underlying functions.

Expected behavior: Even with the new flexibility of the write flag, I assume making it False should turn off all caching/writing.

steven-murray commented 2 years ago

Huh, that is surprising. I'll have a look into it.

qyx268 commented 2 years ago

I had this issue before. @dprelogo can you confirm if you have cache_dir set to some value? If so, _get_config_options in py21cmfast will reset write=True.

@steven-murray perhaps this was done on purpose?

qyx268 commented 2 years ago

okay, even with cache_dir=None, the program still outputs files into the default cache folder...

steven-murray commented 2 years ago

OK something definitely seems wrong here. Unfortunately I don't have time to look at it right now. Maybe by the end of the week. Certainly when setting write=False you should expect that nothing is written out at all. But this now goes through the hooks so it is a little more complex than just simply "not writing".

charlottenosam commented 2 years ago

FYI @dprelogo I've been having the same problem. The only thing that seems to work for me is also setting the config variable p21c.config['write'] = False