Format suggestion metadata concisely
This commit is contained in:
1 parent
716b0efbc0
commit
f34207c8d8
2 files changed
+13
-4
No files matched your search
+12
-4
@@ -7396,10 +7396,18 @@ async function showModelSuggestions()
|
||||
let temperature = input.conditions.temperature;
|
||||
let energy = input.conditions.energy;
|
||||
let spinRotator = input.measurement.spin_rotator;
|
||||
if (temperature) contextValues.push("temperature " + temperature.value + " K");
|
||||
if (field) contextValues.push("field " + field.value + " G");
|
||||
if (energy) contextValues.push("energy " + energy.value + " keV");
|
||||
if (spinRotator) contextValues.push("spin orientation " + spinRotator.value + " deg");
|
||||
let contextNumberFormat = new Intl.NumberFormat(undefined, {
|
||||
maximumSignificantDigits: 2,
|
||||
useGrouping: false
|
||||
});
|
||||
if (temperature) {
|
||||
contextValues.push("temperature " + contextNumberFormat.format(temperature.value) + " K");
|
||||
}
|
||||
if (field) contextValues.push("field " + contextNumberFormat.format(field.value) + " G");
|
||||
if (energy) contextValues.push("energy " + contextNumberFormat.format(energy.value) + " keV");
|
||||
if (spinRotator) {
|
||||
contextValues.push("spin orientation " + contextNumberFormat.format(spinRotator.value) + " deg");
|
||||
}
|
||||
contextElement.textContent = "Using " + (input.instrument || "unknown instrument")
|
||||
+ ", " + input.n_runs + " generated RUN block" + (input.n_runs === 1 ? "" : "s")
|
||||
+ (contextValues.length ? ", " + contextValues.join(", ")
|
||||
|
||||
@@ -185,6 +185,7 @@ function testMarkupContract() {
|
||||
assert.match(source, /Reading run metadata\.\.\./);
|
||||
assert.match(source, /Run metadata unavailable:/);
|
||||
assert.match(source, /await initializeLocalRunData\(\)/);
|
||||
assert.match(source, /maximumSignificantDigits:\s*2/);
|
||||
}
|
||||
|
||||
auditScrubbedIndex();
|
||||
|
||||
Reference in new issue
Block a user