8000 Don't use __builtins__ (an impl. detail) in pylab. by anntzer · Pull Request #7272 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Don't use __builtins__ (an impl. detail) in pylab. #7272

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

Merged
merged 1 commit into from
Oct 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 25 additions & 37 deletions lib/matplotlib/pylab.py
7C2B
Original file line number Diff line number Diff line change
Expand Up @@ -222,59 +222,47 @@

import sys, warnings

from matplotlib.cbook import flatten, is_string_like, exception_to_str, \
silent_list, iterable, dedent
from matplotlib.cbook import (
flatten, is_string_like, exception_to_str, silent_list, iterable, dedent)

8000
import matplotlib as mpl
# make mpl.finance module available for backwards compatability, in case folks
# using pylab interface depended on not having to import it
import matplotlib.finance

from matplotlib.dates import date2num, num2date,\
datestr2num, strpdate2num, drange,\
epoch2num, num2epoch, mx2num,\
DateFormatter, IndexDateFormatter, DateLocator,\
RRuleLocator, YearLocator, MonthLocator, WeekdayLocator,\
DayLocator, HourLocator, MinuteLocator, SecondLocator,\
rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, MONTHLY,\
WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY, relativedelta
from matplotlib.dates import (
date2num, num2date, datestr2num, strpdate2num, drange, epoch2num,
num2epoch, mx2num, DateFormatter, IndexDateFormatter, DateLocator,
RRuleLocator, YearLocator, MonthLocator, WeekdayLocator, DayLocator,
HourLocator, MinuteLocator, SecondLocator, rrule, MO, TU, WE, TH, FR,
SA, SU, YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY,
relativedelta)

import matplotlib.dates # Do we need this at all?

# bring all the symbols in so folks can import them from
# bring all the symbols in so folks can import them from
# pylab in one fell swoop


## We are still importing too many things from mlab; more cleanup is needed.

from matplotlib.mlab import griddata, stineman_interp, slopes, \
inside_poly, poly_below, poly_between, \
is_closed_polygon, path_length, distances_along_curve, vector_lengths

from matplotlib.mlab import window_hanning, window_none, detrend, demean, \
detrend_mean, detrend_none, detrend_linear, entropy, normpdf, \
find, longest_contiguous_ones, longest_ones, \
prctile, prctile_rank, \
center_matrix, rk4, bivariate_normal, get_xyz_where, \
get_sparse_matrix, dist, \
dist_point_to_segment, segments_intersect, fftsurr, movavg, \
exp_safe, \
amap, rms_flat, l1norm, l2norm, norm_flat, frange, identity, \
base_repr, binary_repr, log2, ispower2, \
rec_append_fields, rec_drop_fields, rec_join, csv2rec, rec2csv, isvector

import matplotlib.mlab as mlab
import matplotlib.cbook as cbook
from matplotlib.mlab import (
amap, base_repr, binary_repr, bivariate_normal, center_matrix, csv2rec,
demean, detrend, detrend_linear, detrend_mean, detrend_none, dist,
dist_point_to_segment, distances_along_curve, entropy, exp_safe,
fftsurr, find, frange, get_sparse_matrix, get_xyz_where, griddata,
identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm,
l2norm, log2, longest_contiguous_ones, longest_ones, movavg, norm_flat,
normpdf, path_length, poly_below, poly_between, prctile, prctile_rank,
rec2csv, rec_append_fields, rec_drop_fields, rec_join, rk4, rms_flat,
segments_intersect, slopes, stineman_interp, vector_lengths,
window_hanning, window_none)

from matplotlib import cbook, mlab, pyplot as plt
from matplotlib.pyplot import *

from numpy import *
from numpy.fft import *
from numpy.random import *
from numpy.linalg import *

from matplotlib.pyplot import *

# provide the recommended module abbrevs in the pylab namespace
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma

Expand All @@ -283,4 +271,4 @@

# This is needed, or bytes will be numpy.random.bytes from
# "from numpy.random import *" above
bytes = __builtins__['bytes']
bytes = six.moves.builtins.bytes
0