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

Remove CombinatorialClass #37722

Merged

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Apr 2, 2024

📝 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 accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Apr 2, 2024
@mkoeppe mkoeppe force-pushed the InfiniteAbstractCombinatorialClass_remove branch 2 times, most recently from d4427d1 to a02f25b Compare April 3, 2024 03:35
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 4, 2024

Ready for review.

The failure in "Test modularized distributions" is unrelated; it is tracked in #37734.

@@ -1361,7 +1361,7 @@ def __init__(self, modules, **options):
"""
self._sets = modules
indices = CartesianProduct_iters(*[module.basis().keys()
for module in modules]).map(tuple)
for module in modules]).map(tuple, is_injective=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this change? is_injective is the default, and also what I'd assume that map does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just for clarity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also what I'd assume that map does.

That's one of the trickier parts in the enumerated sets code. See e.g. #34389

@@ -1229,7 +1231,7 @@ def negative_roots(self):
"""
if not self.cartan_type().is_finite():
raise ValueError("%s is not a finite Cartan type" % self.cartan_type())
return self.positive_roots().map(attrcall('__neg__'))
return self.positive_roots().map(attrcall('__neg__'), is_injective=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this change? is_injective is the default, and also what I'd assume that map does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just annotation for clarity as I made my way through the code to fix a failure.

@mantepse
Copy link
Collaborator

mantepse commented Apr 4, 2024

I think that's great!

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.

I don't think the ImageSubobject should take the category into account for equality and hashing. It doesn't change what the actual set is. Same for _is_injective. Everything is contained within the self._map, self._inverse, and self._domain_subset.

Other than that, LGTM. We have to pull the trigger at some point on removing CombinatorialClass.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 4, 2024

I don't think the ImageSubobject should take the category into account for equality and hashing. It doesn't change what the actual set is. Same for _is_injective. Everything is contained within the self._map, self._inverse, and self._domain_subset.

Also self._inverse does not change what the actual set is...

Copy link

github-actions bot commented Apr 4, 2024

Documentation preview for this PR (built with commit 094c106; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

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. @mantepse Feel free to revert if you disagree.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 8, 2024

Thanks!

@vbraun
Copy link
Member

vbraun commented Apr 9, 2024

merge conflict

@mantepse
Copy link
Collaborator

I'm not sure what happened here, I thought it was a simple merge conflict. Have I overlooked any changes?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 13, 2024

I set it to "needs review" only to wait for the CI to complete after resolving the merge conflict.
It's all good.

@mantepse
Copy link
Collaborator

Hi Matthias! I suppose that you only merged develop, right?

I find it a bit hard ti review if after a merge conflict the whole branch is replaced. I would prefer to see only the difference to the last version.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 28, 2024

I suppose that you only merged develop, right?

No, I rebased a previous version that was based on 10.4.beta2 (2141959) onto 10.4.beta4.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 28, 2024

I find it a bit hard ti review if after a merge conflict the whole branch is replaced. I would prefer to see only the difference to the last version.

That's understandable, but ease for the reviewer is only one of several criteria when deciding how to update a branch. Cleanliness of the branch is another one.

I can teach you how to use git more effectively in such situations if you are interested.

@mantepse
Copy link
Collaborator

I was on my smartphone, so, no git there.

But yes, I'd still be interested to know how to get the "interesting part" of the diff between the branch that was replaced with the current branch.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 30, 2024

@mantepse A technique that I find useful in such situations is to take the old, reviewed version (here: git fetch upstream 1cdc9cfb1e70a94abf149582c13d588aeaf1b43e && git checkout FETCH_HEAD) and then merge the new release, asking for any merge conflicts to be resolved automatically instead of interactively (using -Xtheirs or -Xours): git merge -Xtheirs upstream/develop. Then the diff with the new version can be inspected.

@vbraun vbraun merged commit 46b7ec2 into sagemath:develop May 2, 2024
18 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 2, 2024
@mkoeppe mkoeppe deleted the InfiniteAbstractCombinatorialClass_remove branch May 4, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment