Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ notebooks:
- emfs:/drive/packages/pydantic-2.7.1-py3-none-any.whl
- pymatgen-analysis-defects<=2024.4.23
- mat3ra-periodic-table
- mat3ra-esse==2026.4.29.post0
- mat3ra-made>=2025.12.29.post0
- mat3ra-made
# packages below are used when made is installed from GH wheel (made should be installed from below)
# - https://exabyte-io.github.io/made/mat3ra_made-0.1.dev1+ge64d360b8-py3-none-any.whl
# - mat3ra-code
Expand All @@ -52,7 +51,7 @@ notebooks:
- emfs:/drive/packages/watchdog-2.3.1-py3-none-any.whl
- name: specific_examples
packages_pyodide:
- mat3ra-standata==2026.5.15.post0
- mat3ra-standata

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification:
# 1) confirm both unpinned entries in config
# 2) confirm reinstall gate depends on version operators

rg -n 'mat3ra-standata' config.yml
rg -n 'def package_has_version_specifier|def should_reinstall_package|VERSION_SPECIFIERS' src/py/mat3ra/notebooks_utils/pyodide/packages/install.py -n -A4 -B2

Repository: Exabyte-io/api-examples

Length of output: 791


Unpinning here can freeze stale versions in existing sessions and weaken reproducibility.

With mat3ra-standata fully unpinned (lines 54, 76), the installer's should_reinstall_package() gate no longer treats it as versioned, so profile changes won't force uninstall/reinstall for this package. Combined with hash-by-spec-string, this can leave older installed versions in long-lived environments even after newer releases exist.

Consider using a bounded spec like mat3ra-standata>=2026.5.15.post0 so it remains eligible for the version-specifier reinstall path while still allowing upgrades.

🤖 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 `@config.yml` at line 54, The mat3ra-standata package at line 54 is fully
unpinned, which prevents the installer from treating it as versioned and causes
it to not be reinstalled when profile changes occur, potentially leaving stale
versions in existing sessions. Replace the unpinned mat3ra-standata entry with a
bounded version specification such as mat3ra-standata>=2026.5.15.post0 to ensure
it remains eligible for version-specifier-based reinstall paths while still
allowing upgrades. Apply the same change to the mat3ra-standata reference at
line 76 to maintain consistency.

# - mat3ra-notebooks-utils[utils_standata]
- name: api
packages_pyodide:
Expand All @@ -74,13 +73,13 @@ notebooks:
- jinja2
- emfs:/drive/packages/pydantic_core-2.18.2-py3-none-any.whl
- emfs:/drive/packages/pydantic-2.7.1-py3-none-any.whl
- mat3ra-standata==2026.5.15.post0
- mat3ra-standata
- mat3ra-ide
- mat3ra-api-client
- requests
- mat3ra-ade==2026.4.29.post0
- mat3ra-mode==2026.3.4.post0
- mat3ra-wode==2026.5.23.post0
- mat3ra-ade
- mat3ra-mode
- mat3ra-wode
- mat3ra-prode
- name: torch
packages_pyodide:
Expand Down
8 changes: 4 additions & 4 deletions other/materials_designer/workflows/band_gap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -393,24 +393,24 @@
"\n",
"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",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" for unit_name in [\"pw_scf\", \"pw_scf_hse\"]:\n",
" unit = bg_subworkflow.get_unit_by_name(name=unit_name)\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" bg_subworkflow.set_unit(unit)\n",
"\n",
"if NSCF_KGRID is not None:\n",
" unit = bg_subworkflow.get_unit_by_name(name=\"pw_nscf\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=NSCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=NSCF_KGRID, isEdited=True).get_context_item_data())\n",
" bg_subworkflow.set_unit(unit)\n",
"\n",
"if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).yield_data()\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).get_context_item_data()\n",
" for unit_name in [\"pw_relax\", \"pw_vc-relax\", \"pw_scf\", \"pw_scf_hse\", \"pw_nscf\"]:\n",
" for swf in workflow.subworkflows:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
Expand Down
10 changes: 5 additions & 5 deletions other/materials_designer/workflows/band_structure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -403,29 +403,29 @@
"\n",
"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",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = bs_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" bs_subworkflow.set_unit(unit)\n",
"\n",
"if KPATH is not None:\n",
" unit = bs_subworkflow.get_unit_by_name(name=\"pw_bands\")\n",
" if unit:\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).yield_data())\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).get_context_item_data())\n",
" bs_subworkflow.set_unit(unit)\n",
"\n",
"if NSCF_KGRID is not None:\n",
" unit = bs_subworkflow.get_unit_by_name(name=\"pw_nscf\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=NSCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=NSCF_KGRID, isEdited=True).get_context_item_data())\n",
" bs_subworkflow.set_unit(unit)\n",
"\n",
"if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).yield_data()\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).get_context_item_data()\n",
" for unit_name in [\"pw_relax\", \"pw_vc-relax\", \"pw_scf\", \"pw_bands\", \"pw_nscf\"]:\n",
" for swf in workflow.subworkflows:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
Expand Down
12 changes: 6 additions & 6 deletions other/materials_designer/workflows/band_structure_hse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -408,29 +408,29 @@
"\n",
"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",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = preliminary_scf_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" preliminary_scf_subworkflow.set_unit(unit)\n",
"\n",
" unit = main_hse_subworkflow.get_unit_by_name(name=\"pw_scf_bands_hse\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(name=\"qgrid\", dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" unit.add_context(PointsGridDataProvider(name=\"qgrid\", dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" main_hse_subworkflow.set_unit(unit)\n",
"\n",
"if KPATH is not None:\n",
" unit = main_hse_subworkflow.get_unit_by_name(name=\"pw_scf_bands_hse\")\n",
" if unit:\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).yield_data())\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).get_context_item_data())\n",
" main_hse_subworkflow.set_unit(unit)\n",
"\n",
"if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).yield_data()\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).get_context_item_data()\n",
" for unit_name in [\"pw_relax\", \"pw_vc-relax\", \"pw_scf_bands_hse\"]:\n",
" for swf in workflow.subworkflows:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
Expand Down
11 changes: 5 additions & 6 deletions other/materials_designer/workflows/band_structure_magn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -429,23 +429,23 @@
"\n",
"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",
" workflow.subworkflows[0].set_unit(unit)\n",
"\n",
"if SCF_KGRID is not None:\n",
" unit = bs_subworkflow.get_unit_by_name(name=\"pw_scf_magn\")\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" bs_subworkflow.set_unit(unit)\n",
"\n",
"if KPATH is not None:\n",
" unit = bs_subworkflow.get_unit_by_name(name=\"pw_bands_magn\")\n",
" if unit:\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).yield_data())\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).get_context_item_data())\n",
" bs_subworkflow.set_unit(unit)\n",
"\n",
"if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).yield_data()\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True).get_context_item_data()\n",
" for unit_name in [\"pw_relax\", \"pw_vc-relax\", \"pw_scf_magn\", \"pw_bands_magn\"]:\n",
" for swf in workflow.subworkflows:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
Expand Down Expand Up @@ -586,8 +586,7 @@
" queue=QUEUE_NAME,\n",
" ppn=PPN\n",
")\n",
"print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}\")\n",
"compute.cluster"
"print(f\"Using cluster: {compute.cluster.hostname}, queue: {QUEUE_NAME}, ppn: {PPN}\")"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions other/materials_designer/workflows/equation_of_state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"WORKFLOW_SEARCH_TERM = \"total_energy.json\" # Search term for Workflows Standata\n",
"APPLICATION_NAME = \"espresso\" # Can be switched to another supported application\n",
"# Optional and mainly relevant for workflow/application combinations that expose a relaxation subworkflow.\n",
"ADD_RELAXATION = None\n",
"ADD_RELAXATION = False\n",
"\n",
"# Optional and mainly relevant for periodic plane-wave workflows such as Quantum ESPRESSO.\n",
"RELAXATION_KGRID = None # e.g., [4, 4, 4]\n",
Expand Down Expand Up @@ -424,14 +424,14 @@
"from mat3ra.wode.context.providers import PointsGridDataProvider\n",
"\n",
"if RELAXATION_KGRID is not None and ADD_RELAXATION:\n",
" new_context_relax = PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).yield_data()\n",
" new_context_relax = PointsGridDataProvider(dimensions=RELAXATION_KGRID, isEdited=True).get_context_item_data()\n",
" relaxation_subworkflow = workflow.subworkflows[0]\n",
" unit_to_modify_relax = relaxation_subworkflow.get_unit_by_name(name_regex=\"relax\")\n",
" unit_to_modify_relax.add_context(new_context_relax)\n",
" relaxation_subworkflow.set_unit(unit_to_modify_relax)\n",
"\n",
"if SCF_KGRID is not None:\n",
" new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data()\n",
" new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data()\n",
" total_energy_subworkflow = workflow.subworkflows[1 if ADD_RELAXATION else 0]\n",
" unit_to_modify_scf = total_energy_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" unit_to_modify_scf.add_context(new_context_scf)\n",
Expand Down
4 changes: 2 additions & 2 deletions other/materials_designer/workflows/relaxation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,12 @@
" for unit_name in relax_unit_names:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
" if unit:\n",
" unit.add_context(PointsGridDataProvider(dimensions=KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=KGRID, isEdited=True).get_context_item_data())\n",
" swf.set_unit(unit)\n",
"\n",
"if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(wavefunction=ECUTWFC, density=ECUTRHO,\n",
" isEdited=True).yield_data()\n",
" isEdited=True).get_context_item_data()\n",
" for swf in workflow.subworkflows:\n",
" for unit_name in relax_unit_names:\n",
" unit = swf.get_unit_by_name(name=unit_name)\n",
Expand Down
2 changes: 1 addition & 1 deletion other/materials_designer/workflows/surface_energy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"\n",
"def apply_workflow_kgrids(workflow: Workflow, scf_kgrid=None) -> Workflow:\n",
" if scf_kgrid is not None:\n",
" new_context_scf = PointsGridDataProvider(dimensions=scf_kgrid, isEdited=True).yield_data()\n",
" new_context_scf = PointsGridDataProvider(dimensions=scf_kgrid, isEdited=True).get_context_item_data()\n",
" for subworkflow in workflow.subworkflows:\n",
" unit_names = [unit.name for unit in subworkflow.units]\n",
" if \"pw_scf\" not in unit_names:\n",
Expand Down
6 changes: 3 additions & 3 deletions other/materials_designer/workflows/total_energy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"# 4. Workflow parameters\n",
"WORKFLOW_SEARCH_TERM = \"total_energy.json\" # Search term for Workflows Standata\n",
"APPLICATION_NAME = \"espresso\" # Specify application name (e.g., \"espresso\", \"vasp\", \"nwchem\")\n",
"ADD_RELAXATION = None # Whether to add relaxation subworkflow as first unit\n",
"ADD_RELAXATION = False # Whether to add relaxation subworkflow as first unit\n",
"\n",
"# set k-grid for relaxation and SCF (if not set, KPPRA is used by default)\n",
"RELAXATION_KGRID = None # e.g., [4, 4, 4]\n",
Expand Down Expand Up @@ -378,14 +378,14 @@
"\n",
"if RELAXATION_KGRID is not None and ADD_RELAXATION:\n",
" new_context_relax = PointsGridDataProvider(dimensions=RELAXATION_KGRID,\n",
" isEdited=True).yield_data() if ADD_RELAXATION else None\n",
" isEdited=True).get_context_item_data() if ADD_RELAXATION else None\n",
" relaxation_subworkflow = workflow.subworkflows[0]\n",
" unit_to_modify_relax = relaxation_subworkflow.get_unit_by_name(name_regex=\"relax\")\n",
" unit_to_modify_relax.add_context(new_context_relax)\n",
" relaxation_subworkflow.set_unit(unit_to_modify_relax)\n",
"\n",
"if SCF_KGRID is not None:\n",
" new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data()\n",
" new_context_scf = PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data()\n",
" band_gap_subworkflow = workflow.subworkflows[1 if ADD_RELAXATION else 0]\n",
" unit_to_modify_scf = band_gap_subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" unit_to_modify_scf.add_context(new_context_scf)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@
"\n",
"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",
" 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).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" pp_subworkflow.set_unit(unit)\n",
"\n",
"visualize_workflow(workflow)"
Expand Down
6 changes: 3 additions & 3 deletions other/materials_designer/workflows/valence_band_offset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -444,18 +444,18 @@
"\n",
" if SCF_KGRID is not None and \"pw_scf\" in unit_names:\n",
" unit = subworkflow.get_unit_by_name(name=\"pw_scf\")\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).yield_data())\n",
" unit.add_context(PointsGridDataProvider(dimensions=SCF_KGRID, isEdited=True).get_context_item_data())\n",
" subworkflow.set_unit(unit)\n",
"\n",
" if KPATH is not None and \"pw_bands\" in unit_names:\n",
" unit = subworkflow.get_unit_by_name(name=\"pw_bands\")\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).yield_data())\n",
" unit.add_context(PointsPathDataProvider(path=KPATH, isEdited=True).get_context_item_data())\n",
" subworkflow.set_unit(unit)\n",
"\n",
" if ECUTWFC is not None:\n",
" cutoffs_context = PlanewaveCutoffsContextProvider(\n",
" wavefunction=ECUTWFC, density=ECUTRHO, isEdited=True\n",
" ).yield_data()\n",
" ).get_context_item_data()\n",
" for unit_name in scf_unit_names:\n",
" if unit_name not in unit_names:\n",
" continue\n",
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jupyterlite = [
]
utils_standata = [
"mat3ra-utils",
"mat3ra-standata==2026.5.15.post0",
"mat3ra-standata",
]
api = [
"mat3ra-api-client",
Expand All @@ -36,15 +36,15 @@ materials = [
"mat3ra-notebooks-utils[utils_standata]",
"pymatgen==2024.4.13",
"pymatgen-analysis-defects<=2024.4.23",
"mat3ra-made>=2026.4.2.post0",
"mat3ra-made",
"mat3ra-periodic-table"
]
workflows = [
"mat3ra-notebooks-utils[materials]",
"mat3ra-esse==2026.4.29.post0",
"mat3ra-mode==2026.3.4.post0",
"mat3ra-wode==2026.5.23.post0",
"mat3ra-ade==2026.4.29.post0",
"mat3ra-esse",
"mat3ra-mode",
"mat3ra-wode",
"mat3ra-ade",
"mat3ra-prode",
"mat3ra-ide",
"mat3ra-notebooks-utils[api]"
Expand Down
18 changes: 4 additions & 14 deletions src/py/mat3ra/notebooks_utils/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,17 @@ def patch_workflow_qe_input(
Example:
patch_workflow_qe_input(workflow, {"system": {"vdw_corr": "d3_grimme"}}, ["pw_relax"])
"""
# TODO: remove the dict handling when WA is updated, and use latest Standata/Wode/Ade here
for subworkflow in workflow.subworkflows:
for unit_name in unit_names:
if not (unit := subworkflow.get_unit_by_name(name=unit_name)):
continue
for input_item in getattr(unit, "input", []):
if isinstance(input_item, dict):
template_name = input_item.get("name")
content = input_item.get("content")
else:
template = input_item.template
template_name = template.name
content = template.content
template = input_item.template
template_name = template.name
content = template.content

if input_name not in (None, template_name):
continue
if content is None:
continue

for section, updates in parameters.items():
name = section.lstrip("&")
Expand All @@ -63,9 +56,6 @@ def patch_workflow_qe_input(
body = re.sub(pattern, line, body) if re.search(pattern, body) else f"{body.rstrip()}\n{line}\n"
content = content[: match.start()] + header + body + footer + content[match.end() :]

if isinstance(input_item, dict):
input_item["content"] = content
else:
template.set_content(content)
template.set_content(content)
subworkflow.set_unit(unit)
return workflow
Loading