fixing commit, only json script
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
import json, re, os
|
import json, re, os
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fileList = [
|
fileList = [
|
||||||
"diffphys-code-burgers.ipynb", "diffphys-code-sol.ipynb", "physicalloss-code.ipynb", # TF
|
"diffphys-code-burgers.ipynb", "diffphys-code-sol.ipynb", "physicalloss-code.ipynb", # TF
|
||||||
"bayesian-code.ipynb", "supervised-airfoils.ipynb" # pytorch
|
"bayesian-code.ipynb", "supervised-airfoils.ipynb" # pytorch
|
||||||
]
|
]
|
||||||
|
|
||||||
|
fileList = [ "diffphys-code-burgers.ipynb"] # debug
|
||||||
|
|
||||||
|
# shorten "0.008612174447657694, 0.02584669669548606, 0.043136357266407785"
|
||||||
|
|
||||||
for fnOut in fileList:
|
for fnOut in fileList:
|
||||||
fn = fnOut[:-5] + "bak"
|
fn = fnOut[:-5] + "bak"
|
||||||
print("renaming "+fnOut+ " to "+fn )
|
print("renaming "+fnOut+ " to "+fn )
|
||||||
@@ -26,6 +32,8 @@ for fnOut in fileList:
|
|||||||
|
|
||||||
re1 = re.compile(r"WARNING:tensorflow:")
|
re1 = re.compile(r"WARNING:tensorflow:")
|
||||||
re2 = re.compile(r"UserWarning:")
|
re2 = re.compile(r"UserWarning:")
|
||||||
|
re3 = re.compile(r"\[0.008612174447657694, 0.02584669669548606, 0.043136357266407785.+\]" )
|
||||||
|
re3t = "[0.008612174447657694, 0.02584669669548606, 0.043136357266407785 ... ]"
|
||||||
|
|
||||||
t="cells"
|
t="cells"
|
||||||
okay = 0
|
okay = 0
|
||||||
@@ -42,6 +50,14 @@ for fnOut in fileList:
|
|||||||
#d[t][i]["outputs"] = ""
|
#d[t][i]["outputs"] = ""
|
||||||
#print(d[t][i]["outputs"])
|
#print(d[t][i]["outputs"])
|
||||||
|
|
||||||
|
for j in range(len( d[t][i]["source"] )):
|
||||||
|
#print( d[t][i]["source"][j] )
|
||||||
|
#print( type(d[t][i]["source"][j] ))
|
||||||
|
dsOut = re3.sub( re3t, d[t][i]["source"][j] ) # replace long number string (only for burgers)
|
||||||
|
d[t][i]["source"][j] = dsOut
|
||||||
|
deletes = deletes+1
|
||||||
|
#print( d[t][i]["source"][j] +"\n >>> \n" +d2 )
|
||||||
|
|
||||||
#print(len( d[t][i]["outputs"] ))
|
#print(len( d[t][i]["outputs"] ))
|
||||||
for j in range(len( d[t][i]["outputs"] )):
|
for j in range(len( d[t][i]["outputs"] )):
|
||||||
#print(type( d[t][i]["outputs"][j] ))
|
#print(type( d[t][i]["outputs"][j] ))
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ python3.7 json-cleanup-for-pdf.py
|
|||||||
|
|
||||||
|
|
||||||
cd _build/latex
|
cd _build/latex
|
||||||
|
mv book.pdf book-xetex.pdf
|
||||||
|
|
||||||
rm -f book-in.tex sphinxmessages-in.sty book-in.aux book-in.toc
|
rm -f book-in.tex sphinxmessages-in.sty book-in.aux book-in.toc
|
||||||
mv book.tex book-in.tex
|
mv book.tex book-in.tex
|
||||||
|
|||||||
Reference in New Issue
Block a user