Skip to content

Commit 368cfaf

Browse files
Add suffix of ppm to be explicit
1 parent d3b9112 commit 368cfaf

9 files changed

Lines changed: 17 additions & 16 deletions

File tree

backend/src/acidwatch_api/models/example_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class ExampleAdapter(BaseAdapter):
4343
# The exception is CO2, which must not be specified as it's the solvent.
4444
#
4545
# Note that all concentrations provided to the adapter through
46-
# self.concentrations will be in the unit PPM. Likewise, all concentrations
47-
# provided in the results will be treated as PPM by the frontend. Make sure
46+
# self.concentrations will be in the unit mol PPM. Likewise, all concentrations
47+
# provided in the results will be treated as mol PPM by the frontend. Make sure
4848
# to adhere to this unit in the adapter interface.
4949
valid_substances = ["H2O"]
5050

frontend/src/components/GridSimulation/CompareGridSimulations.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ const CompareSection: React.FC<CompareSectionProps> = ({ results, modelIndex, ph
6666
});
6767

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

7273
return (
7374
<>

frontend/src/components/GridSimulation/GridResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const GridPhaseChart: React.FC<GridPhaseChartProps> = ({ result, modelIndex, pha
6565
xValues={xValues}
6666
series={series}
6767
xAxisLabel={`${xAxisSubstance} (ppm)`}
68-
yAxisLabel={`Output concentration (${phaseKind === "aqueous" ? "wt%" : "ppm"})`}
68+
yAxisLabel={`Output concentration (${phaseKind === "aqueous" ? "wt%" : "ppm·mol"})`}
6969
aspectRatio={2}
7070
/>
7171
)}

frontend/src/components/LabResultsPlot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const LabResultsPlot: React.FC<LabResultsPlotProps> = ({
5757
data: ds.data.filter((point) => plotComponents.length === 0 || plotComponents.includes(point.x)),
5858
}))}
5959
aspectRatio={4}
60-
yLabel="Concentration (ppm)"
60+
yLabel="Concentration (ppm·mol)"
6161
xLabel="Components"
6262
/>
6363
<div style={{ marginBottom: "20px" }}>

frontend/src/components/ParityPlots.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ const ParityPlots: React.FC<ParityPlotsProps> = ({ availableComponents, experime
6666
{comp && (
6767
<ScatterPlot
6868
datasets={buildParityDatasets(experiments, simulationsPerExperiment, comp)}
69-
xLabel={`Measured ${comp} (ppm)`}
70-
yLabel={`Modelled ${comp} (ppm)`}
69+
xLabel={`Measured ${comp} (ppm·mol)`}
70+
yLabel={`Modelled ${comp} (ppm·mol)`}
7171
showDiagonal
7272
/>
7373
)}

frontend/src/components/Simulation/ModelInputs.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
170170
id="gridMin0"
171171
type="number"
172172
label="From"
173-
unit="ppm"
173+
unit="ppm·mol"
174174
step="any"
175175
min={0}
176176
max={PPM_MAX}
@@ -183,7 +183,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
183183
id="gridMax0"
184184
type="number"
185185
label="To"
186-
unit="ppm"
186+
unit="ppm·mol"
187187
step="any"
188188
min={0}
189189
max={PPM_MAX}
@@ -199,7 +199,7 @@ function GridRangeInput({ candidateSubstances }: { candidateSubstances: string[]
199199
id="gridStep0"
200200
type="number"
201201
label="Step"
202-
unit="ppm"
202+
unit="ppm·mol"
203203
step="any"
204204
min={0.001}
205205
value={stepStr}
@@ -309,7 +309,7 @@ const ModelInputs: React.FC<{
309309
opacity: invalid || isGridded ? 0.6 : 1,
310310
}}
311311
step="any"
312-
unit="ppm"
312+
unit="ppm·mol"
313313
max={PPM_MAX}
314314
value={value}
315315
disabled={isGridded}

frontend/src/components/Simulation/PhaseResultTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface PhaseResultTableProps {
1010
}
1111

1212
function unitLabel(phase: Phase): string {
13-
return phase.kind === "aqueous" ? "wt%" : "ppm";
13+
return phase.kind === "aqueous" ? "wt%" : "ppm·mol";
1414
}
1515

1616
function convertUnitAccordingToPhase(phase: Phase): Record<string, number> {
@@ -109,7 +109,7 @@ const PhaseResultTable: React.FC<PhaseResultTableProps> = ({ initialConcentratio
109109
</Table.Cell>
110110
));
111111
if (group.showTotal) {
112-
cells.push(<Table.Cell key={`${group.label}-total`}>Total [ppm]</Table.Cell>);
112+
cells.push(<Table.Cell key={`${group.label}-total`}>Total [ppm·mol]</Table.Cell>);
113113
}
114114
return cells;
115115
})}

frontend/src/components/Simulation/Results.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const ModelResultTabs: React.FC<ModelResultTabsProps> = ({ simulationResults, mo
8989
aspectRatio={2}
9090
graphData={extractPlotData(initialConcentrations, phasesWithConcentrations)}
9191
xLabel="Components"
92-
yLabel="Concentration (ppm)"
92+
yLabel="Concentration (ppm·mol)"
9393
/>
9494

9595
<PhaseResultTable initialConcentrations={initialConcentrations} phases={phasesWithConcentrations} />

frontend/src/pages/Compare.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const CompareSimulations: React.FC<{ simulationIds: string[] }> = ({ simulationI
198198
Output Concentrations
199199
</Typography>
200200

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

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

0 commit comments

Comments
 (0)