We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e00d106 commit fcadf3fCopy full SHA for fcadf3f
2 files changed
src/dspeed/processing_chain.py
@@ -797,10 +797,7 @@ def _parse_expr(
797
npparr = np.array(
798
ast.literal_eval(expr[node.col_offset : node.end_col_offset])
799
)
800
- if len(npparr.shape) == 1:
801
- return npparr
802
- else:
803
- raise ProcessingChainError("only 1D arrays are supported: " + expr)
+ return npparr
804
805
elif isinstance(node, ast.Constant):
806
return node.value
tests/test_processing_chain.py
@@ -119,17 +119,19 @@ def test_numpy_math_constants_dsp(lgnd_test_data):
119
120
def test_list_parsing(lgnd_test_data, tmptestdir):
121
dsp_config = {
122
- "outputs": ["wf_out", "ievt"],
+ "outputs": ["a1", "a2", "wf_out", "ievt"],
123
"processors": {
124
"a1": "[1,2,3,4,5]",
125
- "a2": "[6,7,8,9,10]",
126
- "wf_out": "a1+a2",
+ "a2": "[[1, 2], [3, 4]]",
+ "wf_out": "a1+[6,7,8,9,10]",
127
},
128
}
129
130
raw_in = lgnd_test_data.get_path("lh5/LDQTA_r117_20200110T105115Z_cal_geds_raw.lh5")
131
dsp_out = build_dsp(raw_in=raw_in, dsp_config=dsp_config, n_entries=1)
132
- assert np.all(dsp_out["geds"]["dsp"]["wf_out"].nda == np.array([7, 9, 11, 13, 15]))
+ assert np.all(dsp_out.geds.dsp.a1.nda == np.array([1, 2, 3, 4, 5]))
133
+ assert np.all(dsp_out.geds.dsp.a2.nda == np.array([[1, 2], [3, 4]]))
134
+ assert np.all(dsp_out.geds.dsp.wf_out.nda == np.array([7, 9, 11, 13, 15]))
135
136
137
def test_comparators():
0 commit comments