config and helpers
This commit is contained in:
parent
c7ae0776a5
commit
fdc39cd862
@ -2,7 +2,7 @@
|
||||
# Learn more at https://jupyterbook.org/customize/config.html
|
||||
|
||||
title: Physics-based Deep Learning
|
||||
author: Thuerey et al.
|
||||
author: N. Thuerey, P. Holl, M. Mueller, P. Schnell, F. Trost, K. Um
|
||||
logo: resources/logo.jpg
|
||||
|
||||
# Force re-execution of notebooks on each build.
|
||||
|
4
intro.md
4
intro.md
@ -81,12 +81,12 @@ This project would not have been possible without the help of many people who co
|
||||
|
||||
If you find this book useful, please cite it via:
|
||||
```
|
||||
@article{thuerey2021pbdl,
|
||||
@book{thuerey2021pbdl,
|
||||
title={Physics-based Deep Learning},
|
||||
author={Nils Thuerey and Philipp Holl and Maximilian Mueller and Patrick Schnell and Felix Trost and Kiwon Um},
|
||||
url={http://physicsbaseddeeplearning.org},
|
||||
year={2021},
|
||||
publisher={www}
|
||||
publisher={WWW}
|
||||
}
|
||||
```
|
||||
|
||||
|
41
json-ipynb-removeImgs.py
Normal file
41
json-ipynb-removeImgs.py
Normal file
@ -0,0 +1,41 @@
|
||||
import json
|
||||
|
||||
fnOut="temp_reduced.txt"
|
||||
|
||||
#fn="t.json"
|
||||
fn="temp.txt"
|
||||
with open(fn) as file:
|
||||
d = json.load(file)
|
||||
|
||||
print(d.keys())
|
||||
#print(d["cells"][0].keys())
|
||||
|
||||
t="cells"
|
||||
for i in range(len(d[t])):
|
||||
#for i in range(len(d[t])):
|
||||
#print(d[t][0]["cell_type"])
|
||||
#print(d[t][i]["cell_type"])
|
||||
|
||||
# remove images after code
|
||||
|
||||
if d[t][i]["cell_type"]=="code":
|
||||
#print(d[t][i].keys())
|
||||
#d[t][i]["outputs"] = ""
|
||||
#print(d[t][i]["outputs"])
|
||||
|
||||
#print(len( d[t][i]["outputs"] ))
|
||||
for j in range(len( d[t][i]["outputs"] )):
|
||||
#print(type( d[t][i]["outputs"][j] ))
|
||||
print( d[t][i]["outputs"][j].keys() )
|
||||
if d[t][i]["outputs"][j]["output_type"]=="display_data":
|
||||
#if d[t][i]["outputs"][j]["data"]=="display_data":
|
||||
print( d[t][i]["outputs"][j]["data"].keys() )
|
||||
#if( d[t][i]["outputs"][j]["data"].contains('image/png') ):
|
||||
if( 'image/png' in d[t][i]["outputs"][j]["data"].keys() ):
|
||||
d[t][i]["outputs"][j]["data"]['image/png'] = ""
|
||||
|
||||
#print(d["cells"])
|
||||
|
||||
with open(fnOut,'w') as fileOut:
|
||||
json.dump(d,fileOut, indent=1, sort_keys=True)
|
||||
|
Loading…
Reference in New Issue
Block a user