Closed brookehus closed 4 years ago
Looks great - will take a look!
ok, so there are 2 ways that save_npys
and log
are supposed to work: you either:
(1) give them an integer 1 or greater, in which case they save that number of files/log that number of steps (or greater, in the case of non-even division), or
(2) give them a float between 0 and 1, in which case they save files/log at that % completion.
(2) is a little wonky right now. i've written some tests that pass but i'm not totally sure why. anyway, give this a look, and i'll hopefully be able to approach it with a clearer mind tomorrow!
the last four tests - i.e. the ones with _float
at the end - may be totally meaningless
Great work! I'll take another look!
There is a lot here - great work! I have a general question - what is the interplay between _npy_interval
and save_interval
and log_interval
(if any)? self.simulated_traj
and the other attribute observables are updated in _save_timepoint()
but they are only written to file by the function _save_numpy()
, which accesses self.simulated_traj
and the other attributes when (t+1) % _npy_interval == 0
. Will there ever be an issue from having class attribute observables updated by save_interval
but the file saved attributes updated by _npy_interval
? I may be overthinking this.
I think your point is good, and to save everyone including myself right now a lot of trouble, I think I will restrict the numpy interval to be only possible at saving interval points
@nec4 can you resolve solved conversations?
I need to look at the example notebooks and fix any verbose flags, and then we talked about getting the nan checker to return the iteration at which a nan showed up.
Anything else you want to see? Can you look over the latest code?
Update: fixed example notebooks in f51f82e
Ok @nec4, in addition to standard code review, can you:
Sounds good - will take a look now!
I think this looks more clean than before - great work! Aside from a small typo I can't think of anything else to add/change.
you can decide whether to merge or wait to play around!
LGTM!
Development:
[x] Add tests
Checks:
nosetests
SaveTheNumpys
This PR:
verbose
argument of the simulation classsave_npys
,log
,log_type
, andfilename
save_npys
andlog
default toNone
. Otherwise, they can be a number. If they are an integer, then that number of saves/logs are performed at regular intervals. If they are between 0 and 1, then saves/logs are performed at every % according to that argument.log_type
can be'print'
or'write'
. if print, it prints. if write, it writes to filefilename
specifies the base file name, to which_log.txt
will be appended for logs, and_0001.npy
(etc.) will be appended for numpys. Overwriting is not allowed.TODO:
verbose
@nec4 if you have comments on the overall strategy, please let me know! And feel free to look over the code for the logging part.