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

Add support for multi-run graphing in ilab / Crucible backend #120

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4094cc9
Add ILAB / Crucible support to CPT backend
dbutenhof Aug 21, 2024
e6c8ee0
UI code updates
MVarshini Sep 23, 2024
5e735a7
Improve periodic graph names.
dbutenhof Sep 23, 2024
505903b
Documentation and cleanup
dbutenhof Sep 30, 2024
4ccd603
Allow overriding graph color
dbutenhof Oct 1, 2024
de0accc
Some (self) review cleanup
dbutenhof Oct 3, 2024
ad48906
Move periods query to action/reducer
dbutenhof Oct 3, 2024
5671d77
Cleanup OpenSearch connections
dbutenhof Oct 4, 2024
a49fc65
Try to remove a couple of incidental changes
dbutenhof Oct 7, 2024
1d5783d
Undoing a few more ancillary changes
dbutenhof Oct 7, 2024
f20e45d
Review feedback
dbutenhof Oct 9, 2024
a959fe6
Pagination and Date filter issue
MVarshini Oct 10, 2024
79151ea
Rewrite param consolidation
dbutenhof Oct 10, 2024
8b75d5f
Add framework for UI multi-run comparison
dbutenhof Oct 9, 2024
c8cd597
Some UI cleanup
dbutenhof Oct 10, 2024
3b0b190
Debug unhandled exceptions
dbutenhof Oct 11, 2024
b32a606
Fix multigraph bug
dbutenhof Oct 11, 2024
2148311
Support for per-iteration parameters.
dbutenhof Oct 11, 2024
312eebf
comparison
MVarshini Oct 11, 2024
0d7592a
render graph
MVarshini Oct 15, 2024
e056d62
Pagination for Graphs
MVarshini Oct 15, 2024
659d820
Support relative timescale graphs
dbutenhof Oct 15, 2024
e25b82e
pagination data
MVarshini Oct 15, 2024
993a4fe
Multi run comparison adjustments
dbutenhof Oct 17, 2024
de38738
A few tweaks
dbutenhof Oct 17, 2024
25fe58f
closing of graph accordion
MVarshini Oct 18, 2024
eed488f
Adjustments
dbutenhof Oct 18, 2024
606f468
conflict resolve
MVarshini Oct 18, 2024
e755221
multiple APIs to fetch periods and icon to display more info
MVarshini Oct 18, 2024
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
Prev Previous commit
Next Next commit
Multi run comparison adjustments
  • Loading branch information
dbutenhof committed Oct 17, 2024
commit 993a4fe2380c6694a46b797ecbd22c994638882d
24 changes: 2 additions & 22 deletions backend/app/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import typing

from fastapi import FastAPI, HTTPException, Request
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse
import orjson
Expand All @@ -21,25 +21,6 @@ def render(self, content: typing.Any) -> bytes:
"localhost:3000"
]


async def report_exceptions(request: Request, e: Exception):
if isinstance(e, HTTPException):
raise
tb = e.__traceback__
print(f"Unhandled exception {e.__class__.__name__}: {str(e)}")
where = "unknown"
while tb is not None:
where = f"{tb.tb_frame.f_code.co_filename}:{tb.tb_lineno}"
print(
f" {where} {tb.tb_frame.f_code.co_name}",
file=sys.stderr,
)
tb = tb.tb_next
return JSONResponse(
status_code=500,
content={"detail": f"Unhandled server error at {where}: {str(e)}"},
)

app = FastAPI(default_response_class=ORJSONResponse,
docs_url="/docs",
redoc_url=None,
Expand All @@ -52,8 +33,7 @@ async def report_exceptions(request: Request, e: Exception):
license_info={
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0",
},
exception_handlers={Exception: report_exceptions})
})

app.add_middleware(
CORSMiddleware,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const IlabCompareComponent = () => {
itemId={item.id}
isSelected={selectedItems.includes(item.id)}
>
{item.primary_metrics[0]}
{`${new Date(item.begin_date).toLocaleDateString()} ${item.primary_metrics[0]}`}
</MenuItem>
);
})}
Expand Down
54 changes: 27 additions & 27 deletions frontend/src/components/templates/ILab/IlabExpandedRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,33 @@ const IlabRowContent = (props) => {
heading={"Common Parameters"}
metadata={Object.entries(item.params)}
/>
{item.iterations.length > 1 && (
<AccordionItem>
<AccordionToggle
onClick={() => {
onToggle("bordered-toggle3");
}}
isExpanded={expanded.includes("bordered-toggle3")}
id="bordered-toggle3"
>
{`Unique parameters for ${item.iterations.length} Iterations`}
</AccordionToggle>
<AccordionContent
id="bordered-expand3"
isHidden={!expanded.includes("bordered-toggle3")}
>
{item.iterations.map((i) => (
<MetaRow
key={uid()}
heading={`Iteration ${i.iteration} Parameters`}
metadata={Object.entries(i.params).filter(
(i) => !(i[0] in item.params)
)}
/>
))}
</AccordionContent>
</AccordionItem>
)}
</CardBody>
</Card>
</div>
Expand All @@ -102,33 +129,6 @@ const IlabRowContent = (props) => {
</div>
</AccordionContent>
</AccordionItem>
{item.iterations.length > 1 && (
<AccordionItem>
<AccordionToggle
onClick={() => {
onToggle("bordered-toggle3");
}}
isExpanded={expanded.includes("bordered-toggle3")}
id="bordered-toggle3"
>
{`Unique parameters for ${item.iterations.length} Iterations`}
</AccordionToggle>
<AccordionContent
id="bordered-expand3"
isHidden={!expanded.includes("bordered-toggle3")}
>
{item.iterations.map((i) => (
<MetaRow
key={uid()}
heading={`Iteration ${i.iteration} Parameters`}
metadata={Object.entries(i.params).filter(
(i) => !(i[0] in item.params)
)}
/>
))}
</AccordionContent>
</AccordionItem>
)}
</Accordion>
);
};
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/templates/ILab/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
flex-direction: row;
margin-bottom: 1vw;
.metadata-card {
flex: 1; /* additionally, equal width */
flex: 1; /* additionally, equal width */
padding: 1em;
margin-right: 1.5vw;
}
}
.comparison-container {
display: flex;
display: flex;
width: 100%;
height: 80%;
.metrics-container {
width: 20%;
width: 40%;
padding: 10px;
.compare-btn {
margin: 2vh 0;
Expand All @@ -26,7 +26,7 @@
box-shadow: unset;
}
}
.chart-conatiner {
.chart-container {
width: 80%;
.js-plotly-plot {
width: 100%;
Expand All @@ -38,4 +38,4 @@
.title {
margin-bottom: 2vh;
}
}
}
Loading