Skip to content

Make broken_circuit_complex return immutable SimplicialComplex#41642

Merged
vbraun merged 2 commits intosagemath:developfrom
c8ef:i41362
Feb 25, 2026
Merged

Make broken_circuit_complex return immutable SimplicialComplex#41642
vbraun merged 2 commits intosagemath:developfrom
c8ef:i41362

Conversation

@c8ef
Copy link
Copy Markdown
Contributor

@c8ef c8ef commented Feb 14, 2026

Closes #41362.

The returned SimplicialComplex was mutable, causing a ValueError when attempting to hash it (e.g., adding to a set). Fixed by passing is_immutable=True to the SimplicialComplex constructor.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

@c8ef
Copy link
Copy Markdown
Contributor Author

c8ef commented Feb 14, 2026

cc @gmou3

Mirror from: swe-productivity#7.

Since the swe project has ended, I will try to submit these patches upstream, starting with this one.

Copy link
Copy Markdown
Contributor

@gmou3 gmou3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's condense the tests a bit.

Comment thread src/sage/matroids/matroid.pyx Outdated
Comment thread src/sage/matroids/circuits_matroid.pyx Outdated
Co-authored-by: gmou3 <32706872+gmou3@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@gmou3 gmou3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 20, 2026
sagemathgh-41642: Make broken_circuit_complex return immutable SimplicialComplex
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Closes sagemath#41362.

The returned `SimplicialComplex` was mutable, causing a ValueError when
attempting to hash it (e.g., adding to a set). Fixed by passing
`is_immutable=True` to the `SimplicialComplex` constructor.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.


<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41642
Reported by: Connector Switch
Reviewer(s): Connector Switch, gmou3
@vbraun vbraun merged commit 1f993d5 into sagemath:develop Feb 25, 2026
4 checks passed
@c8ef c8ef deleted the i41362 branch February 26, 2026 00:30
@gmou3
Copy link
Copy Markdown
Contributor

gmou3 commented Feb 27, 2026

cc @gmou3

Mirror from: swe-productivity#7.

Since the swe project has ended, I will try to submit these patches upstream, starting with this one.

There is still this one pending: swe-productivity#9.

@c8ef
Copy link
Copy Markdown
Contributor Author

c8ef commented Feb 27, 2026

cc @gmou3
Mirror from: swe-productivity#7.
Since the swe project has ended, I will try to submit these patches upstream, starting with this one.

There is still this one pending: swe-productivity#9.

Here it is: #41721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

matroids: make broken_circuit_complex immutable

3 participants