Skip to content
Snippets Groups Projects
Commit 08dba668 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

black/changelock

parent 4eb2ca53
No related branches found
No related tags found
1 merge request!824target broadcasting and numpy array support for generics
Pipeline #204287 passed with stages
in 5 minutes and 52 seconds
...@@ -9,7 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later ...@@ -9,7 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
[List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.5.0...develop) [List of commits](https://git.ufz.de/rdm-software/saqc/-/compare/v2.5.0...develop)
### Added ### Added
- `generics`: target broadcasting and numpy array support - `generics`: target broadcasting and numpy array support
- `flagGeneric`: target broadcasting
- `SaQC`: automatic translation of incoming flags - `SaQC`: automatic translation of incoming flags
- Option to change the flagging scheme after initialization - Option to change the flagging scheme after initialization
- `flagByClick`: manually assign flags using a graphical user interface - `flagByClick`: manually assign flags using a graphical user interface
......
...@@ -83,15 +83,17 @@ def _inferBroadcast(obj, trg_shape) -> pd.DataFrame: ...@@ -83,15 +83,17 @@ def _inferBroadcast(obj, trg_shape) -> pd.DataFrame:
return np.full(trg_shape, obj) return np.full(trg_shape, obj)
return obj return obj
def _inferDF(obj, cols, index): def _inferDF(obj, cols, index):
# infer dataframe if result is numpy array of fitting shape # infer dataframe if result is numpy array of fitting shape
if isinstance(obj, np.ndarray): if isinstance(obj, np.ndarray):
lc = len(cols) lc = len(cols)
li = len(index) li = len(index)
if (obj.shape == (li,lc)) or (obj.shape == (li,)): if (obj.shape == (li, lc)) or (obj.shape == (li,)):
return pd.DataFrame(obj, columns=cols, index=index) return pd.DataFrame(obj, columns=cols, index=index)
return obj return obj
def _castResult(obj) -> DictOfSeries: def _castResult(obj) -> DictOfSeries:
# Note: the actual keys aka. column names # Note: the actual keys aka. column names
# we use here to create a DictOfSeries # we use here to create a DictOfSeries
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment