Skip to content

Commit

Permalink
sagemathgh-38751: sage.sets: Modularization fixes (imports)
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Cherry-picked from sagemath#35095 and sagemath#36380.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] 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 and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38751
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Oct 5, 2024
2 parents b6a9771 + d7f2ab1 commit afc2f14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/sage/sets/disjoint_set.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ from sage.rings.integer cimport Integer
from sage.structure.sage_object cimport SageObject
from cpython.object cimport PyObject_RichCompare
from sage.groups.perm_gps.partn_ref.data_structures cimport *
from sage.combinat.set_partition import SetPartition
from sage.misc.lazy_import import LazyImport

SetPartition = LazyImport('sage.combinat.set_partition', 'SetPartition')


cpdef DisjointSet(arg):
r"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/sets/image_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from sage.misc.cachefunc import cached_method
from sage.rings.infinity import Infinity
from sage.rings.integer import Integer
from sage.modules.free_module import FreeModule
from sage.structure.element import Expression
from sage.structure.parent import Parent

Expand Down Expand Up @@ -91,6 +90,7 @@ def __init__(self, map, domain_subset, *, category=None, is_injective=None, inve
if isinstance(map, Expression) and map.is_callable():
domain = map.parent().base()
if len(map.arguments()) != 1:
from sage.modules.free_module import FreeModule
domain = FreeModule(domain, len(map.arguments()))
function = map

Expand Down

0 comments on commit afc2f14

Please sign in to comment.