Skip to content

chore/SOF-7921 chore: import wode/mode - #328

Merged
VsevolodX merged 4 commits into
mainfrom
chore/SOF-7921
Jun 5, 2026
Merged

chore/SOF-7921 chore: import wode/mode #328
VsevolodX merged 4 commits into
mainfrom
chore/SOF-7921

Conversation

@VsevolodX

@VsevolodX VsevolodX commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Corrected a package name typo in the workflow dependencies configuration.
  • Chores

    • Enhanced workflow dependencies by adding new packages with minimum version constraints.
    • Refactored internal workflow context handling methods across simulation notebooks (band structure, relaxation, equation of state, and others) for improved consistency.
    • Updated workflow visualization patterns in example notebooks and documentation materials.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR updates 10 materials-designer workflow notebooks to switch data provider method calls from yield_data() to get_context_item_data() for context injection, removes workflow serialization calls from preview cells, adds compute.cluster output to band-structure workflow, expands the pyproject.toml workflows dependencies with three new mat3ra packages, and fixes a typo in the utilities dependency. Two example notebooks are also updated to use explicit request parameters and inject QE scripts into both content and rendered fields.

Changes

Workflow Context API & Output Updates

Layer / File(s) Summary
Use get_context_item_data for context providers
other/materials_designer/specific_examples/defect_point_substitution_graphene_simulation.ipynb, other/materials_designer/workflows/band_gap.ipynb, other/materials_designer/workflows/band_structure.ipynb, other/materials_designer/workflows/band_structure_hse.ipynb, other/materials_designer/workflows/equation_of_state.ipynb, other/materials_designer/workflows/relaxation.ipynb, other/materials_designer/workflows/surface_energy.ipynb, other/materials_designer/workflows/total_energy.ipynb, other/materials_designer/workflows/total_energy_post_processing.ipynb, other/materials_designer/workflows/valence_band_offset.ipynb
Provider calls for k-grid, k-path, and plane-wave cutoff contexts switch from yield_data() to get_context_item_data() across all 10 workflow notebooks, maintaining the same context attachment to workflow units.
Remove workflow.to_dict() and print cluster
other/materials_designer/workflows/band_gap.ipynb, other/materials_designer/workflows/band_structure.ipynb, other/materials_designer/workflows/band_structure_hse.ipynb, other/materials_designer/workflows/relaxation.ipynb, other/materials_designer/workflows/total_energy_post_processing.ipynb
Preview cells remove workflow.to_dict() serialization calls, leaving only visualize_workflow(); band_structure notebook additionally outputs compute.cluster after printing the selected cluster/queue/ppn configuration.
Expand workflows extra dependencies
pyproject.toml
The [project.optional-dependencies].workflows list adds mat3ra-mode, mat3ra-wode, and mat3ra-ade>=2026.5.29.post0; typo corrected from mar3ra-notebooks-utils[api] to mat3ra-notebooks-utils[api].
Examples notebook request and script injection
examples/job/get-file-from-job.ipynb, examples/workflow/qe_scf_calculation.ipynb
Bank workflow lookup changes to explicit GET request with params (including limit:1) and headers instead of list(); QE SCF script is injected into both unit content and rendered fields; notebook cell boundaries adjusted around job creation sections.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Exabyte-io/api-examples#276: Overlaps on band_gap.ipynb workflow context-provider method updates and preview serialization changes.
  • Exabyte-io/api-examples#293: Both PRs modify valence_band_offset.ipynb to switch context injection from yield_data() to get_context_item_data().
  • Exabyte-io/api-examples#305: Both PRs update qe_scf_calculation.ipynb to change how the bash script is injected into the workflow unit template.

Suggested reviewers

  • pranabdas
  • timurbazhirov

Poem

🐰 A rabbit hops through notebooks bright,
Where context flows take graceful flight—
No yield_data() clouds the way,
Just get_context_item_data() to save the day!
With deps expanded, typos fled,
Our workflows bloom with joy instead! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title mentions importing 'wode/mode' but the changeset primarily updates dependency declarations in pyproject.toml and refactors multiple workflow notebooks to use get_context_item_data() instead of yield_data(). Clarify the title to better reflect the main changes, such as: 'chore: Update workflow context data retrieval and dependencies' or provide more specific details about what wode/mode import changes entail.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/SOF-7921

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.15.15)
examples/workflow/qe_scf_calculation.ipynb

Unexpected end of JSON input

examples/job/get-file-from-job.ipynb

Unexpected end of JSON input


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@VsevolodX VsevolodX changed the title chore: imports chore/SOF-7921 chore: import wode/mode Jun 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pyproject.toml (1)

41-46: ⚡ Quick win

Pin the remaining workflow packages for reproducible installs.

README.md:135-143 documents pip install -e ".[workflows,jupyterlab]" as a public install path. Leaving mat3ra-code, mat3ra-ade, mat3ra-prode, and mat3ra-ide floating while mode and wode are commit-pinned means that exact command can start resolving different environments over time. Please either pin/add upper bounds here or document why these packages are intentionally allowed to drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` around lines 41 - 46, The dependency list leaves mat3ra-code,
mat3ra-ade, mat3ra-prode, and mat3ra-ide unpinned while mat3ra-mode and
mat3ra-wode are commit-pinned, causing non-reproducible installs for the
documented pip command; either pin those four packages (e.g., exact versions or
a tight >=...,<... range) in pyproject.toml next to the existing entries or add
an explicit note in README.md explaining why they are intentionally allowed to
drift, and ensure the change references the package names mat3ra-code,
mat3ra-ade, mat3ra-prode, and mat3ra-ide so reviewers can verify
reproducibility.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pyproject.toml`:
- Around line 41-46: The dependency list leaves mat3ra-code, mat3ra-ade,
mat3ra-prode, and mat3ra-ide unpinned while mat3ra-mode and mat3ra-wode are
commit-pinned, causing non-reproducible installs for the documented pip command;
either pin those four packages (e.g., exact versions or a tight >=...,<...
range) in pyproject.toml next to the existing entries or add an explicit note in
README.md explaining why they are intentionally allowed to drift, and ensure the
change references the package names mat3ra-code, mat3ra-ade, mat3ra-prode, and
mat3ra-ide so reviewers can verify reproducibility.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f03449eb-f70b-43c6-87a5-87adea24ed1d

📥 Commits

Reviewing files that changed from the base of the PR and between edc7acc and 60b914a.

📒 Files selected for processing (1)
  • pyproject.toml

Comment thread pyproject.toml Outdated
workflows = [
"mat3ra-notebooks-utils[materials]",
"mat3ra-wode",
"mat3ra-code",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need code, do we use it directly here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was temporary for dev

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
other/materials_designer/workflows/total_energy_post_processing.ipynb (1)

461-473: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Missing unit null-guard on the SCF k-grid path.

get_unit_by_name(name="pw_scf") can return None, and unit.add_context(...) would then raise AttributeError. The sibling notebooks (e.g. band_structure.ipynb, lines 402-408) guard this with if unit:. For consistency and safety, add the same guard here (and on the relaxation path at Line 466).

🛡️ Proposed guard
 if RELAXATION_KGRID is not None and ADD_RELAXATION:
     unit = workflow.subworkflows[0].get_unit_by_name(name_regex="relax")
-    unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).get_context_item_data())
-    workflow.subworkflows[0].set_unit(unit)
+    if unit:
+        unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).get_context_item_data())
+        workflow.subworkflows[0].set_unit(unit)
 
 if SCF_KGRID is not None:
     unit = pp_subworkflow.get_unit_by_name(name="pw_scf")
-    unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())
-    pp_subworkflow.set_unit(unit)
+    if unit:
+        unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())
+        pp_subworkflow.set_unit(unit)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@other/materials_designer/workflows/total_energy_post_processing.ipynb` around
lines 461 - 473, The code calls get_unit_by_name (e.g., unit =
workflow.subworkflows[0].get_unit_by_name(name_regex="relax") and unit =
pp_subworkflow.get_unit_by_name(name="pw_scf")) and immediately invokes
unit.add_context(...) and set_unit(...), which will raise if get_unit_by_name
returns None; add a null-guard (if unit:) around both the RELAXATION_KGRID path
(when ADD_RELAXATION is true) and the SCF_KGRID path so you only call
PointsGridDataProvider(...).get_context_item_data(), unit.add_context(...), and
workflow/pp_subworkflow.set_unit(unit) when unit is not None.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@other/materials_designer/workflows/total_energy_post_processing.ipynb`:
- Line 467: The notebook calls PointsGridDataProvider.get_context_item_data(),
but that method doesn't exist; replace those calls with the ContextProvider API
methods: invoke PointsGridDataProvider.yield_data() to produce the dict shape
expected by Unit.add_context() (or use yield_data_with_overrides(...) when you
need to supply overrides), then pass the yielded data into Unit.add_context();
update the two occurrences (including the one using RELAXATION_KGRID)
accordingly.

In `@pyproject.toml`:
- Line 43: Replace the invalid git SHA for the mat3ra-wode dependency in
pyproject.toml by updating the URL fragment to a valid commit present on the
Exabyte-io/wode.git remote (or remove the @<sha> suffix to use the repository
HEAD); after changing the pin, run pip install -e . or poetry update to verify
installation succeeds and run quick smoke tests that import mat3ra.wode.Workflow
and mat3ra.wode.workflows.Workflow to confirm both names still resolve to the
expected API (adjust import aliases or code paths if the new commit changed the
module layout).

---

Outside diff comments:
In `@other/materials_designer/workflows/total_energy_post_processing.ipynb`:
- Around line 461-473: The code calls get_unit_by_name (e.g., unit =
workflow.subworkflows[0].get_unit_by_name(name_regex="relax") and unit =
pp_subworkflow.get_unit_by_name(name="pw_scf")) and immediately invokes
unit.add_context(...) and set_unit(...), which will raise if get_unit_by_name
returns None; add a null-guard (if unit:) around both the RELAXATION_KGRID path
(when ADD_RELAXATION is true) and the SCF_KGRID path so you only call
PointsGridDataProvider(...).get_context_item_data(), unit.add_context(...), and
workflow/pp_subworkflow.set_unit(unit) when unit is not None.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5d90fdf1-097c-4af4-9805-1ce43207289a

📥 Commits

Reviewing files that changed from the base of the PR and between 60b914a and f8111c6.

📒 Files selected for processing (11)
  • other/materials_designer/specific_examples/defect_point_substitution_graphene_simulation.ipynb
  • other/materials_designer/workflows/band_gap.ipynb
  • other/materials_designer/workflows/band_structure.ipynb
  • other/materials_designer/workflows/band_structure_hse.ipynb
  • other/materials_designer/workflows/equation_of_state.ipynb
  • other/materials_designer/workflows/relaxation.ipynb
  • other/materials_designer/workflows/surface_energy.ipynb
  • other/materials_designer/workflows/total_energy.ipynb
  • other/materials_designer/workflows/total_energy_post_processing.ipynb
  • other/materials_designer/workflows/valence_band_offset.ipynb
  • pyproject.toml

"if RELAXATION_KGRID is not None and ADD_RELAXATION:\n",
" unit = workflow.subworkflows[0].get_unit_by_name(name_regex=\"relax\")\n",
" unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).get_context_item_data())\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate the provider definitions and confirm the method name/signature
pip download mat3ra-wode --no-deps -d /tmp/wode 2>/dev/null
fd -e py . /tmp/wode 2>/dev/null | xargs rg -nP '\b(get_context_item_data|yield_data)\s*\(' 2>/dev/null
# Fallback: search installed metadata for the package source
rg -nP '\bdef\s+(get_context_item_data|yield_data)\b' 2>/dev/null

Repository: Exabyte-io/api-examples

Length of output: 6012


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Download the referenced package (same as initial attempt)
pip download mat3ra-wode --no-deps -d /tmp/wode 2>/dev/null

whl="$(ls -1 /tmp/wode/*.whl | head -n 1)"
echo "Using wheel: $whl"

rm -rf /tmp/wode_extract
mkdir -p /tmp/wode_extract
unzip -q "$whl" -d /tmp/wode_extract

echo "Top-level extracted entries:"
ls -1 /tmp/wode_extract | head

# Find the provider class + method implementations inside the wheel
rg -n --hidden --no-ignore \
  "class\s+PointsGridDataProvider\b" /tmp/wode_extract \
  || true

rg -n --hidden --no-ignore \
  "def\s+get_context_item_data\b" /tmp/wode_extract \
  || true

rg -n --hidden --no-ignore \
  "def\s+yield_data\b" /tmp/wode_extract \
  || true

# If present, confirm whether PointsGridDataProvider defines/overrides the method(s)
rg -n --hidden --no-ignore \
  "PointsGridDataProvider[\s\S]{0,500}?get_context_item_data" /tmp/wode_extract \
  || true

# Also capture any direct mention of yield_data/get_context_item_data in PointsGridDataProvider-related code
rg -n --hidden --no-ignore \
  "PointsGridDataProvider" /tmp/wode_extract | head -n 200 || true

Repository: Exabyte-io/api-examples

Length of output: 1588


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Reuse previous extraction
base="/tmp/wode_extract/mat3ra/wode/context/providers/points_grid_data_provider.py"

echo "--- File exists? ---"
ls -l "$base"

echo "--- grep method definitions ---"
rg -n "def\s+(get_context_item_data|yield_data|yield_data_with_overrides)\b" "$base"

echo "--- Show relevant portions ---"
python3 - <<'PY'
import itertools, pathlib
p = pathlib.Path("/tmp/wode_extract/mat3ra/wode/context/providers/points_grid_data_provider.py")
lines = p.read_text().splitlines()
# Print around any occurrences of get_context_item_data / yield_data
targets = ["get_context_item_data", "yield_data", "yield_data_with_overrides", "ContextProvider"]
for t in targets:
    idxs = [i for i,l in enumerate(lines) if t in l]
    if not idxs:
        continue
    for i in idxs[:3]:
        start=max(0,i-20); end=min(len(lines), i+60)
        print(f"\n### {t} around line {i+1} ({start+1}-{end})")
        for j in range(start,end):
            print(f"{j+1:5d}: {lines[j]}")
PY

echo "--- Locate base class implementations (ContextProvider / schema) ---"
# Try to find where ContextProvider is defined
rg -n "class\s+ContextProvider\b" /tmp/wode_extract/mat3ra/wode/context -S || true

# Try to find any get_context_item_data/yield_data in context provider packages
rg -n "def\s+(get_context_item_data|yield_data)\b" /tmp/wode_extract/mat3ra/wode/context -S || true

Repository: Exabyte-io/api-examples

Length of output: 15156


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_extract"

echo "== Search for get_context_item_data in entire wheel extraction =="
rg -n --hidden --no-ignore "get_context_item_data" "$root" || true

echo
echo "== Search for ContextProvider definition =="
rg -n --hidden --no-ignore "class\s+ContextProvider\b" "$root/mat3ra" || true

# Try to locate the actual context_provider.py file
ctx_provider_file="$(fd -t f "context_provider.py" "$root/mat3ra" | head -n 20 | cat)"
echo
echo "== context_provider.py candidates =="
echo "$ctx_provider_file"

if [ -n "$ctx_provider_file" ]; then
  # If multiple, just inspect the first one that exists
  fp="$(echo "$ctx_provider_file" | head -n 1)"
  echo
  echo "== Showing relevant methods in $fp =="
  rg -n "def\s+get_context_item_data\b|def\s+yield_data\b|class\s+ContextProvider\b" "$fp" || true
  echo
  python3 - <<'PY'
import pathlib, re
fp = pathlib.Path("$fp")
txt = fp.read_text()
for m in ["get_context_item_data", "yield_data"]:
    print("\n---", m, "---")
    for mm in re.finditer(r"def\s+"+m+r"\b", txt):
        start=max(0, txt[:mm.start()].count("\n")-5)
        # print around first occurrence only
        break
PY
fi

Repository: Exabyte-io/api-examples

Length of output: 1279


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_extract"

echo "== ContextProvider base class file(s) =="
fd -t f "execution_unit_input.py" "$root/mat3ra" -a || true
ctx_base="$(rg -l --hidden --no-ignore "class\s+ContextProvider\s*\(" "$root/mat3ra" | head -n 20)"
echo "$ctx_base"

for f in $ctx_base; do
  echo
  echo "== Inspect $f (methods of interest) =="
  rg -n --hidden --no-ignore "def\s+(get_context_item_data|yield_data|get_context_item|add_context|context_item_data)\b|class\s+ContextProvider\b" "$f" || true
  echo
  python3 - <<PY
import pathlib, re
p=pathlib.Path("$f")
txt=p.read_text()
for name in ["get_context_item_data","yield_data","add_context","context_item_data","get_context_item_data"]:
    if name in txt:
        print(f"Found string: {name}")
PY
done

echo
echo "== Search whole wheel for get_context_item_data / context_item_data strings =="
rg -n --hidden --no-ignore "get_context_item_data|context_item_data" "$root/mat3ra" || true

echo
echo "== Search whole wheel for add_context() =="
rg -n --hidden --no-ignore "def\s+add_context\b" "$root/mat3ra" || true

Repository: Exabyte-io/api-examples

Length of output: 594


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_extract"

echo "== execution_unit_input.py (ContextProvider) snippet =="
sed -n '1,220p' "$root/mat3ra/wode/units/execution_unit_input.py" | nl -ba | sed -n '1,220p' || true

echo
echo "== unit.py (add_context) snippet =="
sed -n '1,140p' "$root/mat3ra/wode/units/unit.py" | nl -ba | sed -n '1,200p' || true

echo
echo "== Targeted search for get_context_item_data in wheel =="
rg -n --hidden --no-ignore "get_context_item_data" "$root" || true

echo
echo "== Targeted search for context_item_data / contextItemData variants =="
rg -n --hidden --no-ignore "context[_-]item[_-]data|contextItemData" "$root" || true

Repository: Exabyte-io/api-examples

Length of output: 391


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_extract"

echo "== execution_unit_input.py =="
fp="$root/mat3ra/wode/units/execution_unit_input.py"
wc -l "$fp"
cat -n "$fp" | sed -n '1,220p'

echo
echo "== unit.py =="
fp2="$root/mat3ra/wode/units/unit.py"
wc -l "$fp2"
cat -n "$fp2" | sed -n '1,180p'

echo
echo "== wheel search: get_context_item_data variants =="
rg -n --hidden --no-ignore "get[_-]?context[_-]?item[_-]?data" "$root" || true
rg -n --hidden --no-ignore "context_item_data|contextItemData" "$root" || true

echo
echo "== wheel search: yield_data usage in context providers =="
rg -n --hidden --no-ignore "yield_data\(" "$root/mat3ra/wode" | head -n 50 || true

echo
echo "== wheel search: ContextProvider class methods =="
rg -n --hidden --no-ignore "class\s+ContextProvider\b|def\s+\w+\s*\(" "$root/mat3ra/wode/units/execution_unit_input.py" || true

Repository: Exabyte-io/api-examples

Length of output: 6703


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_extract"

echo "== Locate mat3ra/ade/context/context_provider.py (or equivalent) =="
fd -t f "context_provider.py" "$root/mat3ra" | head -n 50

echo
echo "== Search for the imported module path =="
rg -n --hidden --no-ignore "ade\.context\.context_provider|context_provider import ContextProvider" "$root/mat3ra" || true

echo
echo "== Search for yield_data and get_context_item_data definitions in the whole wheel =="
rg -n --hidden --no-ignore "def\s+(yield_data|get_context_item_data)\b" "$root/mat3ra" || true

echo
echo "== Search for yield_data usage in ContextProvider base class files =="
rg -n --hidden --no-ignore "class\s+ContextProvider\b" "$root/mat3ra" || true

echo
echo "== Inspect likely ContextProvider implementation files =="
# Candidate files that contain ContextProvider class
for f in $(rg -l --hidden --no-ignore "class\s+ContextProvider\b" "$root/mat3ra" | head -n 20); do
  echo "---- $f ----"
  rg -n --hidden --no-ignore "def\s+(yield_data|get_context_item_data|get_context_item|context_item_data)\b" "$f" || true
done

Repository: Exabyte-io/api-examples

Length of output: 1442


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rm -rf /tmp/wode_deps_extract
mkdir -p /tmp/wode_deps_extract

# Download mat3ra-ade (and friends) so we can inspect ContextProvider
pip download mat3ra-ade --no-deps -d /tmp/wode_deps 2>/dev/null || true
pip download mat3ra-ade --only-binary=:all: -d /tmp/wode_deps 2>/dev/null || true

# Also fetch mat3ra-esse if needed for the schema base
pip download mat3ra-esse --no-deps -d /tmp/wode_deps 2>/dev/null || true

# Extract all downloaded wheels into /tmp/wode_deps_extract
for whl in /tmp/wode_deps/*.whl; do
  [ -e "$whl" ] || continue
  echo "Extracting $whl"
  unzip -q "$whl" -d /tmp/wode_deps_extract
done

root="/tmp/wode_deps_extract"

echo
echo "== Search for ContextProvider implementation =="
rg -n --hidden --no-ignore "class\s+ContextProvider\b" "$root" || true

echo
echo "== Search for get_context_item_data in deps =="
rg -n --hidden --no-ignore "get_context_item_data" "$root" || true

echo
echo "== Search for yield_data in deps =="
rg -n --hidden --no-ignore "def\s+yield_data\b" "$root" || true

echo
echo "== Search for context item data naming variants =="
rg -n --hidden --no-ignore "context[_-]?item[_-]?data|contextItemData" "$root" || true

Repository: Exabyte-io/api-examples

Length of output: 8275


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rm -rf /tmp/wode_deps_extract
mkdir -p /tmp/wode_deps_extract

root="/tmp/wode_deps_extract"

# Extract all previously downloaded dependency wheels with overwrite (-o) to avoid prompts.
for whl in /tmp/wode_deps/*.whl; do
  [ -e "$whl" ] || continue
  echo "Extracting $whl"
  unzip -qo "$whl" -d "$root"
done

echo
echo "== Search for ContextProvider implementation =="
rg -n --hidden --no-ignore "class\s+ContextProvider\b" "$root/mat3ra" || true

echo
echo "== Search for get_context_item_data across deps =="
rg -n --hidden --no-ignore "get_context_item_data" "$root/mat3ra" || true

echo
echo "== Search for yield_data across deps =="
rg -n --hidden --no-ignore "def\s+yield_data\b|yield_data\(" "$root/mat3ra" || true

echo
echo "== Search for context-item-data naming variants across deps =="
rg -n --hidden --no-ignore "context[_-]?item[_-]?data|contextItemData" "$root/mat3ra" || true

echo
echo "== Locate PointsGridDataProviderSchema =="
rg -n --hidden --no-ignore "PointsGridDataProviderSchema" "$root/mat3ra" || true

Repository: Exabyte-io/api-examples

Length of output: 9918


🏁 Script executed:

#!/bin/bash
set -euo pipefail

root="/tmp/wode_deps_extract"
fp="$root/mat3ra/ade/context/context_provider.py"

echo "== ade/context/context_provider.py =="
wc -l "$fp"
cat -n "$fp" | sed -n '1,220p'

echo
echo "== Search within ContextProvider file =="
rg -n --hidden --no-ignore "get_context_item_data|yield_data_with_overrides|yield_data|context_item_data|contextItemData" "$fp" || true

echo
echo "== Search whole deps extract for get_context_item_data =="
rg -n --hidden --no-ignore "get_context_item_data" "$root" || true

echo
echo "== Search whole deps extract for context_item_data variants =="
rg -n --hidden --no-ignore "context[_-]?item[_-]?data|contextItemData" "$root" || true

echo
echo "== Search whole deps extract for get_context_item (without _data) =="
rg -n --hidden --no-ignore "get[_-]?context[_-]?item\b" "$root" || true

echo
echo "== Search whole deps extract for yield_data return helpers =="
rg -n --hidden --no-ignore "yield_data_with_overrides|yield_data\(" "$root/mat3ra/ade/context" || true

Repository: Exabyte-io/api-examples

Length of output: 5985


Remove/replace PointsGridDataProvider.get_context_item_data() calls (method doesn’t exist).

mat3ra.ade.context.context_provider.ContextProvider exposes yield_data() / yield_data_for_rendering() and has no get_context_item_data(). PointsGridDataProvider likewise only provides yield_data_with_overrides(), so the notebook’s .get_context_item_data() calls will fail; use yield_data() (or yield_data_with_overrides(...) if you need overrides) to produce the dict shape that Unit.add_context() expects.

Also applies to: 472-472

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@other/materials_designer/workflows/total_energy_post_processing.ipynb` at
line 467, The notebook calls PointsGridDataProvider.get_context_item_data(), but
that method doesn't exist; replace those calls with the ContextProvider API
methods: invoke PointsGridDataProvider.yield_data() to produce the dict shape
expected by Unit.add_context() (or use yield_data_with_overrides(...) when you
need to supply overrides), then pass the yielded data into Unit.add_context();
update the two occurrences (including the one using RELAXATION_KGRID)
accordingly.

Comment thread pyproject.toml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config.yml`:
- Line 81: The entry in the Pyodide packages list is missing the `.whl`
extension so micropip.install won't recognize it; update the package string
`mat3ra_wode-2026.5.29.post1.dev26+g3475895-py3-none-any` in the config (the
Pyodide packages list used by micropip.install) to include the `.whl` suffix
(i.e., append `.whl`) so the installer treats it as a wheel URI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25a14119-199d-473b-9e47-082b8c9a17c1

📥 Commits

Reviewing files that changed from the base of the PR and between f8111c6 and baf0782.

📒 Files selected for processing (2)
  • config.yml
  • packages/mat3ra_wode-2026.5.29.post1.dev26+g3475895-py3-none-any.whl
✅ Files skipped from review due to trivial changes (1)
  • packages/mat3ra_wode-2026.5.29.post1.dev26+g3475895-py3-none-any.whl

Comment thread config.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/job/get-file-from-job.ipynb`:
- Around line 178-181: The notebook currently assumes
bank_workflow_endpoints.request(...)[0]["_id"] exists and will crash on an empty
result; change the code that assigns bank_workflow_id to first capture the
response (e.g., resp = bank_workflow_endpoints.request("GET",
bank_workflow_endpoints.name, params=WORKFLOW_QUERY,
headers=bank_workflow_endpoints.headers)), check that resp is a non-empty list,
and if empty raise a clear error (e.g., ValueError with a message referencing
WORKFLOW_QUERY and systemName) otherwise set bank_workflow_id = resp[0]["_id"]
so you never index into an empty list.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 643c57af-c39f-4380-a700-14c75677bcd0

📥 Commits

Reviewing files that changed from the base of the PR and between baf0782 and 92f74b8.

📒 Files selected for processing (3)
  • config.yml
  • examples/job/get-file-from-job.ipynb
  • examples/workflow/qe_scf_calculation.ipynb
✅ Files skipped from review due to trivial changes (1)
  • config.yml

Comment on lines +178 to +181
"WORKFLOW_QUERY = {\"systemName\": \"espresso-total-energy\", \"limit\": 1}\n",
"bank_workflow_id = bank_workflow_endpoints.request(\n",
" \"GET\", bank_workflow_endpoints.name, params=WORKFLOW_QUERY, headers=bank_workflow_endpoints.headers\n",
")[0][\"_id\"]\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the documented return shape of BankWorkflowEndpoints.request("GET", ..., params=...)in mat3ra-api-client, and what is the recommended way to fetch a single bank workflow bysystemName?

💡 Result:

In the mat3ra-api-client, the BankWorkflowEndpoints.request method typically returns a list (array) of objects when performing a "GET" request to retrieve entities, as standard RESTful operations on Mat3ra collection endpoints generally return a list of matching resources [1][2]. The exact structure of the returned objects corresponds to the JSON schema of a Bank Workflow entity defined in the platform's API documentation [1][3]. To fetch a single bank workflow by its systemName, the recommended approach is to use the list endpoint with a filter parameter (often passed as a query string or dictionary): client.bank_workflows.list({"systemName": "YOUR_SYSTEM_NAME"}) While the low-level request method exists (e.g., BankWorkflowEndpoints.request("GET",...)), it is generally recommended to use the higher-level abstraction provided by the client's resource endpoints (e.g., client.bank_workflows) which simplifies authentication and parameter handling [4][5]. If the list result contains multiple items, you should select the specific item matching the systemName from the returned list. Note: Ensure you are using the official mat3ra-api-client (available on PyPI) rather than similarly named packages from other ecosystems [5]. Always refer to the Swagger UI available on your Mat3ra platform instance for the precise response schema of your current API version [1].

Citations:


Handle empty workflow lookup before indexing in get-file-from-job.ipynb (lines 178-181)

bank_workflow_endpoints.request(...)[0]["_id"] will throw if the filtered GET returns an empty list (no matching systemName), breaking the notebook. Add an empty-result check and raise a clear error.

Proposed fix
 WORKFLOW_QUERY = {"systemName": "espresso-total-energy", "limit": 1}
-bank_workflow_id = bank_workflow_endpoints.request(
-    "GET", bank_workflow_endpoints.name, params=WORKFLOW_QUERY, headers=bank_workflow_endpoints.headers
-)[0]["_id"]
+workflow_resp = bank_workflow_endpoints.request(
+    "GET", bank_workflow_endpoints.name, params=WORKFLOW_QUERY, headers=bank_workflow_endpoints.headers
+)
+workflows = workflow_resp if isinstance(workflow_resp, list) else workflow_resp.get("results", [])
+if not workflows:
+    raise RuntimeError("No bank workflow found for systemName=espresso-total-energy")
+bank_workflow_id = workflows[0]["_id"]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/job/get-file-from-job.ipynb` around lines 178 - 181, The notebook
currently assumes bank_workflow_endpoints.request(...)[0]["_id"] exists and will
crash on an empty result; change the code that assigns bank_workflow_id to first
capture the response (e.g., resp = bank_workflow_endpoints.request("GET",
bank_workflow_endpoints.name, params=WORKFLOW_QUERY,
headers=bank_workflow_endpoints.headers)), check that resp is a non-empty list,
and if empty raise a clear error (e.g., ValueError with a message referencing
WORKFLOW_QUERY and systemName) otherwise set bank_workflow_id = resp[0]["_id"]
so you never index into an empty list.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pyproject.toml`:
- Around line 41-42: The workflow extras in pyproject.toml currently list
unpinned dependencies "mat3ra-mode" and "mat3ra-wode"; update the entries under
[project.optional-dependencies].workflows to add the same minimum version floor
used by mat3ra-ade (e.g., change "mat3ra-mode" and "mat3ra-wode" to
"mat3ra-mode>=2026.5.29.post0" and "mat3ra-wode>=2026.5.29.post0" or pin them to
the corresponding 2026.5.29.postN releases) so that mat3ra-mode and mat3ra-wode
match the version constraints of mat3ra-ade for reproducibility.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2fb40564-681e-441a-9674-f2d4df894c5a

📥 Commits

Reviewing files that changed from the base of the PR and between 92f74b8 and 8b7386a.

📒 Files selected for processing (3)
  • examples/job/get-file-from-job.ipynb
  • examples/workflow/qe_scf_calculation.ipynb
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/job/get-file-from-job.ipynb
  • examples/workflow/qe_scf_calculation.ipynb

Comment thread pyproject.toml
Comment on lines +41 to 42
"mat3ra-mode",
"mat3ra-wode",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What are the currently published versions of mat3ra-modeandmat3ra-wode, and which minimum versions are documented as compatible with mat3ra-ade>=2026.5.29.post0 for workflow notebooks?

💡 Result:

As of June 5, 2026, the currently published versions of the relevant packages are: mat3ra-mode: The latest published version is 2026.5.29.post1 [1]. mat3ra-wode: The latest published version is 2026.5.29.post0 [2]. Regarding compatibility with mat3ra-ade>=2026.5.29.post0, these packages generally follow a synchronized release versioning pattern (YYYY.M.D.postN) [3][1][2][4]. For workflow notebooks requiring mat3ra-ade>=2026.5.29.post0, it is documented and recommended to use the corresponding version 2026.5.29.postN for both mat3ra-mode and mat3ra-wode to ensure compatibility within the ecosystem [3][1][2][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
python - <<'PY'
from pathlib import Path
p = Path("pyproject.toml")
txt = p.read_text().splitlines()
for i in range(30, 70):
    if i-1 < len(txt):
        print(f"{i}: {txt[i-1]}")
PY

Repository: Exabyte-io/api-examples

Length of output: 1096


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n --hidden --no-ignore-vcs "mat3ra-(mode|wode)" .

Repository: Exabyte-io/api-examples

Length of output: 358


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n --hidden --no-ignore-vcs "2026\.5\.29\.post0|mat3ra-ade|mat3ra-mode|mat3ra-wode" README.md .github config.yml docs || true

Repository: Exabyte-io/api-examples

Length of output: 197


Add version floors for mat3ra-mode and mat3ra-wode in workflow dependencies.

In pyproject.toml [project.optional-dependencies].workflows, mat3ra-mode/mat3ra-wode are unpinned ("mat3ra-mode", "mat3ra-wode"), while mat3ra-ade already has >=2026.5.29.post0. Add matching minimum versions (e.g., mat3ra-mode>=2026.5.29.post0 and mat3ra-wode>=2026.5.29.post0) or pin to the corresponding 2026.5.29.postN releases for reproducibility.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` around lines 41 - 42, The workflow extras in pyproject.toml
currently list unpinned dependencies "mat3ra-mode" and "mat3ra-wode"; update the
entries under [project.optional-dependencies].workflows to add the same minimum
version floor used by mat3ra-ade (e.g., change "mat3ra-mode" and "mat3ra-wode"
to "mat3ra-mode>=2026.5.29.post0" and "mat3ra-wode>=2026.5.29.post0" or pin them
to the corresponding 2026.5.29.postN releases) so that mat3ra-mode and
mat3ra-wode match the version constraints of mat3ra-ade for reproducibility.

@VsevolodX
VsevolodX merged commit 3712fa8 into main Jun 5, 2026
8 checks passed
@VsevolodX
VsevolodX deleted the chore/SOF-7921 branch June 5, 2026 05:33
@coderabbitai coderabbitai Bot mentioned this pull request Jun 15, 2026
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