016ReviewmidPython / Astropy真实来源改编 Astropy

Astropy:修复嵌套 CompoundModel 的 separability 矩阵

审查一个 Astropy modeling PR:作者调整了组合模型右侧 block 的填充方式,并补了一个嵌套模型测试。

ai-pr.diffdiff · 11 lines
diff --git a/astropy/modeling/separable.py b/astropy/modeling/separable.py@@-        cright[-right.shape[0]:, -right.shape[1]:] = right+        # Mark every output of the nested right model as depending on its inputs.+        cright[-right.shape[0]:, -right.shape[1]:] = 1@@+def test_nested_model_shape():+    cm = m.Pix2Sky_TAN() & (m.Linear1D(10) & m.Linear1D(5))+    matrix = separability_matrix(cm)+    assert matrix.shape == (4, 4)