Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break WS2 test graphs into a graph per site #50

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ FodyWeavers.xsd
/TestGraphs/.ipynb_checkpoints/ResidueSensibilityGraphs-checkpoint.ipynb

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

Expand Down Expand Up @@ -424,7 +423,6 @@ cover/
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
Expand Down Expand Up @@ -527,10 +525,37 @@ cython_debug/
#.idea/

.DS_Store
.cache
.idea
serve

.hydra
!html/*
!index.*.png
!index.*.png
/TestGraphs/html/index.001.png
/TestGraphs/html/index.002.png
/TestGraphs/html/index.003.png
/TestGraphs/html/index.004.png
/TestGraphs/html/index.005.png
/TestGraphs/html/index.006.png
/TestGraphs/html/index.007.png
/TestGraphs/html/index.008.png
/TestGraphs/html/index.009.png
/TestGraphs/html/index.010.png
/TestGraphs/html/index.011.png
/TestGraphs/html/index.012.png
/TestGraphs/html/index.013.png
/TestGraphs/html/index.014.png
/TestGraphs/html/index.015.png
/TestGraphs/html/index.016.png
/TestGraphs/html/index.017.png
/TestGraphs/html/index.018.png
/TestGraphs/html/index.019.png
/TestGraphs/html/index.020.png
/TestGraphs/html/index.021.png
/TestGraphs/html/index.022.png
/TestGraphs/html/index.023.png
/TestGraphs/html/index.024.png
/TestGraphs/html/index.025.png
/TestGraphs/html/index.026.png
/TestGraphs/html/index.027.png
/TestGraphs/html/index.html
585 changes: 456 additions & 129 deletions TestGraphs/MakeGraphs/.ipynb_checkpoints/WS2-checkpoint.ipynb

Large diffs are not rendered by default.

138 changes: 109 additions & 29 deletions TestGraphs/MakeGraphs/WS2.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions TestGraphs/MakeGraphs/WS2.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@

# +
colors = ['orange','green']
Graph = plt.figure(figsize=(10,100))
pos = 1
row_num=len(tests)

for s in range(1,10):
Graph = plt.figure(figsize=(10,15))
testsAtSite = TestsFrame.loc[s,'crop'].values
row_num=len(testsAtSite)
pos = 1
for t in testsAtSite: #['1Gra-A']:#tests:
site = t[0]
site = int(site)
Expand All @@ -218,8 +218,8 @@
plt.legend()
pos+=1
c+=1
Graph.tight_layout(pad=1.5)
plt.savefig(os.path.join(outPath, "TimeCourse.png"))
Graph.tight_layout(pad=1.5)
plt.savefig(os.path.join(outPath, "WS2 Site "+str(s) +".png"))


# +
Expand Down
90 changes: 49 additions & 41 deletions TestGraphs/report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,71 @@
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"id": "c6317285-bf98-489f-a858-44925c83f9c3",
"metadata": {
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"report Started\n"
]
},
{
"data": {
"text/plain": [
"<aspose.words.saving.SaveOutputParameters object at 0x000001DF6232B5F0>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import os\n",
"import aspose.words as aw\n",
"import os.path as osp\n",
"from glob import glob\n",
"from pathlib import Path\n",
"\n",
"def main():\n",
" try: \n",
" if os.environ[\"GITHUB_WORKSPACE\"] != None:\n",
" root = os.environ[\"GITHUB_WORKSPACE\"]\n",
" inPath = os.path.join(root, \"TestGraphs\", \"Outputs\")\n",
" \n",
" except: \n",
" rootfrags = os.path.abspath('WS2.py').split(\"\\\\\")\n",
" root = \"\"\n",
" for d in rootfrags:\n",
" if d == \"FieldNBalance\":\n",
" break\n",
" else:\n",
" root += d + \"\\\\\"\n",
" inPath = os.path.join(root,\"FieldNBalance\",\"TestGraphs\", \"Outputs\") \n",
" \n",
" if not osp.isdir(inPath):\n",
" raise FileNotFoundError(f\"Directory does not exist: {inPath}\")\n",
" \n",
" imgs = glob(osp.join(inPath, \"*.png\"))\n",
" if len(imgs) == 0:\n",
" raise FileNotFoundError(f\"No images found in directory: {inPath}\")\n",
"print(\"report Started\")\n",
"try: \n",
" if os.environ[\"GITHUB_WORKSPACE\"] != None:\n",
" root = os.environ[\"GITHUB_WORKSPACE\"]\n",
" inPath = os.path.join(root, \"TestGraphs\", \"Outputs\")\n",
"\n",
"except: \n",
" rootfrags = os.path.abspath('WS2.py').split(\"\\\\\")\n",
" root = \"\"\n",
" for d in rootfrags:\n",
" if d == \"FieldNBalance\":\n",
" break\n",
" else:\n",
" root += d + \"\\\\\"\n",
" inPath = os.path.join(root,\"FieldNBalance\",\"TestGraphs\", \"Outputs\") \n",
" \n",
" doc = aw.Document()\n",
" builder = aw.DocumentBuilder(doc)\n",
"\n",
" for img in imgs:\n",
" builder.insert_image(img)\n",
"if not osp.isdir(inPath):\n",
" raise FileNotFoundError(f\"Directory does not exist: {inPath}\")\n",
"\n",
"imgs = glob(osp.join(inPath, \"*.png\"))\n",
"if len(imgs) == 0:\n",
" raise FileNotFoundError(f\"No images found in directory: {inPath}\")\n",
"\n",
" outdir = \"html\"\n",
" Path(outdir).mkdir(parents=True, exist_ok=True) \n",
" doc.save(osp.join(outdir, \"index.html\"))\n",
"doc = aw.Document()\n",
"builder = aw.DocumentBuilder(doc)\n",
"\n",
"if __name__ == \"__main__\":\n",
" main()"
"for img in imgs:\n",
" builder.insert_image(img)\n",
"\n",
"outdir = \"html\"\n",
"Path(outdir).mkdir(parents=True, exist_ok=True) \n",
"doc.save(osp.join(outdir, \"index.html\"))\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f3ac9d83-1a3d-4c2f-b329-0e91215fc21f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
60 changes: 28 additions & 32 deletions TestGraphs/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,37 @@
from glob import glob
from pathlib import Path

def main():
try:
if os.environ["GITHUB_WORKSPACE"] != None:
root = os.environ["GITHUB_WORKSPACE"]
inPath = os.path.join(root, "TestGraphs", "Outputs")

except:
rootfrags = os.path.abspath('WS2.py').split("\\")
root = ""
for d in rootfrags:
if d == "FieldNBalance":
break
else:
root += d + "\\"
inPath = os.path.join(root,"FieldNBalance","TestGraphs", "Outputs")

if not osp.isdir(inPath):
raise FileNotFoundError(f"Directory does not exist: {inPath}")

imgs = glob(osp.join(inPath, "*.png"))
if len(imgs) == 0:
raise FileNotFoundError(f"No images found in directory: {inPath}")
print("report Started")
try:
if os.environ["GITHUB_WORKSPACE"] != None:
root = os.environ["GITHUB_WORKSPACE"]
inPath = os.path.join(root, "TestGraphs", "Outputs")

except:
rootfrags = os.path.abspath('WS2.py').split("\\")
root = ""
for d in rootfrags:
if d == "FieldNBalance":
break
else:
root += d + "\\"
inPath = os.path.join(root,"FieldNBalance","TestGraphs", "Outputs")

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

for img in imgs:
builder.insert_image(img)
if not osp.isdir(inPath):
raise FileNotFoundError(f"Directory does not exist: {inPath}")

imgs = glob(osp.join(inPath, "*.png"))
if len(imgs) == 0:
raise FileNotFoundError(f"No images found in directory: {inPath}")

outdir = "html"
Path(outdir).mkdir(parents=True, exist_ok=True)
doc.save(osp.join(outdir, "index.html"))
doc = aw.Document()
builder = aw.DocumentBuilder(doc)

if __name__ == "__main__":
main()
# -
for img in imgs:
builder.insert_image(img)

outdir = "html"
Path(outdir).mkdir(parents=True, exist_ok=True)
doc.save(osp.join(outdir, "index.html"))

Loading