Skip to content
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
4 changes: 2 additions & 2 deletions backend/src/acidwatch_api/models/example_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ExampleAdapter(BaseAdapter):
# The exception is CO2, which must not be specified as it's the solvent.
#
# Note that all concentrations provided to the adapter through
# self.concentrations will be in the unit PPM. Likewise, all concentrations
# provided in the results will be treated as PPM by the frontend. Make sure
# self.concentrations will be in the unit mol PPM. Likewise, all concentrations
# provided in the results will be treated as mol PPM by the frontend. Make sure
# to adhere to this unit in the adapter interface.
valid_substances = ["H2O"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ const CompareSection: React.FC<CompareSectionProps> = ({ results, modelIndex, ph
});

const axisSubstances = new Set(results.map((r) => r.axes[0]?.substance).filter(Boolean));
const xAxisLabel = axisSubstances.size === 1 ? `${[...axisSubstances][0]} (ppm)` : "Varied concentration (ppm)";
const unit = phaseKind === "aqueous" ? "wt%" : "ppm";
const xAxisLabel =
axisSubstances.size === 1 ? `${[...axisSubstances][0]} (ppm·mol)` : "Varied concentration (ppm·mol)";
const unit = phaseKind === "aqueous" ? "wt%" : "ppm·mol";

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/GridSimulation/GridResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const GridPhaseChart: React.FC<GridPhaseChartProps> = ({ result, modelIndex, pha
xValues={xValues}
series={series}
xAxisLabel={`${xAxisSubstance} (ppm)`}
yAxisLabel={`Output concentration (${phaseKind === "aqueous" ? "wt%" : "ppm"})`}
yAxisLabel={`Output concentration (${phaseKind === "aqueous" ? "wt%" : "ppm·mol"})`}
aspectRatio={2}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/LabResultsPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const LabResultsPlot: React.FC<LabResultsPlotProps> = ({
data: ds.data.filter((point) => plotComponents.length === 0 || plotComponents.includes(point.x)),
}))}
aspectRatio={4}
yLabel="Concentration (ppm)"
yLabel="Concentration (ppm·mol)"
xLabel="Components"
/>
<div style={{ marginBottom: "20px" }}>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ParityPlots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const ParityPlots: React.FC<ParityPlotsProps> = ({ availableComponents, experime
{comp && (
<ScatterPlot
datasets={buildParityDatasets(experiments, simulationsPerExperiment, comp)}
xLabel={`Measured ${comp} (ppm)`}
yLabel={`Modelled ${comp} (ppm)`}
xLabel={`Measured ${comp} (ppm·mol)`}
yLabel={`Modelled ${comp} (ppm·mol)`}
showDiagonal
/>
)}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/Simulation/ModelInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
id="gridMin0"
type="number"
label="From"
unit="ppm"
unit="ppm·mol"
step="any"
min={0}
max={PPM_MAX}
Expand All @@ -183,7 +183,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
id="gridMax0"
type="number"
label="To"
unit="ppm"
unit="ppm·mol"
step="any"
min={0}
max={PPM_MAX}
Expand All @@ -199,7 +199,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
id="gridStep0"
type="number"
label="Step"
unit="ppm"
unit="ppm·mol"
step="any"
min={0.001}
value={stepStr}
Expand Down Expand Up @@ -309,7 +309,7 @@ const ModelInputs: React.FC<{
opacity: invalid || isGridded ? 0.6 : 1,
}}
step="any"
unit="ppm"
unit="ppm·mol"
max={PPM_MAX}
value={value}
disabled={isGridded}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Simulation/PhaseResultTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PhaseResultTableProps {
}

function unitLabel(phase: Phase): string {
return phase.kind === "aqueous" ? "wt%" : "ppm";
return phase.kind === "aqueous" ? "wt%" : "ppm·mol";
}

function convertUnitAccordingToPhase(phase: Phase): Record<string, number> {
Expand Down Expand Up @@ -109,7 +109,7 @@ const PhaseResultTable: React.FC<PhaseResultTableProps> = ({ initialConcentratio
</Table.Cell>
));
if (group.showTotal) {
cells.push(<Table.Cell key={`${group.label}-total`}>Total [ppm]</Table.Cell>);
cells.push(<Table.Cell key={`${group.label}-total`}>Total [ppm·mol]</Table.Cell>);
}
return cells;
})}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Simulation/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ModelResultTabs: React.FC<ModelResultTabsProps> = ({ simulationResults, mo
aspectRatio={2}
graphData={extractPlotData(initialConcentrations, phasesWithConcentrations)}
xLabel="Components"
yLabel="Concentration (ppm)"
yLabel="Concentration (ppm·mol)"
/>

<PhaseResultTable initialConcentrations={initialConcentrations} phases={phasesWithConcentrations} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Compare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const CompareSimulations: React.FC<{ simulationIds: string[] }> = ({ simulationI
Output Concentrations
</Typography>

<BarChart graphData={chartData} aspectRatio={3} xLabel="Components" yLabel="Concentration (ppm)" />
<BarChart graphData={chartData} aspectRatio={3} xLabel="Components" yLabel="Concentration (ppm·mol)" />

<Typography variant="h5" style={{ marginBottom: "1rem" }}>
Concentration Values (≥ 0.01)
Expand Down
Loading