Skip to content

Conversation

esoteric-ephemera
Copy link
Collaborator

More analysis features for generating oxygen evolution graphs:

  • Pull in thermo data from NIST JANAF tables + cache it
  • Add stairstepping of O2 evolution data to make plotting easier in web

Sorry for another PR @tschaume, trying to isolate pieces of the pipeline. Also there's a lot of analysis stuff I had to add (pulling down web data + caching + spline evals) which likely doesn't belong in the API client but isn't going to be used elsewhere in our pipeline

Copy @minhsueh for thoughts

@esoteric-ephemera
Copy link
Collaborator Author

Also an example of how the plotting works with the new data structure:

from mp_api.client import MPRester
import plotly.graph_objects as pgo
import pandas as pd

with MPRester() as mpr:
    oxyevo = mpr.get_oxygen_evolution(
        "mp-1040954",
        "Ca",
    )

fig = pgo.Figure()
for formula, data in oxyevo.items():
    df = pd.DataFrame(data)
    df.reaction = df.reaction.apply(str)
    fig.add_trace(
        pgo.Scatter(
            x = df.temperature,
            y = df.evolution,
            name=formula,
            hovertext = df.reaction
        )
    )
fig.update_layout(
    xaxis = {
        "range": (-10.,1000),
        "title_text" : "T (K)",
    },
    yaxis_title_text = "O<sub>2</sub> evolved (per formula unit)",
    height=600,
    width=800,
)
image

@esoteric-ephemera
Copy link
Collaborator Author

New tests are passing locally on my side: https://github.com/esoteric-ephemera/mp_api/actions/runs/18327023900/job/52193848650

@tschaume tschaume merged commit afdb335 into materialsproject:main Oct 8, 2025
2 of 4 checks passed
@esoteric-ephemera esoteric-ephemera deleted the oxyevo2 branch October 8, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants