Skip to content

Commit 301c4d6

Browse files
committed
ensure global_formula is not None
1 parent c4a0a10 commit 301c4d6

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ class Experiment(BaseModel, extra="forbid"):
4040
description="Root experiment type (NSC, Na, PG, MINES, TRI)"
4141
)
4242

43+
global_formula: str = Field(
44+
description=(
45+
"The canonical formula for the target material, independent of per-run precursor adjustments."
46+
"Represents what the experiment was ultimately trying to synthesize. This should be same as `formula`."
47+
),
48+
)
49+
4350
experiment_subgroup: str | None = Field(
4451
default=None, description="Experiment subgroup (e.g., NSC_249, Na_123)"
4552
)
@@ -51,15 +58,7 @@ class Experiment(BaseModel, extra="forbid"):
5158
"May differ from the true intended formula (global_formula) due to experimental"
5259
"constraints (e.g. oxygen mass balancing corrections, excess"
5360
"alkali for battery materials). Not always a chemically meaningful"
54-
"representation of what was attempted."
55-
),
56-
)
57-
58-
global_formula: str | None = Field(
59-
default=None,
60-
description=(
61-
"The canonical formula for the target material, independent of per-run precursor adjustments."
62-
"Represents what the experiment was ultimately trying to synthesize."
61+
"representation of what was attempted. Can be null if there is no adjustment for experiment."
6362
),
6463
)
6564

0 commit comments

Comments
 (0)