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

Fix index out of range exception (#35031) #35156

Merged
merged 3 commits into from
Mar 26, 2023
Merged

Fix index out of range exception (#35031) #35156

merged 3 commits into from
Mar 26, 2023

Conversation

sheerluck
Copy link
Contributor

📚 Description

We return False if there is no n-th path

Closes #35031

📝 Checklist

  • I have made sure that the title is self-explanatory and the description concisely explains the PR.
  • I have linked an issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2023

Codecov Report

Base: 88.57% // Head: 88.59% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (d9f9a36) compared to base (52a81cb).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #35156      +/-   ##
===========================================
+ Coverage    88.57%   88.59%   +0.01%     
===========================================
  Files         2140     2140              
  Lines       397273   397276       +3     
===========================================
+ Hits        351891   351963      +72     
+ Misses       45382    45313      -69     
Impacted Files Coverage Δ
src/sage/plot/arrow.py 94.33% <100.00%> (+0.10%) ⬆️
src/sage/modular/local_comp/liftings.py 98.33% <0.00%> (-1.67%) ⬇️
src/sage/cpython/_py2_random.py 75.20% <0.00%> (-1.24%) ⬇️
src/sage/graphs/generators/random.py 91.43% <0.00%> (-1.03%) ⬇️
src/sage/groups/generic.py 88.34% <0.00%> (-0.68%) ⬇️
...sage/geometry/hyperbolic_space/hyperbolic_model.py 88.95% <0.00%> (-0.62%) ⬇️
src/sage/categories/weyl_groups.py 96.47% <0.00%> (-0.59%) ⬇️
src/sage/doctest/reporting.py 74.45% <0.00%> (-0.44%) ⬇️
src/sage/modular/overconvergent/hecke_series.py 98.76% <0.00%> (-0.31%) ⬇️
src/sage/combinat/posets/lattices.py 92.26% <0.00%> (-0.10%) ⬇️
... and 20 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@videlec
Copy link
Contributor

videlec commented Feb 26, 2023

Thanks for the bug fix. You must add a doctest that shows that the error is indeed corrected. Ideally this would go inside a TESTS block such as this example taken from complex_mpfr.pyx

         Check that :trac:`14989` is fixed::

            sage: QQi = NumberField(x^2+1, 'i', embedding=CC(0,1))
            sage: i = QQi.order(QQi.gen()).gen(1)
            sage: CC(i)
            1.00000000000000*I

See https://doc.sagemath.org/html/en/developer/coding_basics.html for the formatting of docstrings.

@videlec
Copy link
Contributor

videlec commented Feb 26, 2023

Your example already "works" fine on sage 9.5 (in the sense that it does return Launched png viewer for Graphics object consisting of 1 graphics primitive). On which sage version is it supposed to fail?

@videlec
Copy link
Contributor

videlec commented Feb 26, 2023

Do you mean to use arrow((0,0), (0,0), linestyle='dashed') as in the issue?

@sheerluck
Copy link
Contributor Author

Do you mean to use arrow((0,0), (0,0), linestyle='dashed') as in the issue?

I made a mistake but then force pushed correct version

@videlec
Copy link
Contributor

videlec commented Feb 26, 2023

Do you mean to use arrow((0,0), (0,0), linestyle='dashed') as in the issue?

I made a mistake but then force pushed correct version

Looks better now :)

@videlec
Copy link
Contributor

videlec commented Feb 26, 2023

Just waiting for the CI before giving a positive review.

@github-actions
Copy link

Documentation preview for this PR is ready! 🎉
Built with commit: d9f9a36

@seblabbe
Copy link
Contributor

seblabbe commented Mar 2, 2023

I see that the Build & Test is failing, but the error:

----------------------------------------------------------------------
sage -t --random-seed=225549214259244020593978072013798380016 doc/ca/intro/index.rst  # 1 doctest failed
----------------------------------------------------------------------

is not related to this ticket.

Copy link
Contributor

@seblabbe seblabbe left a comment

Choose a reason for hiding this comment

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

Changes look good to me.

@vbraun vbraun merged commit f8e7176 into sagemath:develop Mar 26, 2023
@mkoeppe mkoeppe added this to the sage-10.0 milestone Mar 26, 2023
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.

arrow((0,0), (0,0), linestyle='dashed') raises list index out of range
8 participants