Open low-sky opened 10 years ago
We could definitely do this and it seems reasonable.
There are logger modules or we could write our own very simple one.
I guess as a first step, maybe we just start by having each routine optionally output a report.
It would be nice if the history generated a reproducible report, e.g. instead of Erik's proposal, something like:
>>> noise_object.history()
noise = NoiseCube(...) # Noise created from cube with shape (70,500,500).
mask = noise.signal_to_noise(3, iter=1) # Signal masked out with SNR threshold of 3 with 1 iterations
...obviously my example uses nonsense code, but the idea being to output code one could reuse rather than a pure description.
In terms of the infrastructure, for now it may be best to just pass this in the meta
property. It looks like noise doesn't have that yet, but spectral cube does. Then noise.meta['history'] = 'history line 1\nhistory line 2'
or something along those lines.
Since a lot of the minor methods are order dependent, should the methods in this packaged track a history of operations, perhaps as an extended string array so that you could get something like:
This seems more important for masking history.