Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to ncsym.ncsym.nesting #37218

Merged
merged 2 commits into from
Feb 13, 2024
Merged

Fix to ncsym.ncsym.nesting #37218

merged 2 commits into from
Feb 13, 2024

Conversation

lucasgagnon
Copy link
Contributor

The nesting function in combinat.ncsym.ncsym.py does not operate as described in its documentation. As intended, it should compare all arcs of two set partitions and count the number of times the second arc nests in the first. As written, there was a break statement caused many (necessary) comparisons to be skipped, particularly for set partitions with large blocks.

I have re-written the function so that all necessary comparisons are made. I have also added an example in the docstring that was computed incorrectly by the old code, but is corrected by my fix.

This bug is not a previously known issue, and I have also confirmed with the original author (@tscrim ) that no one else is currently working on a fix.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.

⌛ Dependencies

No dependencies

Fix to ncsym.ncsym.nesting function.
@lucasgagnon
Copy link
Contributor Author

@tscrim can you review this?

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

Thank you. LGTM.

Copy link

github-actions bot commented Feb 4, 2024

Documentation preview for this PR (built with commit 4e0bcf9; changes) is ready! 🎉

vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 7, 2024
    
The nesting function in combinat.ncsym.ncsym.py does not operate as
described in its documentation.  As intended, it should compare all arcs
of two set partitions and count the number of times the second arc nests
in the first.  As written, there was a break statement caused many
(necessary) comparisons to be skipped, particularly for set partitions
with large blocks.

I have re-written the function so that all necessary comparisons are
made.  I have also added an example in the docstring that was computed
incorrectly by the old code, but is corrected by my fix.

This bug is not a previously known issue, and I have also confirmed with
the original author (@tscrim ) that no one else is currently working on
a fix.

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.

### ⌛ Dependencies

No dependencies
    
URL: sagemath#37218
Reported by: lucasgagnon
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit 81a23e1 into sagemath:develop Feb 13, 2024
18 of 21 checks passed
@mkoeppe mkoeppe added this to the sage-10.3 milestone Mar 7, 2024
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.

None yet

4 participants