-
-
Notifications
You must be signed in to change notification settings - Fork 631
Add Oriented Matroids Package #38024
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
base: develop
Are you sure you want to change the base?
Conversation
The |
Documentation preview for this PR (built with commit 0fa039f; changes) is ready! 🎉 |
Don't worry about that, it is some error of the tester. |
SageMath version 10.4.beta7, Release Date: 2024-05-25
src/sage/matroids/oriented_matroids/abstract_oriented_matroid.py
Outdated
Show resolved
Hide resolved
src/sage/matroids/oriented_matroids/abstract_oriented_matroid.py
Outdated
Show resolved
Hide resolved
@gmou3 I've gone ahead and fixed the things you wanted. |
Thanks. I had opened a PR a while ago with some formatting recommendations. Please have a look and merge or close it please. |
Some formatting recommendations
I hadn't noticed the pull request for some reason. I've added your changes as well and double checked things work nicely. Thanks for that. |
Ok, I think I fixed all the linting/pyright stuff. I also changed the parent/element situation. Only thing I didn't do was the settings file. Still trying to see what the best way of handling that is. |
For the settings file, I just went ahead and removed the extra settings that I have normally. It feels very weird that the settings file is there, but anyway, I just undid my settings changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I think this is better (which can be verified by the fact it passes the TestSuite
, right?).
I have a few other changes to improve the efficiency and some details. Hopefully this will be the last round. Let me know if you have any questions. The changes I'm suggesting might need to be done in other files/places than what I mentioned.
src/sage/matroids/oriented_matroids/real_hyperplane_arrangement_oriented_matroid.py
Show resolved
Hide resolved
Co-authored-by: Travis Scrimshaw <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be good if you could add tests for most of the error messages that the codecov is reporting aren't tested. This is good for completeness.
True | ||
""" | ||
if isinstance(other, type(self)): | ||
return self.elements() == other.elements() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you end up with two oriented matroids that have equal elements but unequal groundsets? I am asking because of the hashing uses both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can have two oriented matroids with equal elements but unequal groundsets. They are (combinatorially) isomorphic, hence why I didn't include them in the equality test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, what's the best way to handle this? Should I make it to be "strictly equal" (aka groundsets must be the same)? Because then it might be confusing since in some sense I'm having it mean "isomorphic" but in another sense, I'm not testing for isomorphism.
return self._circuits | ||
raise NotImplementedError("circuits not implemented") | ||
|
||
def cocircuits(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a doctest.
return False | ||
return True | ||
|
||
def is_dual_with(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a doctest.
ground_set = [str(self(e)) for e in self.groundset()] | ||
return "\\left(" + ','.join(ground_set) + "\\right)" | ||
|
||
def __copy__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, that is what I am suggesting.
Ok, I went ahead and added a few more tests to try and get Codecov higher. I think all of the ones that are left are |
Looks like one doctest is failing according to the checks. I'll double check this once I can get my local version of sage working again after upgrading ._. For my own ease, here's the log message:
|
This pull request merges the Oriented Matroids package that I developed (see https://github.com/thecaligarmo/oriented_matroids) into Sage so that others may develop directly into it rather than relying solely on myself.
This package should resolve ticket #18703 and in addition, my package should be removed from #31164 as this pull request will put Oriented Matroids directly into Sage rather than requiring a package.
If there are any changes needing to be made, just let me know and we can go from there.
📝 Checklist
⌛ Dependencies