From bca888006eb44329ac2eb2da88eefea171ae3d68 Mon Sep 17 00:00:00 2001 From: Min-Hsueh Chiu Date: Tue, 16 Jun 2026 11:32:22 -0700 Subject: [PATCH 1/3] add global_formula, heating_furnace_name, and precursor_powders to the schema --- .../lux/projects/alab/schemas/experiments.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py index d242ad272..963af0031 100644 --- a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py +++ b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py @@ -44,7 +44,24 @@ class Experiment(BaseModel, extra="forbid"): default=None, description="Experiment subgroup (e.g., NSC_249, Na_123)" ) - target_formula: str = Field(description="Target chemical formula") + target_formula: str | None = Field( + default=None, + description=( + "The formula used internally to determine precursor weights. " + "May differ from the true intended formula (global_formula) due to experimental " + "constraints (e.g. oxygen mass balancing corrections, excess " + "alkali for battery materials). Not always a chemically meaningful " + "representation of what was attempted." + ), + ) + + global_formula: str | None = Field( + default=None, + description=( + "The canonical formula for the target material, independent of per-run precursor adjustments. " + "Represents what the experiment was ultimately trying to synthesize." + ), + ) last_updated: datetime = Field(description="Last modification timestamp") @@ -56,6 +73,11 @@ class Experiment(BaseModel, extra="forbid"): default=None, description="Optional notes about the experiment" ) + precursor_powders: list[str] | None = Field( + default=None, + description="List of precursor powder names used in the experiment" + ) + # === Heating fields (prefix: heating_) === heating_method: Literal["standard", "atmosphere", "manual", "none"] | None = Field( default=None, description="Heating method used" @@ -85,6 +107,10 @@ class Experiment(BaseModel, extra="forbid"): default=None, description="Whether low temperature calcination was used" ) + heating_furnace_name: str | None = Field( + default=None, description="Heating furnace type" + ) + # === Recovery fields (prefix: recovery_) === recovery_total_dosed_mass_mg: float | None = Field( default=None, description="Total mass of all powders dosed in mg" From c4a0a1086cedfa17d397c282faa873acec56c22f Mon Sep 17 00:00:00 2001 From: Min-Hsueh Chiu Date: Tue, 16 Jun 2026 11:33:53 -0700 Subject: [PATCH 2/3] light linting --- .../lux/projects/alab/schemas/experiments.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py index 963af0031..3fb6540ca 100644 --- a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py +++ b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py @@ -47,10 +47,10 @@ class Experiment(BaseModel, extra="forbid"): target_formula: str | None = Field( default=None, description=( - "The formula used internally to determine precursor weights. " - "May differ from the true intended formula (global_formula) due to experimental " - "constraints (e.g. oxygen mass balancing corrections, excess " - "alkali for battery materials). Not always a chemically meaningful " + "The formula used internally to determine precursor weights." + "May differ from the true intended formula (global_formula) due to experimental" + "constraints (e.g. oxygen mass balancing corrections, excess" + "alkali for battery materials). Not always a chemically meaningful" "representation of what was attempted." ), ) @@ -58,7 +58,7 @@ class Experiment(BaseModel, extra="forbid"): global_formula: str | None = Field( default=None, description=( - "The canonical formula for the target material, independent of per-run precursor adjustments. " + "The canonical formula for the target material, independent of per-run precursor adjustments." "Represents what the experiment was ultimately trying to synthesize." ), ) @@ -75,7 +75,7 @@ class Experiment(BaseModel, extra="forbid"): precursor_powders: list[str] | None = Field( default=None, - description="List of precursor powder names used in the experiment" + description="List of precursor powder names used in the experiment", ) # === Heating fields (prefix: heating_) === From 301c4d6b37733b73eee6a543d4b234ac07bc04bc Mon Sep 17 00:00:00 2001 From: Min-Hsueh Chiu Date: Tue, 16 Jun 2026 12:11:29 -0700 Subject: [PATCH 3/3] ensure global_formula is not None --- .../lux/projects/alab/schemas/experiments.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py index 3fb6540ca..6d6d0018e 100644 --- a/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py +++ b/mpcontribs-lux/mpcontribs/lux/projects/alab/schemas/experiments.py @@ -40,6 +40,13 @@ class Experiment(BaseModel, extra="forbid"): description="Root experiment type (NSC, Na, PG, MINES, TRI)" ) + global_formula: str = Field( + description=( + "The canonical formula for the target material, independent of per-run precursor adjustments." + "Represents what the experiment was ultimately trying to synthesize. This should be same as `formula`." + ), + ) + experiment_subgroup: str | None = Field( default=None, description="Experiment subgroup (e.g., NSC_249, Na_123)" ) @@ -51,15 +58,7 @@ class Experiment(BaseModel, extra="forbid"): "May differ from the true intended formula (global_formula) due to experimental" "constraints (e.g. oxygen mass balancing corrections, excess" "alkali for battery materials). Not always a chemically meaningful" - "representation of what was attempted." - ), - ) - - global_formula: str | None = Field( - default=None, - description=( - "The canonical formula for the target material, independent of per-run precursor adjustments." - "Represents what the experiment was ultimately trying to synthesize." + "representation of what was attempted. Can be null if there is no adjustment for experiment." ), )