LinkedEarth / Pyleoclim_util

Python Package for the Analysis of Paleoclimate Data. Documentation at
https://pyleoclim-util.readthedocs.io
GNU General Public License v3.0
88 stars 33 forks source link

Significance in place #499

Closed CommonClimate closed 10 months ago

CommonClimate commented 10 months ago

Is your feature request related to a problem? Please describe. Many of our classes (PSD, Coherence, Correlation) have a signif_test() method. However, when we use them, the output is added to a new object. Example from our docs:

import pyleoclim as pyleo
soi = pyleo.utils.load_dataset('SOI')
psd = soi.standardize().spectral('mtm',settings={'NW':2})
psd_sim = psd.signif_test(number=20)
fig, ax = psd_sim.plot()

Describe the solution you'd like To avoid multiplying objects (and needlessly redoing computations when you forget to name the output object), I suggest adding an inplace argument (cf pandas) that would simply add the result to the existing object.

Describe alternatives you've considered Leave things as is.

Potential Issues How to name the additional field ; potential to overwrite existing ones.

CommonClimate commented 10 months ago

Downvoted