Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

🔖 Checkpoint: Edit /workspaces/claude-code-flow/test_issue.py

rUv79eb35513a5f
diff --git a/.claude/checkpoints/1754577071.json b/.claude/checkpoints/1754577071.json
new file mode 100644
index 0000000000..1e880814d8
--- /dev/null
+++ b/.claude/checkpoints/1754577071.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250807-143111", "file": "/workspaces/claude-code-flow/correct_reproduce_bug.py", "timestamp": "2025-08-07T14:31:11Z", "type": "pre-edit", "original_branch": "swe-bench"}
diff --git a/.claude/checkpoints/1754577073.json b/.claude/checkpoints/1754577073.json
new file mode 100644
index 0000000000..166bfaf70f
--- /dev/null
+++ b/.claude/checkpoints/1754577073.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250807-143112", "file": "/workspaces/claude-code-flow/correct_reproduce_bug.py", "timestamp": "2025-08-07T14:31:13Z", "type": "post-edit", "branch": "swe-bench", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 48 ++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 ++-- .claude/checkpoints/1754577055.json | 1 + .claude/checkpoints/1754577057.json | 1 + correct_reproduce_bug.py | 51 ++++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 4 deletions(-) "}
diff --git a/test_issue.py b/test_issue.py
new file mode 100644
index 0000000000..0fb448b0c9
--- /dev/null
+++ b/test_issue.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+"""
+Test the actual issue case from astropy #12907
+The issue states that separability_matrix does not compute separability correctly
+for nested CompoundModels with Mapping
+"""
+from astropy.modeling import models as m
+from astropy.modeling.separable import separability_matrix
+
+# Based on the issue description, test with Mapping
+# The issue shows a case like: Mapping([0, 1, 0, 1]) | (Linear1D & Linear1D)
+
+# Create a mapping that duplicates inputs
+mapping = m.Mapping([0, 1, 0, 1])
+print(f"Mapping: {mapping.mapping}")
+print(f"Mapping n_inputs: {mapping.n_inputs}, n_outputs: {mapping.n_outputs}")
+print()
+
+# Create a compound model
+linear_compound = m.Linear1D(10) & m.Linear1D(5)
+print(f"Linear compound n_inputs: {linear_compound.n_inputs}, n_outputs: {linear_compound.n_outputs}")
+print()
+
+# Chain them - but this fails due to dimension mismatch
+# The mapping outputs 4 values but the compound expects 2 inputs
+# So we need a different mapping
+mapping2 = m.Mapping([0, 1]) # Identity mapping
+nested = mapping2 | linear_compound
+print(f"Nested model: {nested}")
+sep = separability_matrix(nested)
+print(f"Separability matrix: {sep}")
+print()
+
+# Try with a model that accepts 4 inputs
+model_4input = (m.Linear1D(1) & m.Linear1D(2)) & (m.Linear1D(3) & m.Linear1D(4))
+print(f"4-input model n_inputs: {model_4input.n_inputs}, n_outputs: {model_4input.n_outputs}")
+
+# Now we can chain with the 4-output mapping
+try:
+ nested2 = mapping | model_4input
+ print(f"Nested with mapping: {nested2}")
+ sep2 = separability_matrix(nested2)
+ print(f"Separability matrix of nested: {sep2}")
+ print(f"Expected: should show correct separability based on mapping")
+except Exception as e:
+ print(f"Error: {e}")
\ No newline at end of file