Ticket #10764 (closed task: fixed)
Cleanup a few Cython warnings
| Reported by: | robertwb | Owned by: | GeorgSWeber |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.2 |
| Component: | build | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | François Bissey, André Apitzsch |
| Authors: | François Bissey, André Apitzsch | Merged in: | sage-5.2.beta0 |
| Dependencies: | Stopgaps: |
Attachments
Change History
comment:2 Changed 2 years ago by fbissey
I hadn't mentioned these in #10493 I assume we want to fix them as well:
warning: sage/gsl/fft.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/gsl/gsl_array.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/modular/modsym/p1list.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/modules/free_module_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/modules/free_module_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/laurent_series_ring_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polydict.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_gf2x.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_zmod_flint.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_element.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_integer_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_zz_pex.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_integer_dense_flint.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/structure/parent.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead warning: sage/rings/polynomial/polynomial_rational_flint.pyx:1:0: __getslice__, __setslice__, and __delslice__ are not supported by Python 3, use __getitem__, __setitem__, and __delitem__ instead
comment:3 Changed 2 years ago by fbissey
I am looking at gsl/fft.pyx and some of the code is strange
def __getitem__(self, size_t i):
if i < 0 or i >= self.n:
raise IndexError
cdef int j
j = 2*i
return self.data[2*i], self.data[2*i+1]
def __getslice__(self, Py_ssize_t i, Py_ssize_t j):
# Todo -- make this actually fast.
return list(self)[i:j]
There is already a getitem, I don't think it would work with slices. But getitem and getslice look very different. One asks for size_t while the other asks for Py_ssize_t I assume one is deprecated. The code in getitem is very strange. j is declared, computed and never used, the code also return something different from you would naively expect. None of this seem to ever be called from anywhere else in sage.
comment:4 Changed 2 years ago by fbissey
The warning in sage/combinat/combinat_cython.pyx has been fixed as a side effect of #10258. Updated patch coming shortly.
Changed 2 years ago by fbissey
-
attachment
trac_10764-fix_deprecation_warning.patch
added
Fix deprecation warnings (updated after #10258)
Changed 2 years ago by fbissey
-
attachment
trac_10764-fix-gen_interpreters_doctest.patch
added
previous patch broke a doctest in gen_interpreters.py.
comment:5 follow-up: ↓ 6 Changed 18 months ago by aapitzsch
The patch attached to #12041 should fix some warnings.
comment:7 Changed 14 months ago by aapitzsch
- Status changed from new to needs_review
The other deprecation warnings are fixed, so this ticket can be reviewed.
comment:8 Changed 14 months ago by aapitzsch
- Status changed from needs_review to needs_work
- Work issues set to Rebase
Please rebase to current beta.
comment:9 Changed 11 months ago by aapitzsch
- Status changed from needs_work to needs_review
- Description modified (diff)
- Work issues Rebase deleted
comment:10 Changed 11 months ago by aapitzsch
patchbot: apply trac_10764.patch
comment:11 follow-up: ↓ 12 Changed 11 months ago by fbissey
sorry to have been out of touch. I assume your patch is a rebase of my 2 patches, correct?
comment:12 in reply to: ↑ 11 Changed 11 months ago by aapitzsch
Replying to fbissey:
sorry to have been out of touch. I assume your patch is a rebase of my 2 patches, correct?
Yes. Additionally I removed some trailing white spaces.
comment:13 Changed 11 months ago by fbissey
- Status changed from needs_review to positive_review
- Reviewers set to François Bissey, André Apitzsch
- Milestone changed from sage-5.1 to sage-5.2
- Authors set to François Bissey, André Apitzsch
I am putting this to positive review. I guess we agree on what needs doing and that it doesn't have side effects.
comment:14 Changed 11 months ago by jdemeyer
- Summary changed from Cleanup cython warnings to Cleanup a few Cython warnings
comment:15 Changed 11 months ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-5.2.beta0

I am starting the work by fixing the deprecation warnings. One of the easy bits :)