Skip to content

Commit 9d8adaa

Browse files
author
Gerry Manoim
committed
Use existing matplotlibrc
1 parent 0a4faa6 commit 9d8adaa

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ jobs:
5858
flake8
5959
- name: Test with nose
6060
run: |
61-
nosetests alphalens/tests
61+
MATPLOTLIBRC=alphalens/tests/matplotlibrc nosetests alphalens/tests

alphalens/plotting.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,20 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
import os
1716
import numpy as np
1817
import pandas as pd
1918
from scipy import stats
2019
import statsmodels.api as sm
2120

22-
import matplotlib
23-
if os.environ.get('DISPLAY', '') == '':
24-
print('no display found. Using non-interactive Agg backend')
25-
matplotlib.use('Agg')
26-
import seaborn as sns # noqa: E402
27-
import matplotlib.cm as cm # noqa: E402
28-
import matplotlib.pyplot as plt # noqa: E402
29-
from matplotlib.ticker import ScalarFormatter # noqa: E402
21+
import seaborn as sns
22+
import matplotlib.cm as cm
23+
import matplotlib.pyplot as plt
24+
from matplotlib.ticker import ScalarFormatter
3025

31-
from functools import wraps # noqa: E402
26+
from functools import wraps
3227

33-
from . import utils # noqa: E402
34-
from . import performance as perf # noqa: E402
28+
from . import utils
29+
from . import performance as perf
3530

3631
DECIMAL_TO_BPS = 10000
3732

alphalens/tears.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
import os
16-
import matplotlib
17-
if os.environ.get('DISPLAY', '') == '':
18-
print('no display found. Using non-interactive Agg backend')
19-
matplotlib.use('Agg')
20-
import matplotlib.gridspec as gridspec # noqa: E402
21-
import matplotlib.pyplot as plt # noqa: E402
22-
import pandas as pd # noqa: E402
23-
import warnings # noqa: E402
24-
25-
from . import plotting # noqa: E402
26-
from . import performance as perf # noqa: E402
27-
from . import utils # noqa: E402
15+
16+
import matplotlib.gridspec as gridspec
17+
import matplotlib.pyplot as plt
18+
import pandas as pd
19+
import warnings
20+
21+
from . import plotting
22+
from . import performance as perf
23+
from . import utils
2824

2925

3026
class GridFigure(object):

0 commit comments

Comments
 (0)