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

fix: issue with write=False not stopping I/O #283

Closed steven-murray closed 2 years ago

steven-murray commented 2 years ago

Fixes #277

This should fix the behaviour mentioned in the above issue where data was being written even with write=False. The problem was that in every sub-function (eg. initial_conditions()), the hooks keyword was passed through, but not the write keyword. While the hooks initially get built as a dict with the correct behaviour (i.e. no "write" entry), on the second time the hooks is constructed, with write=None, it was assuming that function was being called directly and automatically inserting the write hook in, then passing that on.

codecov[bot] commented 2 years ago

Codecov Report

Merging #283 (633d36c) into master (370cf9c) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #283   +/-   ##
=======================================
  Coverage   86.31%   86.31%           
=======================================
  Files          12       12           
  Lines        2776     2777    +1     
=======================================
+ Hits         2396     2397    +1     
  Misses        380      380           
Impacted Files Coverage Δ
src/py21cmfast/wrapper.py 89.00% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b9f396e...633d36c. Read the comment docs.