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

Saf zero subspaces iterator #37

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Conversation

videlec
Copy link
Contributor

@videlec videlec commented Nov 2, 2021

  • implement a more generic iterator over isotropic subspaces (with a filter option for positive vector containmnent)
  • make the iterator smarter by eliminating early candidates that do not contain positive vectors. For example, the entries just after a pivot might be forced to be positive (if the entries above are <= 0)
  • presence of positive vectors can be tested via linear optimization

@videlec
Copy link
Contributor Author

videlec commented Nov 2, 2021

@saraedum Strange warning on my machine (conda is up to date)

$ sage -t --force-lib saf_zero_subspace.py 
too many failed tests, not using stored timings
Running doctests with ID 2021-11-02-20-21-58-43901b8e.
Using --optional=dochtml,memlimit,pip,sage
Doctesting 1 file.
sage -t --random-seed=0 saf_zero_subspace.py
**********************************************************************
File "saf_zero_subspace.py", line 71, in surface_dynamics.interval_exchanges.saf_zero_subspace.saf_zero_subspaces
Failed example:
    for vectors in saf_zero_subspaces(p, bound=1):
        P = Polyhedron(lines=vectors).intersection(Polyhedron(rays=(ZZ**6).basis()))
        if P.dimension() != 3:
            continue
        F = iet.IETFamily(p, P)
        T = F.random_element(K)
        assert T.sah_arnoux_fathi_invariant().is_zero()
        n_mins, n_saddles, n_unknowns = F.random_element_statistics(K, num_exp=100, num_iterations=4096)
        if n_saddles != 100:
            print(vectors, n_mins, n_saddles)
Expected nothing
Got:
    input_line_28:3:40: error: cannot initialize a member subobject of type 'intervalxt::InductionStep::Result' with an lvalue of type 'const int'
      self = new intervalxt::InductionStep{result, connection, additionalIntervalExchangeTransformation};
                                           ^~~~~~
    input_line_28:3:60: error: call to implicitly-deleted copy constructor of 'std::optional<IntervalExchangeTransformation>'
      self = new intervalxt::InductionStep{result, connection, additionalIntervalExchangeTransformation};
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/vincent/miniconda3/envs/flatsurf/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/include/c++/7.5.0/optional:455:7: note: copy constructor of 'optional<intervalxt::IntervalExchangeTransformation>' is implicitly deleted because base class '_Enable_copy_move<is_copy_constructible<IntervalExchangeTransformation>::value, __and_<is_copy_constructible<IntervalExchangeTransformation>, is_copy_assignable<IntervalExchangeTransformation> >::value, is_move_constructible<IntervalExchangeTransformation>::value, __and_<is_move_constructible<IntervalExchangeTransformation>, is_move_assignable<IntervalExchangeTransformation> >::value, optional<intervalxt::IntervalExchangeTransformation> >' has a deleted copy constructor
          private _Enable_copy_move<
          ^
    /home/vincent/miniconda3/envs/flatsurf/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/include/c++/7.5.0/bits/enable_special_members.h:157:15: note: '_Enable_copy_move' has been explicitly marked deleted here
        constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;
                  ^
**********************************************************************
1 item had failures:
   1 of  11 in surface_dynamics.interval_exchanges.saf_zero_subspace.saf_zero_subspaces
    [12 tests, 1 failure, 24.13 s]
----------------------------------------------------------------------
sage -t --random-seed=0 saf_zero_subspace.py  # 1 doctest failed
----------------------------------------------------------------------

@videlec
Copy link
Contributor Author

videlec commented Nov 3, 2021

EDIT: this error is normal, there is a zero length.

Even worse

sage: from surface_dynamics import iet
sage: from surface_dynamics.interval_exchanges.saf_zero_subspace import saf_zero_subspaces
sage: x = polygen(QQ)
sage: K.<cbrt3> = NumberField(x^3 - 3, embedding=AA(3)**(1/3))
sage: p = iet.Permutation('a b c d e f', 'f e d c b a')
sage: m = p.intersection_matrix()
sage: for vectors in saf_zero_subspaces(p, bound=10):
....:     P = Polyhedron(lines=vectors).intersection(Polyhedron(rays=(ZZ**6).basis()))
....:     if P.dimension() != 3:
....:         continue
....:     F = iet.IETFamily(p, P)
....:     T = F.random_element(K)
....:     assert T.sah_arnoux_fathi_invariant().is_zero()
....:     n_mins, n_saddles, n_unknowns = F.random_element_statistics(K, num_exp=10, num_iterations=4096)
....:     if n_saddles != 10:
....:         print(vectors, n_mins, n_saddles)
....: 
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-99eac1d4e989> in <module>
     12     T = F.random_element(K)
     13     assert T.sah_arnoux_fathi_invariant().is_zero()
---> 14     n_mins, n_saddles, n_unknowns = F.random_element_statistics(K, num_exp=Integer(10), num_iterations=Integer(4096))
     15     if n_saddles != Integer(10):
     16         print(vectors, n_mins, n_saddles)

~/programming/flatsurf/surface-dynamics/surface_dynamics/interval_exchanges/iet_family.pyx in surface_dynamics.interval_exchanges.iet_family.IETFamily.random_element_statistics()
    814             for i in range(num_exp):
    815                 T = self.random_element(ring, *args, **kwds)
--> 816                 U = iet_to_pyintervalxt(T)
    817                 res = U.induce(int(num_iterations))
    818                 if res.result in LIMIT_REACHED:

~/programming/flatsurf/surface-dynamics/surface_dynamics/interval_exchanges/conversion.py in iet_to_pyintervalxt(T)
     68 
     69     import pyintervalxt
---> 70     return pyintervalxt.IntervalExchangeTransformation(lengths, perm)
     71 
     72 

~/miniconda3/envs/flatsurf/lib/python3.9/site-packages/pyintervalxt/cppyy_intervalxt.py in IntervalExchangeTransformation(lengths, permutation)
    163     permutation = cppyy.gbl.std.vector[int](permutation)
    164 
--> 165     iet = intervalxt.cppyy.IntervalExchangeTransformation(lengths, permutation)
    166 
    167     iet.lengths = lambda: lengths

TypeError: Template method resolution failed:
  intervalxt::IntervalExchangeTransformation intervalxt::cppyy::IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >& lengths, const std::vector<int>& permutation) =>
    logic_error: LIBINTERVALXT_ASSERT_CONDITION(std::all_of(top.begin(), top.end(), [&](Label label) { return static_cast<bool>(this->lengths->get(label)); })) does not hold: all lengths must be positive in interval_exchange_transformation.cc:362
  none of the 2 overloaded methods succeeded. Full details:
  intervalxt::IntervalExchangeTransformation intervalxt::cppyy::IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >& lengths, const std::vector<int>& permutation) =>
    logic_error: LIBINTERVALXT_ASSERT_CONDITION(std::all_of(top.begin(), top.end(), [&](Label label) { return static_cast<bool>(this->lengths->get(label)); })) does not hold: all lengths must be positive in interval_exchange_transformation.cc:362
  intervalxt::IntervalExchangeTransformation intervalxt::cppyy::IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >& lengths, const std::vector<int>& permutation) =>
    logic_error: LIBINTERVALXT_ASSERT_CONDITION(std::all_of(top.begin(), top.end(), [&](Label label) { return static_cast<bool>(this->lengths->get(label)); })) does not hold: all lengths must be positive in interval_exchange_transformation.cc:362
  intervalxt::IntervalExchangeTransformation intervalxt::cppyy::IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >& lengths, const std::vector<int>& permutation) =>
    logic_error: LIBINTERVALXT_ASSERT_CONDITION(std::all_of(top.begin(), top.end(), [&](Label label) { return static_cast<bool>(this->lengths->get(label)); })) does not hold: all lengths must be positive in interval_exchange_transformation.cc:362
  Failed to instantiate "IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >*,std::vector<int>*)"
  Failed to instantiate "IntervalExchangeTransformation(intervalxt::cppyy::Lengths<std::vector<eantic::renf_elem_class> >,std::vector<int>)"

From the debugger I don't see anything wrong with the input

sage: %debug
> /home/vincent/miniconda3/envs/flatsurf/lib/python3.9/site-packages/pyintervalxt/cppyy_intervalxt.py(165)IntervalExchangeTransformation()
    163     permutation = cppyy.gbl.std.vector[int](permutation)
    164 
--> 165     iet = intervalxt.cppyy.IntervalExchangeTransformation(lengths, permutation)
    166 
    167     iet.lengths = lambda: lengths

ipdb> p permutation
<cppyy.gbl.std.vector<int> object at 0x558a3b8f9fc0>
ipdb> p lengths
<cppyy.gbl.intervalxt.cppyy.Lengths<std::vector<eantic::renf_elem_class> > object at 0x558a3b90f570>
ipdb> u
> /home/vincent/programming/flatsurf/surface-dynamics/surface_dynamics/interval_exchanges/conversion.py(70)iet_to_pyintervalxt()
     68 
     69     import pyintervalxt
---> 70     return pyintervalxt.IntervalExchangeTransformation(lengths, perm)
     71 
     72 

ipdb> p perm
(5, 4, 3, 2, 1, 0)
ipdb> p lengths
((9/2*cbrt3^2 - 3*cbrt3 - 2 ~ 3.0336285), (6*cbrt3^2 - 2*cbrt3 - 1 ~ 8.5960038), (cbrt3^2 + 3/2*cbrt3 + 1 ~ 5.2434582), 0, (13*cbrt3^2 - 5/2*cbrt3 - 1 ~ 22.435466), (9/2*cbrt3^2 - 3*cbrt3 - 2 ~ 3.0336285))

@saraedum
Copy link
Member

saraedum commented Nov 4, 2021

The warning you mention in #37 (comment) looks like a problem in cppyy to me @wlav.

The problematic snippet is nothing we wrote it seems so I guess it's cppyy's way to copy a struct around.

self = new intervalxt::InductionStep{result, connection, additionalIntervalExchangeTransformation};

Could you verify that your version of cppyy is current, i.e., 2.1.0? If so, we should probably try to create a smaller reproducer and report this upstream.

@videlec
Copy link
Contributor Author

videlec commented Nov 4, 2021

Apparently not up to date

$ conda list | grep cppyy
cppyy                     1.9.3            py39ha3ed2ce_0    conda-forge
cppyy-backend             1.14.1           py39h45ac560_0    conda-forge
cppyy-cling               6.21.4           py39hc2c29c0_0    conda-forge
cppyythonizations         1.1.3              pyhd8ed1ab_0    conda-forge
cpycppyy                  1.12.1           py39h1a9c180_0    conda-forge
$ python -c 'import cppyy; print(cppyy.__version__)'
1.9.3

@wlav
Copy link

wlav commented Nov 4, 2021

The difference between 1.x and 2.x are rather big: different version of Clang. Let me know if the error persists with the newer version and I'll take a look.

As-is, based on my limited reading/understanding, my first guess would have been this:
https://bitbucket.org/wlav/cppyy/issues/305/initialization-of-struct-reports-an-error

as it has the same error message. However, that report says that that was precisely fixed with 1.9.3 ...

@videlec
Copy link
Contributor Author

videlec commented Nov 11, 2021

@wlav @saraedum The update did solve the issue. Thanks. I apologize to not have checked that first myself.

@videlec videlec marked this pull request as draft January 9, 2022 14:17
@videlec videlec marked this pull request as ready for review January 10, 2022 09:28
@videlec videlec requested a review from saraedum January 10, 2022 09:29
@videlec
Copy link
Contributor Author

videlec commented Jan 10, 2022

@saraedum I am a bit unhappy with istotropic_subspaces that spend > 50% of its time calling the linear optimization routine...

sage: from surface_dynamics.misc.linalg import isotropic_subspaces
sage: B = matrix(5, [0,1,1,1,1,-1,0,1,1,1,-1,-1,0,1,1,-1,-1,-1,0,1,-1,-1,-1,-1,0])
sage: %time sum(1 for _ in isotropic_subspaces(B, 2, bound=4, contains_positive_vector=True))
CPU times: user 12.6 s, sys: 25.4 ms, total: 12.6 s
Wall time: 12.6 s
3269
sage: %prun sum(1 for _ in isotropic_subspaces(B, 2, bound=4, contains_positive_vector=True))
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    31635    6.685    0.000    6.779    0.000 {method 'solve' of 'sage.numerical.mip.MixedIntegerLinearProgram' objects}
     3270    3.158    0.001   14.557    0.004 linalg.py:154(isotropic_subspaces)
    31635    0.824    0.000    0.934    0.000 {method 'add_constraint' of 'sage.numerical.mip.MixedIntegerLinearProgram' objects}
     7839    0.809    0.000    9.470    0.001 linalg.py:388(has_positive_linear_combination)

@videlec
Copy link
Contributor Author

videlec commented Mar 8, 2023

@saraedum I am a bit puzzled by the doctest error on sage 9.5

 sage -t --long --random-seed=205360822628224557687023516526676011117 surface_dynamics/interval_exchanges/iet_family.py
**********************************************************************
File "surface_dynamics/interval_exchanges/iet_family.py", line 24, in surface_dynamics.interval_exchanges.iet_family
Failed example:
    (n1, n2, n3) = F.random_element_statistics(NumberField(x^3 - 2, 'a', embedding=AA(2)**(1/3)))
Expected nothing
Got:
    doctest:warning
      File "/usr/share/miniconda3/envs/test/bin/sage-runtests", line 155, in <module>
        err = DC.run()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/control.py", line 1261, in run
        self.run_doctests()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/control.py", line 962, in run_doctests
        self.dispatcher.dispatch()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2004, in dispatch
        self.parallel_dispatch()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 1899, in parallel_dispatch
        w.start()  # This might take some time
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2173, in start
        super(DocTestWorker, self).start()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/process.py", line 121, in start
        self._popen = self._Popen(self)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
        return _default_context.get_context().Process._Popen(process_obj)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/context.py", line 281, in _Popen
        return Popen(process_obj)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
        self._launch(process_obj)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/popen_fork.py", line 71, in _launch
        code = process_obj._bootstrap(parent_sentinel=child_r)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
        self.run()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2145, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2475, in __call__
        doctests, extras = self._run(runner, options, results)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2527, in _run
        result = runner.run(test)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 861, in run
        return self._run(test, compileflags, out)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest surface_dynamics.interval_exchanges.iet_family[5]>", line 1, in <module>
        (n1, n2, n3) = F.random_element_statistics(NumberField(x**Integer(3) - Integer(2), 'a', embedding=AA(Integer(2))**(Integer(1)/Integer(3))))
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/__init__.py", line 31, in <module>
        from .cppyy_gmpxx import mpz, mpq, mpf
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/cppyy_gmpxx.py", line 35, in <module>
        import cppyy
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/cppyy/__init__.py", line 319, in <module>
        import pkg_resources as pr
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/__init__.py", line 31, in <module>
        from .cppyy_gmpxx import mpz, mpq, mpf
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/cppyy_gmpxx.py", line 35, in <module>
        import cppyy
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/cppyy/__init__.py", line 319, in <module>
        import pkg_resources as pr
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3324, in <module>
        def _initialize_master_working_set():
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3298, in _call_aside
        f(*args, **kwargs)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3349, in _initialize_master_working_set
        tuple(dist.activate(replace=False) for dist in working_set)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3349, in <genexpr>
        tuple(dist.activate(replace=False) for dist in working_set)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2870, in activate
        declare_namespace(pkg)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2338, in declare_namespace
        warnings.warn(msg, DeprecationWarning, stacklevel=2)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
    Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
**********************************************************************
1 item had failures:
   1 of  20 in surface_dynamics.interval_exchanges.iet_family
    [91 tests, 1 failure, 7.20 s]

@saraedum
Copy link
Member

saraedum commented Mar 9, 2023

This will be fixed by conda-forge/conda-forge-repodata-patches-feedstock#414

@videlec
Copy link
Contributor Author

videlec commented Sep 15, 2023

Is there something to do against the failing doctest in iet_family.py?

sage -t --long --random-seed=129380967111641998098950119539706238850 surface_dynamics/interval_exchanges/iet_family.py
**********************************************************************
File "surface_dynamics/interval_exchanges/iet_family.py", line 24, in surface_dynamics.interval_exchanges.iet_family
Failed example:
    (n1, n2, n3) = F.random_element_statistics(NumberField(x^3 - 2, 'a', embedding=AA(2)**(1/3)))
Expected nothing
Got:
    doctest:warning
      File "/usr/share/miniconda3/envs/test/bin/sage-runtests", line 154, in <module>
        err = DC.run()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/control.py", line 1384, in run
        self.run_doctests()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/control.py", line 1059, in run_doctests
        self.dispatcher.dispatch()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2021, in dispatch
        self.parallel_dispatch()
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 1916, in parallel_dispatch
        w.start()  # This might take some time
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/sage/doctest/forker.py", line 2190, in start
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/__init__.py", line 31, in <module>
        from .cppyy_gmpxx import mpz, mpq, mpf
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/gmpxxyy/cppyy_gmpxx.py", line 35, in <module>
        import cppyy
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/cppyy/__init__.py", line 319, in <module>
        import pkg_resources as pr
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3328, in <module>
        def _initialize_master_working_set():
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3302, in _call_aside
        f(*args, **kwargs)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3353, in _initialize_master_working_set
        tuple(dist.activate(replace=False) for dist in working_set)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3353, in <genexpr>
        tuple(dist.activate(replace=False) for dist in working_set)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2871, in activate
        declare_namespace(pkg)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2339, in declare_namespace
        warnings.warn(msg, DeprecationWarning, stacklevel=2)
      File "/usr/share/miniconda3/envs/test/lib/python3.10/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
    Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
**********************************************************************

@saraedum
Copy link
Member

This needs cppyy=3 to make the warning go away. Anyway, I'd just set the doctest to # random output due to spurious deprecation warnings from cppyy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants