Skip to content

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Feb 23, 2023

📚 Description

Fixes #33091

tldr:

  • # optional tags go on the sage: lines.
  • they don't go on the ....: lines.

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

⌛ Dependencies

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Base: 88.60% // Head: 88.58% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (af479f2) compared to base (8f5bbd2).
Patch has no changes to coverable lines.

❗ Current head af479f2 differs from pull request most recent head 1308665. Consider uploading reports for the commit 1308665 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #35181      +/-   ##
===========================================
- Coverage    88.60%   88.58%   -0.02%     
===========================================
  Files         2140     2140              
  Lines       397273   397272       -1     
===========================================
- Hits        352004   351937      -67     
- Misses       45269    45335      +66     
Impacted Files Coverage Δ
...omplex_reflection_or_generalized_coxeter_groups.py 95.04% <ø> (ø)
...age/categories/finite_complex_reflection_groups.py 79.12% <ø> (ø)
src/sage/combinat/abstract_tree.py 96.04% <ø> (ø)
src/sage/combinat/crystals/alcove_path.py 93.72% <ø> (ø)
src/sage/combinat/designs/bibd.py 87.83% <ø> (ø)
src/sage/combinat/designs/incidence_structures.py 87.98% <ø> (ø)
src/sage/combinat/designs/orthogonal_arrays.py 90.42% <ø> (ø)
...binat/designs/orthogonal_arrays_build_recursive.py 85.32% <ø> (ø)
src/sage/combinat/designs/resolvable_bibd.py 97.16% <ø> (ø)
...sage/combinat/designs/steiner_quadruple_systems.py 95.68% <ø> (ø)
... and 85 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.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

do you have 3a1a03a in the branch? Cause I don't get why you get a test failure. Do you misdetect GAP3 as present?

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

err, still not enough # optional - gap3 tags.

3a1a03ae2cc (Travis Scrimshaw  2023-01-25 10:43:07 +0900  199)             sage: W = ReflectionGroup((3,1,2))            # optional - gap3
14d6f619119 (Travis Scrimshaw  2023-01-26 16:39:54 +0900  200)             sage: data = {w: [w.to_matrix(), w.to_matrix(on_space="dual")] for w in W}  # optional - gap3
3a1a03ae2cc (Travis Scrimshaw  2023-01-25 10:43:07 +0900  201)             sage: for w in W.iteration_tracking_words():  # optional - gap3
3a1a03ae2cc (Travis Scrimshaw  2023-01-25 10:43:07 +0900  202)             ....:     w.reduced_word()                    # optional - gap3
14d6f619119 (Travis Scrimshaw  2023-01-26 16:39:54 +0900  203)             ....:     mats = [w.to_matrix(), w.to_matrix(on_space="dual")]  # optional - gap3
14d6f619119 (Travis Scrimshaw  2023-01-26 16:39:54 +0900  204)             ....:     mats
14d6f619119 (Travis Scrimshaw  2023-01-26 16:39:54 +0900  205)             ....:     assert data[w] == mats

@tobiasdiez
Copy link
Contributor

To reduce these missing optional directives, maybe block level directives would be a handy solution? https://xdoctest.readthedocs.io/en/latest/xdoctest.directive.html

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

To reduce these missing optional directives, maybe block level directives would be a handy solution? https://xdoctest.readthedocs.io/en/latest/xdoctest.directive.html

looks interesting

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

I don't know what's up with relint - has anyone tried running what it suggests?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

I don't know what's up with relint - has anyone tried running what it suggests?

If you're referring to the messages about namespace packages, this is done in #35105, #35106, #35107, which need review

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

still not enough # optional - gap3 tags.

The new linting rule complains because there are too many of these tags, not too few!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

[...] maybe block level directives would be a handy solution? https://xdoctest.readthedocs.io/en/latest/xdoctest.directive.html

Thanks for the pointer. More expressive/powerful doctest annotations would of course be helpful. Not really for this ticket, which is about getting rid of too many (and badly placed) directives on multi-line doctests. But definitely for the work in #34998 for the modularization effort.

However, block- and function-scope # optional annotations have been discussed many times over the years, and were rejected / discussed to death each time. At least, we were able to get in file-level annotations (top of file # sage.doctest - optional ...).

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023 via email

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Fixed what where?

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

pushed straight to develop
added 2 # optional: gap3 tags

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

These tags that you added in c017a6a are wrong.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

And CI did not fail with 10.0.beta2 -- https://github.com/sagemath/sage/actions/runs/4258115923

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023 via email

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023 via email

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

On Fri, 24 Feb 2023, 18:23 Matthias Köppe, @.> wrote: And CI did not fail with 10.0.beta2 -- https://github.com/sagemath/sage/actions/runs/4258115923
yes it did fail, you are probably looking at a different run

— Reply to this email directly, view it on GitHub <#35181 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXYHEWIKJEMEOG2ZRV3O3WZD4BJANCNFSM6AAAAAAVF6EJAY . You are receiving this because you commented.Message ID: @.
>

Dude, of course the build was OK, it's build+test that failed.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

I've pushed the correct fix.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Could you please undo the vandalism on the develop branch?

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

no idea what you are talking about. tags were missing there

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

Have a look at my commit:
c017a6a

diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx
index 02761726799..54553d6f748 100644
--- a/src/sage/combinat/root_system/reflection_group_element.pyx
+++ b/src/sage/combinat/root_system/reflection_group_element.pyx
@@ -201,8 +201,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement):
             sage: for w in W.iteration_tracking_words():  # optional - gap3
             ....:     w.reduced_word()                    # optional - gap3
             ....:     mats = [w.to_matrix(), w.to_matrix(on_space="dual")]  # optional - gap3
-            ....:     mats
-            ....:     assert data[w] == mats
+            ....:     mats                                # optional - gap3
+            ....:     assert data[w] == mats              # optional - gap3
             []
             [
             [1 0]  [1 0]

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Yes, I've seen it and it is wrong.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

after my change, build+test passed. before, it was falling.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Read it.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

Yes, I've seen it and it is wrong.

the develop branch was wrong.
do you notice tags on the continuation lines?!

If I undo this change, as you insist, it will break again. Feel free to change it as you prefer, though.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

do you notice tags on the continuation lines?!

Yes, you added them, which is wrong.

Read https://github.com/sagemath/sage/pull/35181/files#diff-9a1298cd02d22076148519df77cb7b7a99cce074fe4a07c3f4aade37e821705aR1225, and you'll understand.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

the offending

commit 14d6f6191190904f92728e00989de7ec1b7ff180
Author: Travis Scrimshaw <tcscrims@gmail.com>
Date:   Thu Jan 26 16:39:54 2023 +0900

    Adding some systematic doctests and one detail.

commit 3a1a03ae2cc38d75691418bfda23a703e002139c
Author: Travis Scrimshaw <tcscrims@gmail.com>
Date:   Wed Jan 25 10:43:07 2023 +0900

    Updating __hash__ and updating gap3 doctests to pass.

were added on #34912 - positively reviewed by @stumpc5 (still on trac) who probably didn't notice failing doctests on systems without GAP3 (GAP3 is a good topic for a separate rant...).
And merged by @vbraun in 10.0.beta0.
No idea how it slipped through so far - it's wrong tags placing.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

You still haven't read it.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

do you notice tags on the continuation lines?!

Yes, you added them, which is wrong.

When did I add the tags on the first 2 continuation lines?! They are in @tscrim 's commits!

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Putting extra # optional on ....: lines does not cause test failures. They are ignored by the doctester. They have no effect. They are just decoration.

Here on the branch I am adding a linter rule that complains about such undisciplined, ineffective decorations, in order to reduce confusion about where tags should be placed.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

Putting extra # optional on ....: lines does not cause test failures. They are ignored by the doctester. They have no effect. They are just decoration.

Here on the branch I am adding a linter rule that complains about such undisciplined, ineffective decorations, in order to reduce confusion about where tags should be placed.

I am not talking about linter failures.
I still don't know why build+test failed on these lines. Are you saying you have a linter which runs at test time now?

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

here is the test run I am talking about: https://github.com/sagemath/sage/actions/runs/4259014013/jobs/7410872930

sage -t --random-seed=271026750805586244091817476045938441266 sage/combinat/root_system/reflection_group_element.pyx
**********************************************************************
File "sage/combinat/root_system/reflection_group_element.pyx", line 200, in sage.combinat.root_system.reflection_group_element.ComplexReflectionGroupElement.to_matrix
Failed example:
    data = {w: [w.to_matrix(), w.to_matrix(on_space="dual")] for w in W}
Exception raised:
    Traceback (most recent call last):
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 695, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 1093, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.combinat.root_system.reflection_group_element.ComplexReflectionGroupElement.to_matrix[0]>", line 1, in <module>
        data = {w: [w.to_matrix(), w.to_matrix(on_space="dual")] for w in W}
    NameError: name 'W' is not defined
**********************************************************************
File "sage/combinat/root_system/reflection_group_element.pyx", line 201, in sage.combinat.root_system.reflection_group_element.ComplexReflectionGroupElement.to_matrix
Failed example:
    for w in W.iteration_tracking_words():
        w.reduced_word()
        mats = [w.to_matrix(), w.to_matrix(on_space="dual")]
        mats
        assert data[w] == mats
Exception raised:
    Traceback (most recent call last):
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 695, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/__w/sage/sage/src/sage/doctest/forker.py", line 1093, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.combinat.root_system.reflection_group_element.ComplexReflectionGroupElement.to_matrix[1]>", line 1, in <module>
        for w in W.iteration_tracking_words():
    NameError: name 'W' is not defined
**********************************************************************
1 item had failures:
   2 of   3 in sage.combinat.root_system.reflection_group_element.ComplexReflectionGroupElement.to_matrix
    [21 tests, 2 failures, 0.10 s]

This is the thing I was fixing in develop.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Yes, there was a mistake here on the branch on these lines, which caused a test failure. I have fixed it in 1913358

There was no test failure on develop (10.0.beta2).

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

here is the test run I am talking about: https://github.com/sagemath/sage/actions/runs/4259014013/jobs/7410872930

Yes, this is a run for this branch, not for develop.

There was nothing to fix on develop.

@dimpase
Copy link
Member

dimpase commented Feb 24, 2023

OK, sorry for confusion. I fixed the develop branch, as you might have noticed.

@github-actions
Copy link

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

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 24, 2023

Thanks! I've merged it already.

Copy link
Contributor

@tornaria tornaria left a comment

Choose a reason for hiding this comment

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

LGTM

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 26, 2023

Thank you!

@vbraun
Copy link
Member

vbraun commented Mar 23, 2023

Merge conflict, wait for the next beta

orlitzky and others added 14 commits March 27, 2023 11:27
There are a few tests in the sage library that span multiple lines and
that were intended to be marked as "long time", but were not due to an
implementation detail. As it stands, it is the FIRST line of a doctest
that needs to be marked "long time", and not the last.

This commit fixes a few doctests whose last (but not first) lines were
tagged, updating them instead to bear the "# long time" tag on each
line. This is overkill, but will save us time in the event that the
parser is ever changed.
…][.].*#/s/ *# *(arb216|arb218|py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest).*//'
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2023

Trivial rebase, back to positive

@vbraun vbraun merged commit 0ae9698 into sagemath:develop Apr 1, 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.

labels in multiline doctests
7 participants