예제 #1
0
def _subprocess_matplotlib_subtests():
    import matplotlib as mpl
    import timple
    tmpl = timple.Timple()
    tmpl.enable(pd_nat_dates_support=True)
    # to be run in a subprocess
    ret = 0
    ret += mpl.test(verbosity=1, argv=['matplotlib.tests.test_dates']).value
    ret += mpl.test(verbosity=1, argv=['matplotlib.tests.test_units']).value
    if ret != 0:
        sys.exit(1)
예제 #2
0
                        action='store_true',
                        help='Run tests without network connection')
    parser.add_argument(
        '-j',
        type=int,
        help='Shortcut for specifying number of test processes')
    args, extra_args = parser.parse_known_args()

    if args.no_pep8:
        default_test_modules.remove('matplotlib.tests.test_coding_standards')
        sys.argv.remove('--no-pep8')
    elif args.pep8:
        default_test_modules[:] = ['matplotlib.tests.test_coding_standards']
        sys.argv.remove('--pep8')
    if args.no_network:
        from matplotlib.testing import disable_internet
        disable_internet.turn_off_internet()
        extra_args.extend(['-a', '!network'])
        sys.argv.remove('--no-network')
    if args.j:
        extra_args.extend(
            ['--processes={}'.format(args.j), '--process-timeout=300'])
        sys.argv.pop(sys.argv.index('-j') + 1)
        sys.argv.remove('-j')

    print('Python byte-compilation optimization level: %d' %
          sys.flags.optimize)

    success = test(argv=sys.argv + extra_args, switch_backend_warn=False)
    sys.exit(not success)
예제 #3
0
    import warnings

    # Python 3.6 deprecate invalid character-pairs \A, \* ... in non
    # raw-strings and other things. Let's not re-introduce them
    warnings.filterwarnings('error', '.*invalid escape sequence.*',
        category=DeprecationWarning)
    warnings.filterwarnings(
        'default',
        '.*inspect.getargspec\(\) is deprecated.*',
        category=DeprecationWarning)

    from matplotlib import test

    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('--no-network', action='store_true',
                        help='Run tests without network connection')
    parser.add_argument('--recursionlimit', type=int, default=0,
                        help='Specify recursionlimit for test run')
    args, extra_args = parser.parse_known_args()

    if args.no_network:
        from matplotlib.testing import disable_internet
        disable_internet.turn_off_internet()
        extra_args.extend(['-m', 'not network'])

    print('Python byte-compilation optimization level:', sys.flags.optimize)

    retcode = test(argv=extra_args, switch_backend_warn=False,
                   recursionlimit=args.recursionlimit)
    sys.exit(retcode)
예제 #4
0
if ans == 'y':

    print(str("Running some Scipy tests: "))

    scipy.test()

print("\n")

print("\t  Would you like to run the MATPLOTLIB basic test suite...")

ans = input("For yes, enter y and hit return: ")

if ans == 'y':

    print(str("Running some Matplotlib tests: "))

    matplotlib.test()

print("\n")

print("\t  Would you like to run the IPYTHON basic test suite...")

ans = input("For yes, enter y and hit return: ")

if ans == 'y':

    print(str("Running some Ipython tests: "))

    IPython.test()
예제 #5
0
    except ImportError:
        pass

    # The warnings need to be before any of matplotlib imports, but after
    # dateutil.parser and setuptools (if present) which has syntax error with
    # the warnings enabled.  Filtering by module does not work as this will be
    # raised by Python itself so `module=matplotlib.*` is out of question.

    import warnings

    # Python 3.6 deprecate invalid character-pairs \A, \* ... in non
    # raw-strings and other things. Let's not re-introduce them
    warnings.filterwarnings('error', '.*invalid escape sequence.*',
                            category=DeprecationWarning)
    warnings.filterwarnings(
        'default',
        r'.*inspect.getargspec\(\) is deprecated.*',
        category=DeprecationWarning)

    from matplotlib import test

    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('--recursionlimit', type=int, default=0,
                        help='Specify recursionlimit for test run')
    args, extra_args = parser.parse_known_args()

    print('Python byte-compilation optimization level:', sys.flags.optimize)

    retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
    sys.exit(retcode)
예제 #6
0
파일: tests.py 프로젝트: Kojoley/matplotlib
                        help='Run only PEP8 testing')
    parser.add_argument('--no-network', action='store_true',
                        help='Run tests without network connection')
    parser.add_argument('-j', type=int,
                        help='Shortcut for specifying number of test processes')
    args, extra_args = parser.parse_known_args()

    if args.no_pep8:
        default_test_modules.remove('matplotlib.tests.test_coding_standards')
        sys.argv.remove('--no-pep8')
    elif args.pep8:
        default_test_modules[:] = ['matplotlib.tests.test_coding_standards']
        sys.argv.remove('--pep8')
    if args.no_network:
        from matplotlib.testing import disable_internet
        disable_internet.turn_off_internet()
        extra_args.extend(['-a', '!network'])
        sys.argv.remove('--no-network')
    if args.j:
        extra_args.extend([
            '--processes={}'.format(args.j),
            '--process-timeout=300'
        ])
        sys.argv.pop(sys.argv.index('-j') + 1)
        sys.argv.remove('-j')

    print('Python byte-compilation optimization level: %d' % sys.flags.optimize)

    success = test(argv=sys.argv + extra_args, switch_backend_warn=False)
    sys.exit(not success)
예제 #7
0
import matplotlib
matplotlib.test()
예제 #8
0
파일: tests.py 프로젝트: zmh890/matplotlib
    warnings.filterwarnings('error',
                            '.*invalid escape sequence.*',
                            category=DeprecationWarning)
    warnings.filterwarnings('default',
                            '.*inspect.getargspec\(\) is deprecated.*',
                            category=DeprecationWarning)

    from matplotlib import test

    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('--no-network',
                        action='store_true',
                        help='Run tests without network connection')
    parser.add_argument('--recursionlimit',
                        type=int,
                        default=0,
                        help='Specify recursionlimit for test run')
    args, extra_args = parser.parse_known_args()

    if args.no_network:
        from matplotlib.testing import disable_internet
        disable_internet.turn_off_internet()
        extra_args.extend(['-m', 'not network'])

    print('Python byte-compilation optimization level:', sys.flags.optimize)

    retcode = test(argv=extra_args,
                   switch_backend_warn=False,
                   recursionlimit=args.recursionlimit)
    sys.exit(retcode)
예제 #9
0
#from mp1_tooltits.mplot3d import axes3d
#import matplotlib.py.plot as plt
import matplotlib as mp
mp.test()
#fig=pl t.figure()
#ax=fig.gca(progection='3d')
#X,Y,Z=axes3d.get_test_data(0.05)
#ax.plot_surface(X,Y,Z,rstride=8,cstride=8,alpha=0.3)
#cset=ax.contour(X,Y,Z,)
예제 #10
0
import csv
import numpy as np
from sklearn.svm import SVR
import matplotlib.pyplot as plt
import matplotlib as matp

dates = []
prices = []

matp.test()


def get_data(filename):
    with open(filename, 'r') as csvfile:
        csvFileReader = csv.reader(csvfile)
        next(csvFileReader)
        for row in csvFileReader:
            dates.append(int(row[0].split('-')[0]))
            prices.append(float(row[1]))
    return


def predict_price(dates, prices, x):
    dates = np.reshape(dates, (len(dates), 1))

    svr_lin = SVR(kernel='linear', C=1e3)
    svr_poly = SVR(kernel='poly', C=1e3, degree=2)
    svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1)
    svr_lin.fit(dates, prices)
    svr_poly.fit(dates, prices)
    svr_rbf.fit(dates, prices)
예제 #11
0
파일: tests.py 프로젝트: QuLogic/matplotlib
    except ImportError:
        pass

    # The warnings need to be before any of matplotlib imports, but after
    # dateutil.parser and setuptools (if present) which has syntax error with
    # the warnings enabled.  Filtering by module does not work as this will be
    # raised by Python itself so `module=matplotlib.*` is out of question.

    import warnings

    # Python 3.6 deprecate invalid character-pairs \A, \* ... in non
    # raw-strings and other things. Let's not re-introduce them
    warnings.filterwarnings('error', '.*invalid escape sequence.*',
        category=DeprecationWarning)
    warnings.filterwarnings(
        'default',
        r'.*inspect.getargspec\(\) is deprecated.*',
        category=DeprecationWarning)

    from matplotlib import test

    parser = argparse.ArgumentParser(add_help=False)
    parser.add_argument('--recursionlimit', type=int, default=0,
                        help='Specify recursionlimit for test run')
    args, extra_args = parser.parse_known_args()

    print('Python byte-compilation optimization level:', sys.flags.optimize)

    retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
    sys.exit(retcode)
예제 #12
0
파일: tests.py 프로젝트: dlaidig/matplotlib
                        action='store_true',
                        help='Run only PEP8 testing')
    parser.add_argument('--no-network',
                        action='store_true',
                        help='Run tests without network connection')
    parser.add_argument(
        '-j',
        type=int,
        help='Shortcut for specifying number of test processes')
    parser.add_argument('--recursionlimit',
                        type=int,
                        default=0,
                        help='Specify recursionlimit for test run')
    args, extra_args = parser.parse_known_args()

    if args.no_network:
        from matplotlib.testing import disable_internet
        disable_internet.turn_off_internet()
        extra_args.extend(['-a', '!network'])
    if args.j:
        extra_args.extend(
            ['--processes={}'.format(args.j), '--process-timeout=300'])

    print('Python byte-compilation optimization level: %d' %
          sys.flags.optimize)

    success = test(argv=sys.argv[0:1] + extra_args,
                   switch_backend_warn=False,
                   recursionlimit=args.recursionlimit)
    sys.exit(not success)