Skip to content
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

Remove --fiximports helper #39274

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

tobiasdiez
Copy link
Contributor

It did its job; the remaining imports are okay (or would need manual work anyway). This is part of trying to eliminate most in misc.

📝 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.

⌛ Dependencies

It did its job; the remaining imports are okay (or would need manual work anyway). This is part of trying to eliminate most in `misc`.
Copy link

github-actions bot commented Jan 5, 2025

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

@orlitzky
Copy link
Contributor

looks like some of the CI failures are for real this time

@orlitzky
Copy link
Contributor

Unfortunately it looks like the simpler __module__ approach fails in some cases where import_statements would work, e.g.

sage: ZZ.__module__
'sage.categories.category'
sage: import_statements(ZZ)
# ** Warning **: several names for that object: Z, ZZ
from sage.rings.integer_ring import Z
sage: RDF.__module__
'sage.categories.category'
sage: import_statements(RDF)
from sage.rings.real_double import RDF

So maybe that is worth keeping? I don't know of an easier way to get the right import. I always forget about import_statements and do foo?? followed by grep and reading the source.

I don't know what runsnake is, but I guess it should be deprecated first, moreso in this case to find out if anyone is actually using it. It looks like a very thin wrapper around %prun -T file.txt <command> and then running runsnake file.txt in a terminal. (And could probably be replaced by some profiling documentation that says as much.) That would also address the fact that runsnake() uses a temporary file for your profiling data, and therefore deletes it as soon as sage exits.

(The replace_dot_all module is technically public, too, but I can't imagine anyone trying to use it in their own code.)

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