Skip to content

Commit

Permalink
gh-35919: sage.matroids: Update # needs, modularization fixes for…
Browse files Browse the repository at this point in the history
… imports

    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->
- Many `# optional` are removed because small prime finite fields no
longer need to be marked `# optional/needs sage.rings.finite_rings`
since #35847
- Other `# optional` are replaced by codeblock-scoped `# needs` tags
- Remaining `# optional` with standard features are replaced by `#
needs`
- Some import fixes needed for separate testing of **sagemath-modules**
or **sagemath-graphs**[modules] from #35095
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
This is:
- done with the help of `sage -fixdoctests` from #35749
- Part of: #29705
- Cherry-picked from: #35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

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

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35919
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
  • Loading branch information
Release Manager committed Jul 19, 2023
2 parents b22ee1e + 007f6ae commit e0c51e5
Show file tree
Hide file tree
Showing 16 changed files with 1,516 additions and 1,468 deletions.
4 changes: 3 additions & 1 deletion src/sage/matroids/advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@
from . import lean_matrix
from .extension import LinearSubclasses, MatroidExtensions
from .union_matroid import MatroidUnion, MatroidSum, PartitionMatroid
from .graphic_matroid import GraphicMatroid

from sage.misc.lazy_import import lazy_import
lazy_import('sage.matroids.graphic_matroid', 'GraphicMatroid')
190 changes: 95 additions & 95 deletions src/sage/matroids/basis_exchange_matroid.pyx

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions src/sage/matroids/basis_matroid.pyx

Large diffs are not rendered by default.

258 changes: 129 additions & 129 deletions src/sage/matroids/catalog.py

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions src/sage/matroids/circuit_closures_matroid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ AUTHORS:
TESTS::
sage: from sage.matroids.advanced import *
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
sage: TestSuite(M).run() # optional - sage.rings.finite_rings
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: TestSuite(M).run()
Methods
=======
Expand Down Expand Up @@ -117,8 +117,8 @@ cdef class CircuitClosuresMatroid(Matroid):
EXAMPLES::
sage: from sage.matroids.advanced import *
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
sage: M # optional - sage.rings.finite_rings
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: M
Matroid of rank 3 on 7 elements with circuit-closures
{2: {{'a', 'b', 'f'}, {'a', 'c', 'e'}, {'a', 'd', 'g'},
{'b', 'c', 'd'}, {'b', 'e', 'g'}, {'c', 'f', 'g'},
Expand All @@ -127,7 +127,7 @@ cdef class CircuitClosuresMatroid(Matroid):
....: circuit_closures={3: ['edfg', 'acdg', 'bcfg', 'cefh',
....: 'afgh', 'abce', 'abdf', 'begh', 'bcdh', 'adeh'],
....: 4: ['abcdefgh']})
sage: M.equals(matroids.named_matroids.P8()) # optional - sage.rings.finite_rings
sage: M.equals(matroids.named_matroids.P8())
True
"""

Expand All @@ -140,8 +140,8 @@ cdef class CircuitClosuresMatroid(Matroid):
EXAMPLES::
sage: from sage.matroids.advanced import *
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
sage: M # optional - sage.rings.finite_rings
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: M
Matroid of rank 3 on 7 elements with circuit-closures
{2: {{'a', 'b', 'f'}, {'a', 'c', 'e'}, {'a', 'd', 'g'},
{'b', 'c', 'd'}, {'b', 'e', 'g'}, {'c', 'f', 'g'},
Expand All @@ -152,7 +152,7 @@ cdef class CircuitClosuresMatroid(Matroid):
....: circuit_closures={3: ['edfg', 'acdg', 'bcfg', 'cefh',
....: 'afgh', 'abce', 'abdf', 'begh', 'bcdh', 'adeh'],
....: 4: ['abcdefgh']})
sage: M.equals(matroids.named_matroids.P8()) # optional - sage.rings.finite_rings
sage: M.equals(matroids.named_matroids.P8())
True
"""
if M is not None:
Expand Down Expand Up @@ -348,17 +348,17 @@ cdef class CircuitClosuresMatroid(Matroid):
EXAMPLES::
sage: from sage.matroids.advanced import *
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
sage: CC = M.circuit_closures() # optional - sage.rings.finite_rings
sage: len(CC[2]) # optional - sage.rings.finite_rings
sage: M = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: CC = M.circuit_closures()
sage: len(CC[2])
7
sage: len(CC[3]) # optional - sage.rings.finite_rings
sage: len(CC[3])
1
sage: len(CC[1]) # optional - sage.rings.finite_rings
sage: len(CC[1])
Traceback (most recent call last):
...
KeyError: 1
sage: [sorted(X) for X in CC[3]] # optional - sage.rings.finite_rings
sage: [sorted(X) for X in CC[3]]
[['a', 'b', 'c', 'd', 'e', 'f', 'g']]
"""
return self._circuit_closures
Expand Down Expand Up @@ -387,16 +387,16 @@ cdef class CircuitClosuresMatroid(Matroid):
sage: from sage.matroids.advanced import *
sage: M1 = CircuitClosuresMatroid(matroids.Wheel(3))
sage: M2 = matroids.CompleteGraphic(4) # optional - sage.graphs
sage: M1._is_isomorphic(M2) # optional - sage.graphs
sage: M2 = matroids.CompleteGraphic(4) # needs sage.graphs
sage: M1._is_isomorphic(M2) # needs sage.graphs
True
sage: M1._is_isomorphic(M2, certificate=True) # optional - sage.graphs
sage: M1._is_isomorphic(M2, certificate=True) # needs sage.graphs
(True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4})
sage: M1 = CircuitClosuresMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
sage: M2 = matroids.named_matroids.NonFano() # optional - sage.rings.finite_rings
sage: M1._is_isomorphic(M2) # optional - sage.rings.finite_rings
sage: M1 = CircuitClosuresMatroid(matroids.named_matroids.Fano())
sage: M2 = matroids.named_matroids.NonFano()
sage: M1._is_isomorphic(M2)
False
sage: M1._is_isomorphic(M2, certificate=True) # optional - sage.rings.finite_rings
sage: M1._is_isomorphic(M2, certificate=True)
(False, None)
Expand Down
Loading

0 comments on commit e0c51e5

Please sign in to comment.