Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83477982
test_math_helper.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 17, 08:54
Size
648 B
Mime Type
text/x-python
Expires
Thu, Sep 19, 08:54 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20845088
Attached To
R3683 Slides
test_math_helper.py
View Options
#!/bin/env python3
# -*- coding: utf-8 -*-
from
Slides
import
math_helper
as
mh
import
numpy
as
np
from
sympy
import
Matrix
import
subprocess
import
os
tests_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
def
test_print_colored_matrix
():
mh
.
init_printing
()
a
=
Matrix
(
np
.
zeros
((
2
,
2
)))
a
=
mh
.
ColoredMatrix
(
a
)
mh
.
print_latex
(
'{0}'
,
a
)
def
test_jupyter_notebook
():
file_path
=
os
.
path
.
join
(
tests_path
,
"math_test.ipynb"
)
ret
=
subprocess
.
call
(
"jupyter nbconvert --to notebook "
f
"--execute {file_path}"
,
shell
=
True
)
if
ret
:
raise
RuntimeError
(
"could not execute the notebook"
)
Event Timeline
Log In to Comment