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

cython-lint : add note about unused imports #36053

Merged
merged 2 commits into from
Aug 27, 2023

Conversation

fchapoton
Copy link
Contributor

removing some unused imports, following suggestions of cython-lint

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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 accordingly.

⌛ Dependencies

@fchapoton fchapoton force-pushed the cylint-less-unused-imports branch from dd9a31b to f5c81ff Compare August 9, 2023 07:22
@fchapoton fchapoton changed the title cython-lint : remove some unused and deprecated imports cython-lint : remove some unused imports Aug 9, 2023
@fchapoton
Copy link
Contributor Author

this seems to trigger an import failure. I have no idea why and how

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 10, 2023

These are not unused imports. The functions in this module are called by mpmath.

@fchapoton fchapoton force-pushed the cylint-less-unused-imports branch from f5c81ff to 1b03ee5 Compare August 10, 2023 06:02
@fchapoton
Copy link
Contributor Author

thanks. This seems to be a rather dubious situation. One should change the place using these things inside mpmath, so that it imports from the correct place, maybe ?

@fchapoton fchapoton changed the title cython-lint : remove some unused imports cython-lint : add note about unused imports Aug 10, 2023
@@ -4,6 +4,7 @@ Faster versions of some key functions in mpmath.libmp
from .ext_impl cimport *
from sage.libs.gmp.all cimport *

# the next line is used by mpmath
from .ext_impl import exp_fixed, cos_sin_fixed, log_int_fixed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some use the idiom from .ext_impl import exp_fixed as exp_fixed, cos_sin_fixed as cos_sin_fixed, log_int_fixed as log_int_fixed to explain that the purpose of the import is to fill the namespace

I don't know if this would suppress the cylint warning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think changing the import would be useful. Let just add a note to remember where this is used.

@github-actions
Copy link

Documentation preview for this PR (built with commit 193e644; changes) is ready! 🎉

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 23, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

removing some unused imports, following suggestions of cython-lint

<!-- 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 sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] 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 accordingly.

### ⌛ Dependencies

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

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36053
Reported by: Frédéric Chapoton
Reviewer(s): Frédéric Chapoton, Matthias Köppe
@vbraun vbraun merged commit e678d52 into sagemath:develop Aug 27, 2023
@mkoeppe mkoeppe added this to the sage-10.2 milestone Aug 27, 2023
@fchapoton fchapoton deleted the cylint-less-unused-imports branch August 28, 2023 06:13
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.

3 participants