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

random_element for EquiangularPolygons #62

Merged
merged 3 commits into from
Sep 16, 2020

Conversation

videlec
Copy link
Collaborator

@videlec videlec commented Sep 15, 2020

Fixes #61

@videlec
Copy link
Collaborator Author

videlec commented Sep 15, 2020

Still one bug to fix, this fails a lot with ValueError('the vertices are in clockwise order'). I am not sure what it means.

@videlec
Copy link
Collaborator Author

videlec commented Sep 15, 2020

@saraedum pyeantic changed its mind

sage -t --long flatsurf/geometry/polygon.py

**********************************************************************

File "flatsurf/geometry/polygon.py", line 1871, in flatsurf.geometry.polygon.EquiangularPolygons

Failed example:

    P(K(1)) # optional: eantic

Expected:

    Polygon: (0, 0), (1, 0), ((1/2*c0 ~ 0.70710678), (-1/2*c0+1 ~ 0.29289322))

Got:

    Polygon: (0, 0), (1, 0), (1/2*c0, -1/2*c0 + 1)

**********************************************************************

@videlec
Copy link
Collaborator Author

videlec commented Sep 15, 2020

@saraedum this looks more critical

**********************************************************************

File "flatsurf/geometry/polygon.py", line 1890, in flatsurf.geometry.polygon.EquiangularPolygons

Failed example:

    from pyexactreal import ExactReals # optional: exactreal

Expected nothing

Got:

    cling::DynamicLibraryManager::loadLibrary(): /home/travis/miniconda/envs/test-environment/lib/libexactreal.so.0.0.0: undefined symbol: fmpq_mul_si

**********************************************************************

File "flatsurf/geometry/polygon.py", line 1891, in flatsurf.geometry.polygon.EquiangularPolygons

Failed example:

    R = ExactReals(P.base_ring()) # optional: exactreal

Exception raised:

    Traceback (most recent call last):

      File "sage/misc/cachefunc.pyx", line 996, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:5863)

        return self.cache[k]

      File "sage/misc/weak_dict.pyx", line 705, in sage.misc.weak_dict.WeakValueDictionary.__getitem__ (build/cythonized/sage/misc/weak_dict.c:3646)

        raise KeyError(k)

    KeyError: ((<class 'pyexactreal.exact_reals.ExactReals'>, Number Field in c0 with defining polynomial x^2 - 2 with c0 = 1.414213562373095?, Category of infinite integral domains), ())

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run

        self.compile_and_execute(example, compiler, test.globs)

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute

        exec(compiled, globs)

      File "<doctest flatsurf.geometry.polygon.EquiangularPolygons[13]>", line 1, in <module>

        R = ExactReals(P.base_ring()) # optional: exactreal

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/pyexactreal/__init__.py", line 102, in ExactReals

        return ER(base, *args, **kwargs)

      File "sage/misc/classcall_metaclass.pyx", line 334, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1713)

        return cls.classcall(cls, *args, **kwds)

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/pyexactreal/exact_reals.py", line 618, in __classcall__

        return super(ExactReals, cls).__classcall__(cls, base, category)

      File "sage/misc/cachefunc.pyx", line 1001, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:5989)

        w = self.f(*args, **kwds)

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/sage/structure/unique_representation.py", line 1027, in __classcall__

        instance = typecall(cls, *args, **options)

      File "sage/misc/classcall_metaclass.pyx", line 505, in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:2163)

        return (<PyTypeObject*>type).tp_call(cls, args, kwds)

      File "/home/travis/miniconda/envs/test-environment/lib/python3.7/site-packages/pyexactreal/exact_reals.py", line 627, in __init__

        ring = exactreal.NumberField(base.renf)

    TypeError: none of the 5 overloaded methods succeeded. Full details:

      NumberField::NumberField(exactreal::NumberField&&) =>

        ValueError: could not convert argument 1 (object is not an rvalue)

      NumberField::NumberField(const eantic::renf_elem_class&) =>

        TypeError: could not convert argument 1

      exactreal::NumberField constructor failed

      NumberField::NumberField(const exactreal::NumberField&) =>

        TypeError: could not convert argument 1

      NumberField::NumberField() =>

        TypeError: takes at most 0 arguments (1 given)

**********************************************************************

@videlec videlec merged commit f3a13e8 into flatsurf:master Sep 16, 2020
@videlec videlec deleted the random-polygon branch September 16, 2020 08:23
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.

implement random_element for EquiangularPolygons
1 participant