Spaces:
Running
Running
calendar added
Browse files- marimo/app.py +34 -2
- marimo/calendar.html +152 -0
- marimo/index.html +21 -10
- marimo/pdfs/LabManualCHEM2000-1.pdf +2 -2
marimo/app.py
CHANGED
|
@@ -5,7 +5,6 @@ from fastapi import FastAPI, Form, Request, Response
|
|
| 5 |
import os
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
-
|
| 9 |
# Create a FastAPI app
|
| 10 |
app = FastAPI()
|
| 11 |
|
|
@@ -37,7 +36,40 @@ async def download_pdf(pdf_name: str):
|
|
| 37 |
media_type='application/pdf',
|
| 38 |
filename=pdf_name
|
| 39 |
)
|
| 40 |
-
return {"error": f"PDF not found [.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
# Mount the marimo server at the root
|
| 43 |
# This will handle all the routes defined in the marimo server
|
|
|
|
| 5 |
import os
|
| 6 |
from pathlib import Path
|
| 7 |
|
|
|
|
| 8 |
# Create a FastAPI app
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
| 36 |
media_type='application/pdf',
|
| 37 |
filename=pdf_name
|
| 38 |
)
|
| 39 |
+
return {"error": f"PDF not found [./pdfs/{pdf_name}]"}, 404
|
| 40 |
+
|
| 41 |
+
@app.get("/calendar", response_class=HTMLResponse)
|
| 42 |
+
async def read_root():
|
| 43 |
+
with open('calendar.html', 'r', encoding='utf-8') as f:
|
| 44 |
+
return f.read()
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
## Custom route to serve HTML files that open in a new tab
|
| 48 |
+
#@app.route("/html/<filename>")
|
| 49 |
+
#def serve_html_file(filename):
|
| 50 |
+
# # Define the directory where your HTML files are stored
|
| 51 |
+
# # This assumes they're in a folder named 'html_files' in the same directory as your app
|
| 52 |
+
# html_dir = Path(os.path.dirname(os.path.abspath(__file__))) / "html_files"
|
| 53 |
+
#
|
| 54 |
+
# # Construct the full path to the requested HTML file
|
| 55 |
+
# file_path = html_dir / filename
|
| 56 |
+
#
|
| 57 |
+
# # Check if the file exists
|
| 58 |
+
# if not file_path.exists():
|
| 59 |
+
# return "File not found", 404
|
| 60 |
+
#
|
| 61 |
+
# # Read the HTML content
|
| 62 |
+
# with open(file_path, "r") as f:
|
| 63 |
+
# html_content = f.read()
|
| 64 |
+
#
|
| 65 |
+
# # Set response headers to allow the content to be displayed in the browser
|
| 66 |
+
# headers = {
|
| 67 |
+
# "Content-Type": "text/html",
|
| 68 |
+
# "Content-Disposition": "inline" # This ensures it displays in browser rather than downloading
|
| 69 |
+
# }
|
| 70 |
+
#
|
| 71 |
+
# return html_content, 200, headers
|
| 72 |
+
|
| 73 |
|
| 74 |
# Mount the marimo server at the root
|
| 75 |
# This will handle all the routes defined in the marimo server
|
marimo/calendar.html
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Course Calendar</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
line-height: 1.6;
|
| 11 |
+
max-width: 800px;
|
| 12 |
+
margin: 0 auto;
|
| 13 |
+
padding: 20px;
|
| 14 |
+
}
|
| 15 |
+
h1, h2, h3 {
|
| 16 |
+
color: #333;
|
| 17 |
+
}
|
| 18 |
+
.calendar {
|
| 19 |
+
text-align: center;
|
| 20 |
+
width: 85%;
|
| 21 |
+
margin: 0 auto;
|
| 22 |
+
}
|
| 23 |
+
.week-item {
|
| 24 |
+
margin-bottom: 10px;
|
| 25 |
+
padding: 5px;
|
| 26 |
+
border-left: 3px solid #ddd;
|
| 27 |
+
padding-left: 10px;
|
| 28 |
+
}
|
| 29 |
+
.week-label {
|
| 30 |
+
font-weight: bold;
|
| 31 |
+
}
|
| 32 |
+
.intro {
|
| 33 |
+
color: olive;
|
| 34 |
+
font-weight: bold;
|
| 35 |
+
}
|
| 36 |
+
.lab {
|
| 37 |
+
color: blue;
|
| 38 |
+
font-weight: bold;
|
| 39 |
+
}
|
| 40 |
+
.drop-in {
|
| 41 |
+
color: orange;
|
| 42 |
+
font-weight: bold;
|
| 43 |
+
}
|
| 44 |
+
.none {
|
| 45 |
+
color: teal;
|
| 46 |
+
font-weight: bold;
|
| 47 |
+
}
|
| 48 |
+
.due-date {
|
| 49 |
+
color: red;
|
| 50 |
+
font-weight: bold;
|
| 51 |
+
display: block;
|
| 52 |
+
margin-top: 5px;
|
| 53 |
+
}
|
| 54 |
+
.assessment {
|
| 55 |
+
color: red;
|
| 56 |
+
font-weight: bold;
|
| 57 |
+
}
|
| 58 |
+
.holiday-list {
|
| 59 |
+
margin-top: 20px;
|
| 60 |
+
}
|
| 61 |
+
</style>
|
| 62 |
+
</head>
|
| 63 |
+
<body>
|
| 64 |
+
<h1>Calendar</h1>
|
| 65 |
+
|
| 66 |
+
<div class="calendar">
|
| 67 |
+
<div class="week-item">
|
| 68 |
+
<span class="week-label">Week 1 β </span>
|
| 69 |
+
<span class="intro">Introduction and refresher of statistics</span>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<div class="week-item">
|
| 73 |
+
<span class="week-label">Week 2 β </span>
|
| 74 |
+
<span class="lab">Basic statistics numerical laboratory</span>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div class="week-item">
|
| 78 |
+
<span class="week-label">Week 3 β </span>
|
| 79 |
+
<span class="drop-in">Drop-in session</span>
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<div class="week-item">
|
| 83 |
+
<span class="week-label">Week 4 β </span>
|
| 84 |
+
<span class="lab">Bomb calorimetry numerical laboratory</span>
|
| 85 |
+
<span class="due-date">First lab report due</span>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<div class="week-item">
|
| 89 |
+
<span class="week-label">Week 5 β </span>
|
| 90 |
+
<span class="drop-in">Drop-in session</span>
|
| 91 |
+
</div>
|
| 92 |
+
|
| 93 |
+
<div class="week-item">
|
| 94 |
+
<span class="week-label">Week 6 β </span>
|
| 95 |
+
<span class="none">No lab</span>
|
| 96 |
+
<span class="due-date">Second lab report due</span>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<div class="week-item">
|
| 100 |
+
<span class="week-label">Week 7 β </span>
|
| 101 |
+
<span class="assessment">Progressive assessment</span>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<div class="week-item">
|
| 105 |
+
<span class="week-label">Week 8 β </span>
|
| 106 |
+
<span class="lab">Crystal violet numerical laboratory</span>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<div class="week-item">
|
| 110 |
+
<span class="week-label">Week 9 β </span>
|
| 111 |
+
<span style="font-weight: bold;">Tuition free week</span>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<div class="week-item">
|
| 115 |
+
<span class="week-label">Week 10 β </span>
|
| 116 |
+
<span class="lab">Chemical equilibrium numerical laboratory</span>
|
| 117 |
+
<span class="due-date">Third lab report due</span>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<div class="week-item">
|
| 121 |
+
<span class="week-label">Week 11 β </span>
|
| 122 |
+
<span class="drop-in">Drop-in session</span>
|
| 123 |
+
</div>
|
| 124 |
+
|
| 125 |
+
<div class="week-item">
|
| 126 |
+
<span class="week-label">Week 12 β </span>
|
| 127 |
+
<span class="lab">Surface adsorption numerical laboratory</span>
|
| 128 |
+
<span class="due-date">Fourth lab report due</span>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div class="week-item">
|
| 132 |
+
<span class="week-label">Week 13 β </span>
|
| 133 |
+
<span class="drop-in">Drop-in session</span>
|
| 134 |
+
</div>
|
| 135 |
+
|
| 136 |
+
<div class="week-item">
|
| 137 |
+
<span class="week-label">Week 14 β </span>
|
| 138 |
+
<span class="none">Study week</span>
|
| 139 |
+
<span class="due-date">Fifth lab report due</span>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<h3>Public holidays</h3>
|
| 144 |
+
<ul class="holiday-list">
|
| 145 |
+
<li>2<sup>nd</sup> March β Labour Day</li>
|
| 146 |
+
<li>18<sup>th</sup> April β Good Friday</li>
|
| 147 |
+
<li>21<sup>st</sup> April β Easter Monday</li>
|
| 148 |
+
<li>22<sup>nd</sup> April β Easter Tuesday</li>
|
| 149 |
+
<li>25<sup>th</sup> April β Anzac Day</li>
|
| 150 |
+
</ul>
|
| 151 |
+
</body>
|
| 152 |
+
</html>
|
marimo/index.html
CHANGED
|
@@ -8,9 +8,9 @@
|
|
| 8 |
body {
|
| 9 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
| 10 |
line-height: 1.6;
|
| 11 |
-
max-width:
|
| 12 |
margin: 0 auto;
|
| 13 |
-
padding:
|
| 14 |
color: #333;
|
| 15 |
}
|
| 16 |
|
|
@@ -52,7 +52,7 @@
|
|
| 52 |
}
|
| 53 |
.lab-grid {
|
| 54 |
display: grid;
|
| 55 |
-
grid-template-columns: repeat(auto-fit, minmax(
|
| 56 |
gap: 20px;
|
| 57 |
margin: 20px 0;
|
| 58 |
}
|
|
@@ -99,32 +99,43 @@
|
|
| 99 |
<p style="text-align: center">Version 1 - 20/02/2025</p>
|
| 100 |
</a>
|
| 101 |
<a href="/download-pdf/python_primer.pdf" class="lab-card">
|
| 102 |
-
<h3 style="text-align: center">A
|
| 103 |
<p style="text-align: center">Version 1 - 20/02/2025</p>
|
| 104 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
<a href="/stats" class="lab-card">
|
| 106 |
-
<h3 style="text-align: center">Statistics</h3>
|
| 107 |
<p style="text-align: center">Basic statistical concepts and Python introduction<br>(Week 2)</p>
|
| 108 |
</a>
|
| 109 |
<a href="/bc" class="lab-card">
|
| 110 |
-
<h3 style="text-align: center">Bomb Calorimetry</h3>
|
| 111 |
<p style="text-align: center">Thermodynamics and heat measurements<br>(Week 4)</p>
|
| 112 |
</a>
|
| 113 |
<a href="/cv" class="lab-card">
|
| 114 |
-
<h3 style="text-align: center">Crystal Violet</h3>
|
| 115 |
<p style="text-align: center">Chemical kinetics and reaction rates<br>(Week 8)</p>
|
| 116 |
</a>
|
| 117 |
<a href="/eq" class="lab-card">
|
| 118 |
-
<h3 style="text-align: center">Chemical Equilibrium</h3>
|
| 119 |
<p style="text-align: center">Numerical solution of equilibrium problems<br>(Week 10)</p>
|
| 120 |
</a>
|
| 121 |
<a href="/surface" class="lab-card">
|
| 122 |
-
<h3 style="text-align: center">Surface Adsorption</h3>
|
| 123 |
<p style="text-align: center">Equilibrium and surface chemistry<br>(Week 12)</p>
|
| 124 |
</a>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
-
<h2 style="text-align: center"><strong>Check the
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
<p>This web page and those linked below have been created with Python using Jupyter Notebooks and will be used to develop important skills in data analysis, data processing, and computing using simulated experimental results and computational chemistry software.</p>
|
| 130 |
|
|
|
|
| 8 |
body {
|
| 9 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
| 10 |
line-height: 1.6;
|
| 11 |
+
max-width: 1200px;
|
| 12 |
margin: 0 auto;
|
| 13 |
+
padding: 10px;
|
| 14 |
color: #333;
|
| 15 |
}
|
| 16 |
|
|
|
|
| 52 |
}
|
| 53 |
.lab-grid {
|
| 54 |
display: grid;
|
| 55 |
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
| 56 |
gap: 20px;
|
| 57 |
margin: 20px 0;
|
| 58 |
}
|
|
|
|
| 99 |
<p style="text-align: center">Version 1 - 20/02/2025</p>
|
| 100 |
</a>
|
| 101 |
<a href="/download-pdf/python_primer.pdf" class="lab-card">
|
| 102 |
+
<h3 style="text-align: center">A Python Primer<br>(Download PDF)</h3>
|
| 103 |
<p style="text-align: center">Version 1 - 20/02/2025</p>
|
| 104 |
</a>
|
| 105 |
+
<a href="/calendar" class="lab-card" >
|
| 106 |
+
<h3 style="text-align: center">Calendar</h3>
|
| 107 |
+
<p style="text-align: center">Lab schedule and deadlines<br>(2025)</p>
|
| 108 |
+
</a>
|
| 109 |
+
</div>
|
| 110 |
+
<hr style="width: 80%; height: 2px; background-color: #333; border: none;">
|
| 111 |
+
<div class="lab-grid">
|
| 112 |
<a href="/stats" class="lab-card">
|
| 113 |
+
<h3 style="text-align: center">Statistics Lab</h3>
|
| 114 |
<p style="text-align: center">Basic statistical concepts and Python introduction<br>(Week 2)</p>
|
| 115 |
</a>
|
| 116 |
<a href="/bc" class="lab-card">
|
| 117 |
+
<h3 style="text-align: center">Bomb Calorimetry Lab</h3>
|
| 118 |
<p style="text-align: center">Thermodynamics and heat measurements<br>(Week 4)</p>
|
| 119 |
</a>
|
| 120 |
<a href="/cv" class="lab-card">
|
| 121 |
+
<h3 style="text-align: center">Crystal Violet Lab</h3>
|
| 122 |
<p style="text-align: center">Chemical kinetics and reaction rates<br>(Week 8)</p>
|
| 123 |
</a>
|
| 124 |
<a href="/eq" class="lab-card">
|
| 125 |
+
<h3 style="text-align: center">Chemical Equilibrium Lab</h3>
|
| 126 |
<p style="text-align: center">Numerical solution of equilibrium problems<br>(Week 10)</p>
|
| 127 |
</a>
|
| 128 |
<a href="/surface" class="lab-card">
|
| 129 |
+
<h3 style="text-align: center">Surface Adsorption Lab</h3>
|
| 130 |
<p style="text-align: center">Equilibrium and surface chemistry<br>(Week 12)</p>
|
| 131 |
</a>
|
| 132 |
</div>
|
| 133 |
|
| 134 |
+
<h2 style="text-align: center"><strong>Check the calendar for when the reports are due</strong></h2>
|
| 135 |
+
|
| 136 |
+
<hr style="width: 80%; height: 2px; background-color: #333; border: none;">
|
| 137 |
+
|
| 138 |
+
<h2>Introduction</h2>
|
| 139 |
|
| 140 |
<p>This web page and those linked below have been created with Python using Jupyter Notebooks and will be used to develop important skills in data analysis, data processing, and computing using simulated experimental results and computational chemistry software.</p>
|
| 141 |
|
marimo/pdfs/LabManualCHEM2000-1.pdf
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5aa4e64457f5adeff33842bbaa0a7ff2bbb7c52b4a4af644e7b7ef24cf7b561
|
| 3 |
+
size 4779264
|