mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: workaround for non Obs valued objects in derived_observable now
also works outside of array mode.
This commit is contained in:
parent
525dea0209
commit
67ca53681a
1 changed files with 4 additions and 5 deletions
|
@ -1052,11 +1052,10 @@ def derived_observable(func, data, array_mode=False, **kwargs):
|
|||
raveled_data = data.ravel()
|
||||
|
||||
# Workaround for matrix operations containing non Obs data
|
||||
if array_mode is True:
|
||||
if not all(isinstance(x, Obs) for x in raveled_data):
|
||||
for i in range(len(raveled_data)):
|
||||
if isinstance(raveled_data[i], (int, float)):
|
||||
raveled_data[i] = cov_Obs(raveled_data[i], 0.0, "###dummy_covobs###")
|
||||
if not all(isinstance(x, Obs) for x in raveled_data):
|
||||
for i in range(len(raveled_data)):
|
||||
if isinstance(raveled_data[i], (int, float)):
|
||||
raveled_data[i] = cov_Obs(raveled_data[i], 0.0, "###dummy_covobs###")
|
||||
|
||||
allcov = {}
|
||||
for o in raveled_data:
|
||||
|
|
Loading…
Add table
Reference in a new issue