|
264 | 264 | # https://www.gnu.org/licenses/ |
265 | 265 | # |
266 | 266 | # ************************************************************************ |
267 | | -import os |
268 | 267 | import logging |
| 268 | +import os |
| 269 | +import re |
269 | 270 |
|
270 | | -from .interface import Interface, InterfaceElement, InterfaceFunction, InterfaceFunctionElement |
271 | 271 | from sage.env import DOT_SAGE |
272 | | -import re |
273 | | -from sage.structure.element import parent |
| 272 | +from sage.features import PythonModule |
| 273 | +from sage.interfaces.interface import ( |
| 274 | + Interface, |
| 275 | + InterfaceElement, |
| 276 | + InterfaceFunction, |
| 277 | + InterfaceFunctionElement, |
| 278 | +) |
274 | 279 | from sage.interfaces.tab_completion import ExtraTabCompletion |
275 | 280 | from sage.misc.instancedoc import instancedoc |
276 | 281 |
|
277 | 282 | # see the _lazy_init for some reasoning behind the lazy imports |
278 | 283 | from sage.misc.lazy_import import lazy_import |
279 | | -from sage.features import PythonModule |
| 284 | +from sage.structure.element import parent |
280 | 285 |
|
281 | 286 | rpy2_feature = PythonModule('rpy2', spkg='rpy2', type='standard') |
282 | 287 |
|
@@ -371,7 +376,7 @@ def _setup_r_to_sage_converter(): |
371 | 376 | sage: labs = r.paste('c("X","Y")', '1:10', sep='""'); labs.sage() |
372 | 377 | ['X1', 'Y2', 'X3', 'Y4', 'X5', 'Y6', 'X7', 'Y8', 'X9', 'Y10'] |
373 | 378 | """ |
374 | | - from rpy2.rinterface import SexpVector, ListSexpVector, FloatSexpVector |
| 379 | + from rpy2.rinterface import FloatSexpVector, ListSexpVector, SexpVector |
375 | 380 |
|
376 | 381 | # convert rpy2's representation of r objects to the one sage expects (as defined by the old |
377 | 382 | # expect interface) |
@@ -484,6 +489,7 @@ def __init__(self, |
484 | 489 |
|
485 | 490 | TESTS:: |
486 | 491 |
|
| 492 | + sage: from sage.interfaces.r import r |
487 | 493 | sage: r == loads(dumps(r)) |
488 | 494 | True |
489 | 495 | """ |
|
0 commit comments