chore/SOF-7921 chore: import wode/mode - #328
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR updates 10 materials-designer workflow notebooks to switch data provider method calls from ChangesWorkflow Context API & Output Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.ipynbUnexpected end of JSON input examples/job/get-file-from-job.ipynbUnexpected 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pyproject.toml (1)
41-46: ⚡ Quick winPin the remaining workflow packages for reproducible installs.
README.md:135-143documentspip install -e ".[workflows,jupyterlab]"as a public install path. Leavingmat3ra-code,mat3ra-ade,mat3ra-prode, andmat3ra-idefloating whilemodeandwodeare 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.
| workflows = [ | ||
| "mat3ra-notebooks-utils[materials]", | ||
| "mat3ra-wode", | ||
| "mat3ra-code", |
There was a problem hiding this comment.
Why do we need code, do we use it directly here?
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
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 winMissing
unitnull-guard on the SCF k-grid path.
get_unit_by_name(name="pw_scf")can returnNone, andunit.add_context(...)would then raiseAttributeError. The sibling notebooks (e.g.band_structure.ipynb, lines 402-408) guard this withif 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
📒 Files selected for processing (11)
other/materials_designer/specific_examples/defect_point_substitution_graphene_simulation.ipynbother/materials_designer/workflows/band_gap.ipynbother/materials_designer/workflows/band_structure.ipynbother/materials_designer/workflows/band_structure_hse.ipynbother/materials_designer/workflows/equation_of_state.ipynbother/materials_designer/workflows/relaxation.ipynbother/materials_designer/workflows/surface_energy.ipynbother/materials_designer/workflows/total_energy.ipynbother/materials_designer/workflows/total_energy_post_processing.ipynbother/materials_designer/workflows/valence_band_offset.ipynbpyproject.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", |
There was a problem hiding this comment.
🧩 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/nullRepository: 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 || trueRepository: 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 || trueRepository: 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
fiRepository: 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" || trueRepository: 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" || trueRepository: 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" || trueRepository: 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
doneRepository: 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" || trueRepository: 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" || trueRepository: 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" || trueRepository: 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.
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
config.ymlpackages/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
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
config.ymlexamples/job/get-file-from-job.ipynbexamples/workflow/qe_scf_calculation.ipynb
✅ Files skipped from review due to trivial changes (1)
- config.yml
| "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", |
There was a problem hiding this comment.
🧩 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:
- 1: https://docs-new.mat3ra.com/rest-api/endpoints/
- 2: https://docs.mat3ra.com/rest-api/endpoints/
- 3: https://docs.mat3ra.com/rest-api/endpoints
- 4: https://docs.mat3ra.com/rest-api/api-client/
- 5: https://pypi.org/project/mat3ra-api-client/2026.2.28.post0/
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
examples/job/get-file-from-job.ipynbexamples/workflow/qe_scf_calculation.ipynbpyproject.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
| "mat3ra-mode", | ||
| "mat3ra-wode", |
There was a problem hiding this comment.
🧩 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:
- 1: https://pypi.org/project/mat3ra-mode/2026.5.29.post1/
- 2: https://pypi.org/project/mat3ra-wode/2026.5.29.post0/
- 3: https://pypi.org/project/mat3ra-mode/2026.5.29.post0/
- 4: https://pypi.org/project/mat3ra-ade/2026.5.29.post0/
🏁 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]}")
PYRepository: 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 || trueRepository: 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.
Summary by CodeRabbit
Bug Fixes
Chores