-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add Oriented Matroids Package #38024
base: develop
Are you sure you want to change the base?
Conversation
The |
Documentation preview for this PR (built with commit 2b46653; 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
""" | ||
if hasattr(self, "_circuits"): | ||
return self._circuits | ||
raise NotImplementedError("Circuits not implemented") |
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 would recommend all Error
messages to start uncapitalized and end without a dot.
\mathcal{C} / A = \left\{ X\mid_{E \backslash A} : X \in \mathcal{C} \text{ and} A \subseteq X^0 \right\} | ||
|
||
""" | ||
# sage: from sage.matroids.oriented_matroids.oriented_matroid import OrientedMatroid |
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.
Do something with this commented code?
AUTHORS: | ||
- Aram Dermenjian (): initial version |
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.
Need to add date or complete/delete file.
@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. |
Yeah, I think it would be nice to know why something fails when testing out different OMs, I like your solution. I'm sure you will already but if Alternatively: it makes sense that If you want I can go ahead and accept the PR you made and also make the changes I suggested? (The one with both a |
Good that you point out this complication. I thought a bit about it and suggest that I also prefer the name Go ahead and do the changes you want. Either this last suggestion of mine, or the |
If matroids is doing something, might as well go with that option. So then |
I’ve not followed the discussion, but one quick point is that the return for |
Integrate `FlatsMatroid` and redelete catalog files
I think I might have screwed up the pull request. There was a merge with develop and so I couldn't actually tell what you had changed, so I tried to merge mine with develop, but the two branches were different and so I couldn't figure out what was changed and what wasn't. Can you double check that I didn't screw it up? ** Edit: ** Actually, reading your full message, I'm confident I screwed it up since you mentioned that you removed the |
Ok, I fixed my error with your pull request (For future, probably better not to merge I've also gone ahead and implemented something for |
It is quite good now I believe. I would change the argument's name from Another point I want to raise is the following: I am planning to also implement this for ordinary matroids and I want
Notice that the certificate is a tuple which always starts with a string and (potentially) continues with other useful info. Is this a good format? If so, should we make the case of an only string certificate also be a tuple for consistency? That is what seems best to me. |
Sounds good, I've changed it to I think with certificate, I would probably do something like: At the end of the day though, I think it's just preferences and there is no "correct" solution. So if you'd prefer the second part be a tuple instead, can defs do that. |
Two more cents: it should return |
That's a good point. I'm also ok with making it |
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 made it only partially through this. My comments in circuit_oriented_matroid.py
also apply to the other concrete subclasses.
One bigger design change I would like is to combine the OrientedMatroid
function with the class AbstractOrientedMatroid
. This makes the user interface easier (e.g., isinstance(M, OrientedMatroid)
works as expected), there is one single point of documentation for general information, and the __classcall_private__
mechanism allows for dispatch to subclasses (see, e.g., Partitions
).
I will probably have more comments later when I get some more time to go through the rest.
src/sage/matroids/oriented_matroids/circuit_oriented_matroid.py
Outdated
Show resolved
Hide resolved
src/sage/matroids/oriented_matroids/circuit_oriented_matroid.py
Outdated
Show resolved
Hide resolved
def __init__(self, data, groundset=None, category=None): | ||
""" | ||
Initialize ``self``. | ||
""" | ||
AbstractOrientedMatroid.__init__(self, category=category) |
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, usually a TestSuite(M).run()
with M
being this class and constructed how a user would.
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.
Does it make sense to do a TestSuite
for each type or should I just do one on the parent class (the one that was called Abstract
that will now just become the class?
src/sage/matroids/oriented_matroids/covector_oriented_matroid.py
Outdated
Show resolved
Hide resolved
src/sage/matroids/oriented_matroids/covector_oriented_matroid.py
Outdated
Show resolved
Hide resolved
The reason this was not done was so that it aligns with the Matroid class. The Matroid class uses a constructor If we want to merge the two, then I believe we should do a similar thing with the |
I view aligning with the Additionally, |
I think the way it was done is not necessarily a fallacy. The main problem I see with your proposed method is that when we call Do we have an example of an object that does this successfully? |
It should be dispatching to the correct parent class in the |
Ok, I've gone ahead and altered the code to use a class instead of a constructor. We'll make a different PR for doing the same to Matroids (Which I believe should be done as well) |
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