From a0235dc570aa0d526eca3cce7ea2b3c36ec9a261 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 3 Aug 2015 12:17:53 -0400 Subject: [PATCH] Trac #18454: Fix two confusing random_cone() examples. The docs for random_cone() contain two examples testing the output when min_ambient_dim == max_ambient_dim and min_rays == max_rays. However, the tests for these two conditions set all four parameters, obscuring their purpose. This commit fixes those tests to set/check only the relevant parameters. --- src/sage/geometry/cone.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index 8e2e4f65f9f..6b47b137fbf 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -4256,17 +4256,20 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None, sage: random_cone(max_ambient_dim=0, max_rays=0) 0-d cone in 0-d lattice N - We can predict the dimension when ``min_ambient_dim == max_ambient_dim``:: + We can predict the ambient dimension when + ``min_ambient_dim == max_ambient_dim``:: sage: set_random_seed() - sage: random_cone(min_ambient_dim=4, max_ambient_dim=4, min_rays=0, max_rays=0) - 0-d cone in 4-d lattice N + sage: K = random_cone(min_ambient_dim=4, max_ambient_dim=4) + sage: K.lattice_dim() + 4 Likewise for the number of rays when ``min_rays == max_rays``:: sage: set_random_seed() - sage: random_cone(min_ambient_dim=10, max_ambient_dim=10, min_rays=10, max_rays=10) - 10-d cone in 10-d lattice N + sage: K = random_cone(min_rays=3, max_rays=3) + sage: K.nrays() + 3 If we specify a lattice, then the returned cone will live in it::