-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcode.html
More file actions
680 lines (559 loc) · 41 KB
/
Copy pathcode.html
File metadata and controls
680 lines (559 loc) · 41 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math2Code’s Documentation — Math2Code 0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="API Reference" href="api.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-app.image2latex">
<span id="math2code-s-documentation"></span><h1>Math2Code’s Documentation<a class="headerlink" href="#module-app.image2latex" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="app.image2latex.call_mathpix_api">
<code class="descclassname">app.image2latex.</code><code class="descname">call_mathpix_api</code><span class="sig-paren">(</span><em>file_path: str</em><span class="sig-paren">)</span> → dict<a class="headerlink" href="#app.image2latex.call_mathpix_api" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the confidence score and latex string of an image from a specified
file path using the Mathpix API.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>Input: file_path: path of the specified image</dd>
<dt>Returns:</dt>
<dd>Output: Dictionary {‘confidence’:int , ‘latex_str’:str, ‘error’:bool,
‘error_msg’:str}
‘error_msg’={‘file size is more than 4 MB’, ‘Invalid file’,
‘low confidence’,’NA’}</dd>
</dl>
</dd></dl>
<span class="target" id="module-app.latex2numpy"></span><dl class="function">
<dt id="app.latex2numpy.absolute">
<code class="descclassname">app.latex2numpy.</code><code class="descname">absolute</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.absolute" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace || with np.absolute</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.add_multiplier">
<code class="descclassname">app.latex2numpy.</code><code class="descname">add_multiplier</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>verbose=True</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.add_multiplier" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Input:</dt>
<dd><p class="first">scope = the list that you are currently working on
index = the index of the element of the list called scope</p>
<blockquote class="last">
<div>that you are currently checking</div></blockquote>
</dd>
<dt>Output:</dt>
<dd>A new list with asterisk symbol added if no operation is specified</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.change_var_name">
<code class="descclassname">app.latex2numpy.</code><code class="descname">change_var_name</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>list_of_names: list</em>, <em>verbose: bool</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.change_var_name" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Input:</dt>
<dd><p class="first">scope = the list that you are currently working on
index = the index of the element of the list called scope</p>
<blockquote class="last">
<div>that you are currently checking</div></blockquote>
</dd>
<dt>Output:</dt>
<dd>A new list where (vec, hat, bar, prime, ect) change variable name thus turns into str
See examples: 2, 12, 24, 25!</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.clip_start">
<code class="descclassname">app.latex2numpy.</code><code class="descname">clip_start</code><span class="sig-paren">(</span><em>new_text: list</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.clip_start" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.exp">
<code class="descclassname">app.latex2numpy.</code><code class="descname">exp</code><span class="sig-paren">(</span><em>text: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.exp" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.expand_matrix">
<code class="descclassname">app.latex2numpy.</code><code class="descname">expand_matrix</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.expand_matrix" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Input:</dt>
<dd><p class="first">scope = the list that you are currently working on
index = the index of the element of the list called scope</p>
<blockquote class="last">
<div>that you are currently checking</div></blockquote>
</dd>
<dt>Output:</dt>
<dd>Check if scope is an expanded matrix (with numbers)
and if so, turn that into a numpy matrix
ex - np.matrix([[1, 2], [3, 4]])
See examples: 124</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.exponent">
<code class="descclassname">app.latex2numpy.</code><code class="descname">exponent</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>list_of_names: list</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.exponent" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.fix_caps">
<code class="descclassname">app.latex2numpy.</code><code class="descname">fix_caps</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.fix_caps" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace S S E with SSE</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.frac">
<code class="descclassname">app.latex2numpy.</code><code class="descname">frac</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.frac" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.inject_list">
<code class="descclassname">app.latex2numpy.</code><code class="descname">inject_list</code><span class="sig-paren">(</span><em>index: int</em>, <em>big_list: list</em>, <em>small_list: list</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.inject_list" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.latex2numpy">
<code class="descclassname">app.latex2numpy.</code><code class="descname">latex2numpy</code><span class="sig-paren">(</span><em>latex: str</em><span class="sig-paren">)</span> → str<a class="headerlink" href="#app.latex2numpy.latex2numpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Primary function that transforms latex strings to numpy</p>
<p>Input: latex string from OCR API
Output: numpy formatted string or Error message</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.log">
<code class="descclassname">app.latex2numpy.</code><code class="descname">log</code><span class="sig-paren">(</span><em>text: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.log" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.matrix_multiply">
<code class="descclassname">app.latex2numpy.</code><code class="descname">matrix_multiply</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.matrix_multiply" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Input:</dt>
<dd><p class="first">scope = the list that you are currently working on
index = the index of the element of the list called scope</p>
<blockquote class="last">
<div>that you are currently checking</div></blockquote>
</dd>
<dt>Output:</dt>
<dd>A new list where ‘cdot’ turns into A@B
where A = scope[index-1] and B = scope[index+1]
Note - ‘@’ is recommended over np.dot(A,B)
See examples: 2</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.operator_name">
<code class="descclassname">app.latex2numpy.</code><code class="descname">operator_name</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>operator_flag: bool</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.operator_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert [‘operatorname’, [‘funct_name’], [‘arg1’, ‘arg2’]
into
def funct_name(arg1, arg2):</p>
<blockquote>
<div>pass</div></blockquote>
<p>funct_name(arg1, arg2)</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.organize_functions">
<code class="descclassname">app.latex2numpy.</code><code class="descname">organize_functions</code><span class="sig-paren">(</span><em>text: list</em>, <em>my_functs: dict</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.organize_functions" title="Permalink to this definition">¶</a></dt>
<dd><p>identifies where a function starts and ends
(happens right before the scope is joined together)</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.parse_nested_regex">
<code class="descclassname">app.latex2numpy.</code><code class="descname">parse_nested_regex</code><span class="sig-paren">(</span><em>text</em>, <em>left</em>, <em>right</em>, <em>verbose</em>, <em>delimiter='</em>, <em>'</em><span class="sig-paren">)</span><a class="headerlink" href="#app.latex2numpy.parse_nested_regex" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://stackoverflow.com/a/17141899/190597">https://stackoverflow.com/a/17141899/190597</a> (falsetru)</p>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.recursive_walk">
<code class="descclassname">app.latex2numpy.</code><code class="descname">recursive_walk</code><span class="sig-paren">(</span><em>text: list</em>, <em>iter_var=''</em>, <em>my_functs={}</em>, <em>verbose=False</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.recursive_walk" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.replace_font_format">
<code class="descclassname">app.latex2numpy.</code><code class="descname">replace_font_format</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>verbose=True</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.replace_font_format" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Input:</dt>
<dd><p class="first">scope = the list that you are currently working on
index = the index of the element of the list called scope</p>
<blockquote class="last">
<div>that you are currently checking</div></blockquote>
</dd>
<dt>Output:</dt>
<dd>A new list where math_bf is replaced by <var>_bold where <var> is the variable in proceeding list</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="app.latex2numpy.split_operator">
<code class="descclassname">app.latex2numpy.</code><code class="descname">split_operator</code><span class="sig-paren">(</span><em>element: str</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.split_operator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.sqrt">
<code class="descclassname">app.latex2numpy.</code><code class="descname">sqrt</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.sqrt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.sum_prod_loop">
<code class="descclassname">app.latex2numpy.</code><code class="descname">sum_prod_loop</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.sum_prod_loop" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.latex2numpy.turn_into_var">
<code class="descclassname">app.latex2numpy.</code><code class="descname">turn_into_var</code><span class="sig-paren">(</span><em>scope: list</em>, <em>index: int</em>, <em>iter_var: str</em><span class="sig-paren">)</span> → list<a class="headerlink" href="#app.latex2numpy.turn_into_var" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<span class="target" id="module-app.utils"></span><dl class="function">
<dt id="app.utils.get_mathpix_credentials">
<code class="descclassname">app.utils.</code><code class="descname">get_mathpix_credentials</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.utils.get_mathpix_credentials" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets credentials for mathpix API.</p>
</dd></dl>
<dl class="function">
<dt id="app.utils.upload_to_aws">
<code class="descclassname">app.utils.</code><code class="descname">upload_to_aws</code><span class="sig-paren">(</span><em>local_file</em>, <em>userid</em>, <em>s3_filename</em>, <em>bucket='math2code'</em><span class="sig-paren">)</span><a class="headerlink" href="#app.utils.upload_to_aws" title="Permalink to this definition">¶</a></dt>
<dd><p>Write Image to s3://<bucket>/<bucket_path>.
* Currently not a feature of Application *</p>
</dd></dl>
<span class="target" id="module-app.classes"></span><dl class="class">
<dt id="app.classes.LogInForm">
<em class="property">class </em><code class="descclassname">app.classes.</code><code class="descname">LogInForm</code><span class="sig-paren">(</span><em>formdata=<object object></em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.LogInForm" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="app.classes.LogInForm.password">
<code class="descname">password</code><em class="property"> = <UnboundField(PasswordField, ('Password: ',), {'validators': [<wtforms.validators.DataRequired object>]})></em><a class="headerlink" href="#app.classes.LogInForm.password" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.LogInForm.submit">
<code class="descname">submit</code><em class="property"> = <UnboundField(SubmitField, ('Login',), {})></em><a class="headerlink" href="#app.classes.LogInForm.submit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.LogInForm.username">
<code class="descname">username</code><em class="property"> = <UnboundField(StringField, ('Username: ',), {'validators': [<wtforms.validators.DataRequired object>]})></em><a class="headerlink" href="#app.classes.LogInForm.username" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="app.classes.RegistrationForm">
<em class="property">class </em><code class="descclassname">app.classes.</code><code class="descname">RegistrationForm</code><span class="sig-paren">(</span><em>formdata=<object object></em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.RegistrationForm" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="app.classes.RegistrationForm.email">
<code class="descname">email</code><em class="property"> = <UnboundField(StringField, ('Email: ',), {'validators': [<wtforms.validators.DataRequired object>]})></em><a class="headerlink" href="#app.classes.RegistrationForm.email" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.RegistrationForm.password">
<code class="descname">password</code><em class="property"> = <UnboundField(PasswordField, ('Password: ',), {'validators': [<wtforms.validators.DataRequired object>]})></em><a class="headerlink" href="#app.classes.RegistrationForm.password" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.RegistrationForm.submit">
<code class="descname">submit</code><em class="property"> = <UnboundField(SubmitField, ('Register',), {})></em><a class="headerlink" href="#app.classes.RegistrationForm.submit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.RegistrationForm.username">
<code class="descname">username</code><em class="property"> = <UnboundField(StringField, ('Username: ',), {'validators': [<wtforms.validators.DataRequired object>]})></em><a class="headerlink" href="#app.classes.RegistrationForm.username" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="app.classes.User">
<em class="property">class </em><code class="descclassname">app.classes.</code><code class="descname">User</code><span class="sig-paren">(</span><em>username</em>, <em>email</em>, <em>password</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.User" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="app.classes.User.check_password">
<code class="descname">check_password</code><span class="sig-paren">(</span><em>password</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.User.check_password" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.User.email">
<code class="descname">email</code><a class="headerlink" href="#app.classes.User.email" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.User.id">
<code class="descname">id</code><a class="headerlink" href="#app.classes.User.id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.User.password_hash">
<code class="descname">password_hash</code><a class="headerlink" href="#app.classes.User.password_hash" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="app.classes.User.set_password">
<code class="descname">set_password</code><span class="sig-paren">(</span><em>password</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.User.set_password" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="app.classes.User.username">
<code class="descname">username</code><a class="headerlink" href="#app.classes.User.username" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="function">
<dt id="app.classes.load_user">
<code class="descclassname">app.classes.</code><code class="descname">load_user</code><span class="sig-paren">(</span><em>id</em><span class="sig-paren">)</span><a class="headerlink" href="#app.classes.load_user" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<span class="target" id="module-app.routes"></span><dl class="function">
<dt id="app.routes.about">
<code class="descclassname">app.routes.</code><code class="descname">about</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.about" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.allowed_file">
<code class="descclassname">app.routes.</code><code class="descname">allowed_file</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.allowed_file" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.contact">
<code class="descclassname">app.routes.</code><code class="descname">contact</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.contact" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.home">
<code class="descclassname">app.routes.</code><code class="descname">home</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.home" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.index">
<code class="descclassname">app.routes.</code><code class="descname">index</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.index" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.login">
<code class="descclassname">app.routes.</code><code class="descname">login</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.login" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.logout">
<code class="descclassname">app.routes.</code><code class="descname">logout</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.logout" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.pricing">
<code class="descclassname">app.routes.</code><code class="descname">pricing</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.pricing" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.re_route">
<code class="descclassname">app.routes.</code><code class="descname">re_route</code><span class="sig-paren">(</span><em>e</em><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.re_route" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.register">
<code class="descclassname">app.routes.</code><code class="descname">register</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.register" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="app.routes.welcome">
<code class="descclassname">app.routes.</code><code class="descname">welcome</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#app.routes.welcome" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<span class="target" id="module-tests.conftest"></span><dl class="function">
<dt id="tests.conftest.init_database">
<code class="descclassname">tests.conftest.</code><code class="descname">init_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.conftest.init_database" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="tests.conftest.new_user">
<code class="descclassname">tests.conftest.</code><code class="descname">new_user</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.conftest.new_user" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="tests.conftest.test_client">
<code class="descclassname">tests.conftest.</code><code class="descname">test_client</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.conftest.test_client" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<span class="target" id="module-tests.test_image2latex"></span><dl class="function">
<dt id="tests.test_image2latex.test_img2latex_check_invalid">
<code class="descclassname">tests.test_image2latex.</code><code class="descname">test_img2latex_check_invalid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_image2latex.test_img2latex_check_invalid" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks output for image with an invalid equation</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_image2latex.test_img2latex_check_size">
<code class="descclassname">tests.test_image2latex.</code><code class="descname">test_img2latex_check_size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_image2latex.test_img2latex_check_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks output for image with size > 4 MB</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_image2latex.test_img2latex_check_valid">
<code class="descclassname">tests.test_image2latex.</code><code class="descname">test_img2latex_check_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_image2latex.test_img2latex_check_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks output for image with a valid equation</p>
</dd></dl>
<span class="target" id="module-tests.test_latex2numy"></span><dl class="function">
<dt id="tests.test_latex2numy.test_SSE">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_SSE</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_SSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks variable handling functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_absolute">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_absolute</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_absolute" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks absolute value handling functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_add_multiplier">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_add_multiplier</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_add_multiplier" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks multiplier functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_clip_start">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_clip_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_clip_start" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks clipping functionality for equality sign</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_dot">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_dot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_dot" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks dot product functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_expand_matrix">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_expand_matrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_expand_matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks matrix handling functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_fix_caps">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_fix_caps</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_fix_caps" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks variable handling functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_frac">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_frac</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_frac" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks functionality for fractions</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_log">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_log" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks function for logarithmic transformation</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_operator_name">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_operator_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_operator_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks operator handling functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_split_operator">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_split_operator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_split_operator" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks splitting functionality on pre-defined operators</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_sqrt">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_sqrt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_sqrt" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks square root functionality</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_sum_prod_loop">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_sum_prod_loop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_sum_prod_loop" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the summation and product wrapper functions</p>
</dd></dl>
<dl class="function">
<dt id="tests.test_latex2numy.test_turn_into_var">
<code class="descclassname">tests.test_latex2numy.</code><code class="descname">test_turn_into_var</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tests.test_latex2numy.test_turn_into_var" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks variable conversion functionality</p>
</dd></dl>
<span class="target" id="module-tests.functional.test_routes"></span><p>This file (test_routes.py) contains the functional tests for our application.</p>
<p>These tests use GETs and POSTs to different URLs to check for the proper
behavior of users on our app.</p>
<p>Insipred from the folllowing tutorial:
<a class="reference external" href="https://www.patricksoftwareblog.com/testing-a-flask-application-using-pytest/">https://www.patricksoftwareblog.com/testing-a-flask-application-using-pytest/</a></p>
<dl class="function">
<dt id="tests.functional.test_routes.test_home_page">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_home_page</code><span class="sig-paren">(</span><em>test_client</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_home_page" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/’ page is requested (GET)
THEN check the response is valid</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_invalid_login">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_invalid_login</code><span class="sig-paren">(</span><em>test_client</em>, <em>init_database</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_invalid_login" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/login’ page is posted to with invalid credentials (POST)
THEN check if user goes back to login page</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_invalid_registration">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_invalid_registration</code><span class="sig-paren">(</span><em>test_client</em>, <em>init_database</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_invalid_registration" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/register’ page is posted to with invalid credentials (POST)
THEN check an error message is returned to the user</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_login_page">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_login_page</code><span class="sig-paren">(</span><em>test_client</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_login_page" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/login’ page is requested (GET)
THEN check the response is valid</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_register_page">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_register_page</code><span class="sig-paren">(</span><em>test_client</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_register_page" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/register’ page is requested (GET)
THEN check the response is valid</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_valid_login_logout">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_valid_login_logout</code><span class="sig-paren">(</span><em>test_client</em>, <em>init_database</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_valid_login_logout" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/login’ page is posted to (POST)
THEN check the response is valid</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_valid_registration">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_valid_registration</code><span class="sig-paren">(</span><em>test_client</em>, <em>init_database</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_valid_registration" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/register’ page is posted to (POST)
THEN check the response is valid and the user is redirected to login page</p>
</dd></dl>
<dl class="function">
<dt id="tests.functional.test_routes.test_welcome_page">
<code class="descclassname">tests.functional.test_routes.</code><code class="descname">test_welcome_page</code><span class="sig-paren">(</span><em>test_client</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.functional.test_routes.test_welcome_page" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a Flask application
WHEN the ‘/welcome’ page is requested (GET)
THEN check that the webpage is rendered correctly</p>
</dd></dl>
<span class="target" id="module-tests.unit.test_classes"></span><p>This file (test_classes.py) contains the unit tests for the classes.py file.
Inspired from this tutorial :
<a class="reference external" href="https://www.patricksoftwareblog.com/testing-a-flask-application-using-pytest/">https://www.patricksoftwareblog.com/testing-a-flask-application-using-pytest/</a></p>
<dl class="function">
<dt id="tests.unit.test_classes.test_new_user">
<code class="descclassname">tests.unit.test_classes.</code><code class="descname">test_new_user</code><span class="sig-paren">(</span><em>new_user</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.unit.test_classes.test_new_user" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN a User model
WHEN a new User is created
THEN check the email and password_hash fields are defined correctly</p>
</dd></dl>
<dl class="function">
<dt id="tests.unit.test_classes.test_setting_password">
<code class="descclassname">tests.unit.test_classes.</code><code class="descname">test_setting_password</code><span class="sig-paren">(</span><em>new_user</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.unit.test_classes.test_setting_password" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN an existing User
WHEN the password for the user is set
THEN check the password is stored correctly and not as plaintext</p>
</dd></dl>
<dl class="function">
<dt id="tests.unit.test_classes.test_user_id">
<code class="descclassname">tests.unit.test_classes.</code><code class="descname">test_user_id</code><span class="sig-paren">(</span><em>new_user</em><span class="sig-paren">)</span><a class="headerlink" href="#tests.unit.test_classes.test_user_id" title="Permalink to this definition">¶</a></dt>
<dd><p>GIVEN an existing User
WHEN the ID of the user is defined to a value
THEN check the user ID returns a string (and not an integer) as needed by</p>
<blockquote>
<div>Flask-WTF</div></blockquote>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">Math2Code</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="authors.html">Authors</a></li>
<li class="toctree-l1"><a class="reference internal" href="requirements.html">Required Libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Basic Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">API Reference</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Math2Code’s Documentation</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="api.html" title="previous chapter">API Reference</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2020, Ariana Moncada, Michael Schulze, Shishir Kumar, Jingwen Yu, Mundy Otto Reimer, Nithish Bolleddula, Qingmengting Wang, Roja Immanni, Zachary Barnes.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.5</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/code.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>