Skip to content

update: new urls#336

Merged
VsevolodX merged 3 commits into
mainfrom
fix/urls
Jun 22, 2026
Merged

update: new urls#336
VsevolodX merged 3 commits into
mainfrom
fix/urls

Conversation

@VsevolodX

@VsevolodX VsevolodX commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Updated Wave and Prove visualization viewer assets to new external sources.
  • Refactor
    • Improved how workflow context data for k-grids, k-paths, and plane-wave cutoffs is generated and injected into subworkflows.
  • Bug Fixes
    • Prevented mismatches in workflow parameter application by switching to the newer context-data output method.
  • Documentation
    • Updated band-structure defaults and k-path label examples (including switching examples to “Г” and changing the default target to Graphene).

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Two viewer JavaScript bundle URLs are updated from exabyte-io.github.io to mat3ra.github.io: the Wave viewer in material/visualize.py and the Prove viewer in property/visualize.py. Independently, workflow notebooks across Materials Designer are updated to use yield_data() instead of get_context_item_data() when generating context payloads for grid, path, and cutoff parameters. The band-structure workflow also changes its default material from Silicon to Graphene and sets an explicit k-path definition. Example k-path notation is standardized to use "Г" across workflows.

Changes

Viewer Bundle URL Migration

Layer / File(s) Summary
Update Wave and Prove viewer bundle URLs
src/py/mat3ra/notebooks_utils/ipython/entity/material/visualize.py, src/py/mat3ra/notebooks_utils/ipython/entity/property/visualize.py
bundle_url for the Wave viewer is switched to https://mat3ra.github.io/wave.js/main.js and the Prove viewer JS URL is switched to https://mat3ra.github.io/prove/main.js.

Workflow Data Provider Method Migration

Layer / File(s) Summary
Band-structure workflow parameter defaults
other/materials_designer/workflows/band_structure.ipynb
The default MATERIAL_NAME parameter is changed from Silicon to Graphene, and KPATH is set from None to an explicit k-path definition with labeled high-symmetry points including repeated "Г" endpoints.
Data provider context method migration across workflows
other/materials_designer/workflows/band_structure.ipynb, other/materials_designer/workflows/band_structure_hse.ipynb, other/materials_designer/workflows/band_gap.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
Workflow context generation is refactored to call yield_data() instead of get_context_item_data() on PointsGridDataProvider, PointsPathDataProvider, and PlanewaveCutoffsContextProvider instances when building context payloads for subworkflow units. Example k-path notation in band_structure_hse and valence_band_offset is standardized from "G" to "Г".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 From exabyte to mat3ra's home,
The viewers find a fresher zone.
Data flows through yield instead,
Context shapes get gently spread.
Silicon bows to Graphene's grace—
A rabbit's leap to a better place! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'update: new urls' is vague and generic, failing to convey what specific URLs were updated or their purpose. Revise the title to be more specific, such as 'Update bundle URLs from exabyte-io to mat3ra endpoints' or 'Refactor context data providers to use yield_data() method', to clearly indicate the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 fix/urls

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.18)
other/materials_designer/workflows/total_energy.ipynb

Unexpected end of JSON input

other/materials_designer/workflows/band_structure.ipynb

Unexpected end of JSON input

other/materials_designer/workflows/surface_energy.ipynb

Unexpected end of JSON input

  • 6 others

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.

@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: 1

Caution

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

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

427-438: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Guard unit lookups before calling add_context.

Line 430 and Line 437 dereference unit lookups unconditionally. If a selected workflow does not include relax or pw_scf, notebook execution will fail at runtime.

Suggested fix
 if RELAXATION_KGRID is not None and ADD_RELAXATION:
     new_context_relax = PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data()
     relaxation_subworkflow = workflow.subworkflows[0]
     unit_to_modify_relax = relaxation_subworkflow.get_unit_by_name(name_regex="relax")
-    unit_to_modify_relax.add_context(new_context_relax)
-    relaxation_subworkflow.set_unit(unit_to_modify_relax)
+    if unit_to_modify_relax:
+        unit_to_modify_relax.add_context(new_context_relax)
+        relaxation_subworkflow.set_unit(unit_to_modify_relax)

 if SCF_KGRID is not None:
     new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data()
     total_energy_subworkflow = workflow.subworkflows[1 if ADD_RELAXATION else 0]
     unit_to_modify_scf = total_energy_subworkflow.get_unit_by_name(name="pw_scf")
-    unit_to_modify_scf.add_context(new_context_scf)
-    total_energy_subworkflow.set_unit(unit_to_modify_scf)
+    if unit_to_modify_scf:
+        unit_to_modify_scf.add_context(new_context_scf)
+        total_energy_subworkflow.set_unit(unit_to_modify_scf)
🤖 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/equation_of_state.ipynb` around lines 427
- 438, Add guard checks before calling add_context on the unit lookups to
prevent runtime failures when units are not found. After calling
get_unit_by_name for the relax unit in the relaxation_subworkflow and the pw_scf
unit in the total_energy_subworkflow, check that the returned unit is not None
before proceeding with add_context and set_unit calls. Wrap the add_context and
set_unit operations for unit_to_modify_relax and unit_to_modify_scf in
conditional blocks that verify the units were found successfully.
other/materials_designer/workflows/total_energy.ipynb (1)

381-392: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle missing workflow units before mutation.

Line 384 and Line 391 call add_context without verifying lookup success. When the target unit is absent, this raises and interrupts execution.

Suggested fix
 if RELAXATION_KGRID is not None and ADD_RELAXATION:
     new_context_relax = PointsGridDataProvider(dimensions=RELAXATION_KGRID,
                                                isEdited=True).yield_data() if ADD_RELAXATION else None
     relaxation_subworkflow = workflow.subworkflows[0]
     unit_to_modify_relax = relaxation_subworkflow.get_unit_by_name(name_regex="relax")
-    unit_to_modify_relax.add_context(new_context_relax)
-    relaxation_subworkflow.set_unit(unit_to_modify_relax)
+    if unit_to_modify_relax:
+        unit_to_modify_relax.add_context(new_context_relax)
+        relaxation_subworkflow.set_unit(unit_to_modify_relax)

 if SCF_KGRID is not None:
     new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data()
     band_gap_subworkflow = workflow.subworkflows[1 if ADD_RELAXATION else 0]
     unit_to_modify_scf = band_gap_subworkflow.get_unit_by_name(name="pw_scf")
-    unit_to_modify_scf.add_context(new_context_scf)
-    band_gap_subworkflow.set_unit(unit_to_modify_scf)
+    if unit_to_modify_scf:
+        unit_to_modify_scf.add_context(new_context_scf)
+        band_gap_subworkflow.set_unit(unit_to_modify_scf)
🤖 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.ipynb` around lines 381 -
392, The code calls add_context and set_unit on the results of get_unit_by_name
without verifying that the lookup was successful. Add null/None checks after
both get_unit_by_name calls (one for the relaxation unit with name_regex="relax"
and one for the SCF unit with name="pw_scf") to ensure the returned units exist
before attempting to call add_context and set_unit on them. This prevents
execution interruption when a target unit is not found in the workflow.
🤖 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`:
- Around line 465-473: The unit lookups in both if blocks do not validate that
get_unit_by_name() successfully found a unit before calling add_context() on it.
Add a None check after each unit lookup (the first with name_regex="relax" in
the RELAXATION_KGRID block and the second with name="pw_scf" in the SCF_KGRID
block) to ensure the unit exists before attempting to call add_context() and
set_unit(). Wrap the add_context() and set_unit() calls inside a conditional
that only executes if the retrieved unit is not None to prevent AttributeError
crashes.

---

Outside diff comments:
In `@other/materials_designer/workflows/equation_of_state.ipynb`:
- Around line 427-438: Add guard checks before calling add_context on the unit
lookups to prevent runtime failures when units are not found. After calling
get_unit_by_name for the relax unit in the relaxation_subworkflow and the pw_scf
unit in the total_energy_subworkflow, check that the returned unit is not None
before proceeding with add_context and set_unit calls. Wrap the add_context and
set_unit operations for unit_to_modify_relax and unit_to_modify_scf in
conditional blocks that verify the units were found successfully.

In `@other/materials_designer/workflows/total_energy.ipynb`:
- Around line 381-392: The code calls add_context and set_unit on the results of
get_unit_by_name without verifying that the lookup was successful. Add null/None
checks after both get_unit_by_name calls (one for the relaxation unit with
name_regex="relax" and one for the SCF unit with name="pw_scf") to ensure the
returned units exist before attempting to call add_context and set_unit on them.
This prevents execution interruption when a target unit is not found in the
workflow.
🪄 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: cd80dfef-23a4-48e7-8875-ee79cc47eddc

📥 Commits

Reviewing files that changed from the base of the PR and between 38384c3 and d3a8040.

📒 Files selected for processing (9)
  • 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

Comment on lines 465 to 473
"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).get_context_item_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data())\n",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = pp_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" pp_subworkflow.set_unit(unit)\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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Guard unit lookups before add_context to prevent runtime crashes.

Line 467 and Line 472 dereference unit without checking lookup success. If a unit name changes or is absent in a selected workflow variant, this cell will fail with AttributeError.

Proposed fix
 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).yield_data())
-    workflow.subworkflows[0].set_unit(unit)
+    if unit:
+        unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_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).yield_data())
-    pp_subworkflow.set_unit(unit)
+    if unit:
+        unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())
+        pp_subworkflow.set_unit(unit)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"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).get_context_item_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data())\n",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = pp_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" pp_subworkflow.set_unit(unit)\n",
"if RELAXATION_KGRID is not None and ADD_RELAXATION:\n",
" unit = workflow.subworkflows[0].get_unit_by_name(name_regex=\"relax\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data())\n",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = pp_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" pp_subworkflow.set_unit(unit)\n",
🤖 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 465 - 473, The unit lookups in both if blocks do not validate that
get_unit_by_name() successfully found a unit before calling add_context() on it.
Add a None check after each unit lookup (the first with name_regex="relax" in
the RELAXATION_KGRID block and the second with name="pw_scf" in the SCF_KGRID
block) to ensure the unit exists before attempting to call add_context() and
set_unit(). Wrap the add_context() and set_unit() calls inside a conditional
that only executes if the retrieved unit is not None to prevent AttributeError
crashes.

@VsevolodX VsevolodX merged commit c950fa1 into main Jun 22, 2026
8 checks passed
@VsevolodX VsevolodX deleted the fix/urls branch June 22, 2026 21:35
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