Skip to content

Commit

Permalink
set summary magnetic ordering on electronic structure docs using prov…
Browse files Browse the repository at this point in the history
…ided meta_structure

pass structure from blessed task when calling function for uniformity
with other builders -> materilas, summary, magnetism
  • Loading branch information
tsmathis committed Jan 9, 2025
1 parent 7683b00 commit 1a178ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions emmet-core/emmet/core/electronic_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ def from_bsdos( # type: ignore[override]
summary_efermi = bs_entry.setyawan_curtarolo.efermi # type: ignore
is_gap_direct = bs_entry.setyawan_curtarolo.is_gap_direct # type: ignore
is_metal = bs_entry.setyawan_curtarolo.is_metal # type: ignore
summary_magnetic_ordering = bs_entry.setyawan_curtarolo.magnetic_ordering # type: ignore

for origin in origins:
if origin["name"] == "setyawan_curtarolo":
Expand All @@ -473,7 +472,6 @@ def from_bsdos( # type: ignore[override]
summary_cbm = dos_cbm
summary_vbm = dos_vbm
summary_efermi = dos_efermi
summary_magnetic_ordering = dos_mag_ordering
is_metal = True if np.isclose(dos_gap, 0.0, atol=0.01, rtol=0) else False

for origin in origins:
Expand All @@ -487,10 +485,16 @@ def from_bsdos( # type: ignore[override]
origin["last_updated"] = new_origin_last_updated
origin["task_id"] = new_origin_task_id

summary_magnetic_ordering = CollinearMagneticStructureAnalyzer(
kwargs["meta_structure"],
round_magmoms=True,
threshold_nonmag=0.2,
threshold=0,
).ordering

return cls.from_structure(
material_id=MPID(material_id),
task_id=summary_task,
meta_structure=structure,
band_gap=summary_band_gap,
cbm=summary_cbm,
vbm=summary_vbm,
Expand Down

0 comments on commit 1a178ce

Please sign in to comment.