Skip to content

Conversation

soehms
Copy link
Member

@soehms soehms commented Oct 9, 2025

📝 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 and checked the documentation preview.

This PR fixes the bug identified at #40213 (comment). In detail:

  • The keyword is passed in recursive calls.
  • An additional check is added before the warning in recursive calls is raised to avoid unnecessary warnings.

This PR also fixes some optional doctests in src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py that were broken due to changes to polynomial formatting.

⌛ Dependencies

Copy link

github-actions bot commented Oct 9, 2025

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

@soehms soehms marked this pull request as ready for review October 9, 2025 16:25
@user202729
Copy link
Contributor

if it defaults to None but is set to True whenever it's None, isn't it simpler to default it to True as before?

@soehms
Copy link
Member Author

soehms commented Oct 11, 2025

if it defaults to None but is set to True whenever it's None, isn't it simpler to default it to True as before?

Yes, you're right! I changed that again (it must have been a relic from a previous attempt). Thanks for watching.

@user202729
Copy link
Contributor

not sure if the following can happen and what's the intended behavior. Let's say you have

def f(warning=True):
	g(warning=warning)
	h(warning=warning)

def g(warning=True):
	if some_condition:
		warn(...)
		warning=False

def h(warning=True):
	if some_condition:
		warn(...)
		warning=False

and both some_condition is True, then the warning=False set in g will not be propagated to h, raising two warnings.
(although having extra warnings doesn't really cause any harm, plus the warning message may be different anyway)

@soehms
Copy link
Member Author

soehms commented Oct 15, 2025

not sure if the following can happen and what's the intended behavior. Let's say you have

def f(warning=True):
	g(warning=warning)
	h(warning=warning)

def g(warning=True):
	if some_condition:
		warn(...)
		warning=False

def h(warning=True):
	if some_condition:
		warn(...)
		warning=False

and both some_condition is True, then the warning=False set in g will not be propagated to h, raising two warnings. (although having extra warnings doesn't really cause any harm, plus the warning message may be different anyway)

I understand your point, but I think it doesn't apply in our cases:

  1. Your f is the __init__ of SplittingAlgebra. Then g is its class call, and h = f (recursively). Since the latter is applied to a polynomial of degree one, the warning doesn't occur there.
  2. Your f is solve_with_extension, and g and h are both create_roots. Here, g and h are in different conditional branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants