Skip to content

Commit

Permalink
Support for per-iteration parameters.
Browse files Browse the repository at this point in the history
(And `/api/v1/ilab/runs` reports iterations in numerical order.)
  • Loading branch information
dbutenhof committed Oct 11, 2024
1 parent b32a606 commit 2148311
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
1 change: 1 addition & 0 deletions backend/app/services/crucible_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ def get_runs(
"params": iparams,
}
)
run["iterations"].sort(key=lambda i: i["iteration"])
run["params"] = common.render()
try:
run["begin_date"] = self._format_timestamp(run["begin"])
Expand Down
54 changes: 43 additions & 11 deletions frontend/src/components/templates/ILab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,51 @@ const ILab = () => {
<CardBody>
<MetaRow
key={uid()}
heading={`Common Parameters (${item.iterations.length} iterations)`}
heading={"Common Parameters"}
metadata={Object.entries(item.params)}
/>
{item?.iterations &&
item.iterations.forEach((i) => {
i?.params && (
<MetaRow
key={uid()}
heading={`Iteration ${i.iteration} Parameters`}
metadata={Object.entries(i.params)}
/>
);
})}
{item.iterations.length > 1 && (
<div>
<Accordion
asDefinitionList={false}
togglePosition="start"
>
<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>
</div>
)}
</CardBody>
</Card>
</div>
Expand Down

0 comments on commit 2148311

Please sign in to comment.