From: Michael Orlitzky Date: Thu, 1 Nov 2018 20:16:35 +0000 (-0400) Subject: Kill unnecessary sitedir mangling. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=411f3b1863b7ee61b9e4fa651e14ef13a68e8349;p=sage.d.git Kill unnecessary sitedir mangling. At some point in the past, mangling the sitedir made the test suite work. Now it doesn't, and we have to do something else. So clean up the sitedir stuff. --- diff --git a/mjo/all.py b/mjo/all.py index 19c7290..4962a15 100644 --- a/mjo/all.py +++ b/mjo/all.py @@ -3,13 +3,6 @@ Import all of the other code, so that the user doesn't have to do it in his script. Instead, he can just `from mjo.all import *`. """ -# Sage doesn't load ~/.sage/init.sage during testing (sage -t), so we -# have to explicitly mangle our sitedir here so that "mjo.foo" -# resolves. -from os.path import abspath -from site import addsitedir -addsitedir(abspath('../')) - from mjo.cone.all import * from mjo.interpolation import * from mjo.misc import * diff --git a/mjo/cone/all.py b/mjo/cone/all.py index 00ceb9e..bda0d03 100644 --- a/mjo/cone/all.py +++ b/mjo/cone/all.py @@ -2,12 +2,6 @@ All imports from mjo.cone modules. """ -# Sage doesn't load ~/.sage/init.sage during testing (sage -t), so we -# have to explicitly mangle our sitedir here so that "mjo.foo" resolves. -from os.path import abspath -from site import addsitedir -addsitedir(abspath('../../')) - from mjo.cone.cone import * from mjo.cone.completely_positive import * from mjo.cone.doubly_nonnegative import * diff --git a/mjo/cone/completely_positive.py b/mjo/cone/completely_positive.py index 533c509..8638a63 100644 --- a/mjo/cone/completely_positive.py +++ b/mjo/cone/completely_positive.py @@ -6,15 +6,9 @@ the set of all matrices `$A$`of the form `$\sum uu^{T}$` for `$u \in """ from sage.all import * - -# Sage doesn't load ~/.sage/init.sage during testing (sage -t), so we -# have to explicitly mangle our sitedir here so that "mjo.cone" -# resolves. -from os.path import abspath -from site import addsitedir -addsitedir(abspath('../../')) from mjo.cone.symmetric_psd import factor_psd, is_symmetric_psd -from mjo.cone.doubly_nonnegative import is_doubly_nonnegative, is_extreme_doubly_nonnegative +from mjo.cone.doubly_nonnegative import (is_doubly_nonnegative, + is_extreme_doubly_nonnegative) def is_completely_positive(A): """ diff --git a/mjo/cone/doubly_nonnegative.py b/mjo/cone/doubly_nonnegative.py index 7d39061..583c3c6 100644 --- a/mjo/cone/doubly_nonnegative.py +++ b/mjo/cone/doubly_nonnegative.py @@ -13,12 +13,6 @@ It is represented typically by either `\mathcal{D}^{n}` or from sage.all import * -# Sage doesn't load ~/.sage/init.sage during testing (sage -t), so we -# have to explicitly mangle our sitedir here so that our module names -# resolve. -from os.path import abspath -from site import addsitedir -addsitedir(abspath('../../')) from mjo.cone.symmetric_psd import factor_psd, is_symmetric_psd, random_psd from mjo.matrix_vector import isomorphism diff --git a/mjo/cone/permutation_invariant.py b/mjo/cone/permutation_invariant.py index d664280..7aad31e 100644 --- a/mjo/cone/permutation_invariant.py +++ b/mjo/cone/permutation_invariant.py @@ -1,10 +1,3 @@ -# Sage doesn't load ~/.sage/init.sage during testing (sage -t), so we -# have to explicitly mangle our sitedir here so that "mjo.cone" -# resolves. -from os.path import abspath -from site import addsitedir -addsitedir(abspath('../../')) - from sage.all import * def random_permutation_invariant_cone(lattice=None,