-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (27 loc) · 762 Bytes
/
main.py
File metadata and controls
38 lines (27 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""This file is for testing purposes. It allows the test suite to operate on
main.py in the root directory, exactly as AutoFeedback is intended to operate
on student work by default"""
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
def f1(x):
return (x**2)
def f2(x, y):
return
def broken_function(x):
raise RuntimeError
x = 3
y = np.linspace(0, 1, 3)
z = np.eye(3)
plt.plot([0, 1, 2], [0, 1, 4], 'r-', label='quadratic')
plt.plot([0.5, 1.5], [1.5, 2.5], 'bD', label='linear')
plt.legend()
plt.axis([-1, 1, -2, 2])
plt.xlabel('x')
plt.ylabel('y')
plt.title('z')
symR = sp.Rational(1/2)
symx = sp.symbols("x")
symy = sp.Matrix([1, 2, symx])
symz = sp.Matrix([[1, 2, 3], [1, 3, 2], [3, 1, 2]])
symd = {"a": 1, "b": 2}