Trace.copy: Using deepcopy causes derived Stats keys setting parent keys with computed values (leading to…
harbor run -t mimo-v2.6-rl/format-code-task-002087
harbor download mimo-v2.6-rl/format-code-task-002087
Fix the following issue:
Trace.copy: Using deepcopy causes derived Stats keys setting parent keys with computed values (leading to wrong values in edge cases) Hi everybody,
First, I hope all of you are happy and healthy.
Second, I've got a puzzling issue when working with highly-sampled data:
Working with sampling rates >= 100000. Hz produces unexpected behavior.
tr = Trace(data=np.ones(100000), header={'sampling_rate': 100000.}) print(tr.stats.sampling_rate) 100000.0 print(tr.copy().stats.sampling_rate) 99999.99999999999
I think this is a result of floating point "representation error", whenever the Trace AttribDict needs to be re-evaluated, specifically where delta is involved.
delta
Not sure how to go about addressing this though...