Skip to content

Conversation

@VsevolodX
Copy link
Member

@VsevolodX VsevolodX commented Jan 22, 2026

Summary by CodeRabbit

  • Chores

    • Migrated examples and utilities to the new mat3ra-api-client namespace and consolidated dependency entries in project config.
    • Removed legacy exabyte-api-client references from configs and bootstraps.
  • New Features

    • Added account/organization selection and ownership context in a workflow example so creations can use an organization account.
    • Standardized the compute-configuration call name used across examples.

✏️ Tip: You can customize this high-level summary in your review settings.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Updated examples, scripts, and utilities to import endpoint clients from mat3ra.api_client instead of exabyte_api_client, replaced some get_compute(...) calls with build_compute_config(...), and consolidated the dependency to mat3ra-api-client. No other functional control-flow changes.

Changes

Cohort / File(s) Summary
Job Examples
examples/job/create_and_submit_job.ipynb, examples/job/get-file-from-job.ipynb, examples/job/ml-train-model-predict-properties.ipynb, examples/job/run-simulations-and-extract-properties.ipynb
Replaced exabyte_api_client.endpoints.* imports with mat3ra.api_client.endpoints.*; some notebooks switch get_compute(...)build_compute_config(...).
Material Examples
examples/material/create_material.ipynb, examples/material/get_materials_by_formula.ipynb, examples/material/upload_materials_from_file_poscar.ipynb
Switched MaterialEndpoints import to mat3ra.api_client.endpoints.materials.
Publication Examples
examples/reproducing_publications/.../band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb, examples/reproducing_publications/.../band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb
Migrated multiple endpoint imports (Material, BankWorkflow, Workflow, Project, Job, Properties) to mat3ra.api_client.endpoints.*.
System & Auth Examples
examples/system/get_authentication_params.ipynb
Updated LoginEndpoint import to mat3ra.api_client.endpoints.login.
Workflow Examples
examples/workflow/get_workflows.ipynb, examples/workflow/qe_scf_calculation.ipynb
Updated imports to mat3ra.api_client.endpoints.*; replaced get_compute(...) with build_compute_config(...) where present.
Other Examples & Scripts
other/jarvis/run_job_using_material_from_jarvis_db.ipynb, other/materialsproject/api_interoperability_showcase.ipynb, other/materialsproject/api_interoperability_showcase.py, other/materialsproject/import_materials_from_materialsproject.ipynb, other/materialsproject/import_materials_from_materialsproject.py, other/webinar/adsorption-study.py, other/webinar/generate-al2o3-slab-structures.py, other/webinar/wulff-construction-surface-energy-study-cu.py
Replaced exabyte_api_client.endpoints.* imports with mat3ra.api_client.endpoints.*; several scripts updated compute call to build_compute_config(...).
Materials Designer Notebook
other/materials_designer/workflows/band_gap.ipynb
Added account/organization selection (ACCOUNT_ID) to set owner context; migrated imports to mat3ra.api_client.*; replaced get_compute(...) with build_compute_config(...).
Utility Modules
utils/api.py, utils/material.py, utils/auth.py
Updated internal imports to use mat3ra.api_client and endpoint modules; minor import path adjustments.
Dependency & Config
pyproject.toml, config.yml
Consolidated dependencies to mat3ra-api-client (pinned); removed exabyte-api-client from notebook config.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • timurbazhirov

Poem

🐇 I hopped through imports, swift and spry,
From exabyte paths to mat3ra sky.
I nudged a compute name and straightened each line,
Notebooks now purr as the endpoints align. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating from exabyte_api_client to mat3ra.api_client package across all examples and utilities.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (1)
other/materialsproject/api_interoperability_showcase.ipynb (1)

97-100: Replace exabyte-api-client with mat3ra-api-client in the JupyterLite install cell.

The notebook installs exabyte-api-client in the emscripten block but imports from mat3ra.api_client. Since mat3ra-api-examples is installed with deps=False, the mat3ra.api_client module won't be available, causing an import failure in JupyterLite.

Fix
-    await micropip.install("exabyte-api-client")
+    await micropip.install("mat3ra-api-client")
🤖 Fix all issues with AI agents
In
`@examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb`:
- Line 394: The notebook mixes root-level and submodule imports for API endpoint
classes (e.g., BankWorkflowEndpoints, WorkflowEndpoints, ProjectEndpoints);
standardize them by replacing any imports from mat3ra.api_client that reference
endpoint classes with explicit imports from their endpoints submodules (e.g.,
mat3ra.api_client.endpoints.*) so all endpoint classes (BankWorkflowEndpoints,
WorkflowEndpoints, ProjectEndpoints, MaterialEndpoints, JobEndpoints,
PropertiesEndpoints, etc.) are imported via their endpoints.* modules for
consistency and compatibility.

In
`@examples/reproducing_publications/band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb`:
- Line 647: Import uses a top-level re-export; replace it with the canonical
submodule path to match the rest of the notebook. Change the import statement
that currently reads "from mat3ra.api_client import ProjectEndpoints" to "from
mat3ra.api_client.endpoints.projects import ProjectEndpoints" so the
ProjectEndpoints symbol is imported from mat3ra.api_client.endpoints.projects
and remains consistent with other cells.

In `@examples/workflow/qe_scf_calculation.ipynb`:
- Around line 148-150: The imports for WorkflowEndpoints, MaterialEndpoints, and
JobEndpoints are using the wrong module path; replace the current
mat3ra.api_client.endpoints imports with the correct
exabyte_api_client.endpoints imports so that WorkflowEndpoints,
MaterialEndpoints, and JobEndpoints are imported from
exabyte_api_client.endpoints instead of mat3ra.api_client.endpoints.
🧹 Nitpick comments (3)
utils/material.py (1)

14-29: Consider updating docstring references to the new package name.

The docstring at line 20 still references "Exabyte API Client". For consistency with the namespace migration, consider updating to "Mat3ra API Client". Similarly, line 162 references "Exabyte platform".

utils/api.py (1)

14-27: Consider updating docstring references.

Multiple docstrings in this file still reference "Exabyte API Client" (lines 20, 48, 64). For consistency with the namespace migration, consider updating these to "Mat3ra API Client".

pyproject.toml (1)

11-11: Confirm the VCS dependency strategy for mat3ra-api-client.
Pinned git URLs can be fine, but they require VCS-capable installers and can complicate reproducible builds. If a tagged release exists, consider pinning to a versioned release instead; otherwise, please confirm the commit is stable and intended for long-term use.

"outputs": [],
"source": [
"from exabyte_api_client import BankWorkflowEndpoints, WorkflowEndpoints\n",
"from mat3ra.api_client import BankWorkflowEndpoints, WorkflowEndpoints\n",
Copy link

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:

# First, let's check the notebook file to see the actual imports at those lines
cd examples/reproducing_publications && wc -l band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb

Repository: Exabyte-io/api-examples

Length of output: 190


🏁 Script executed:

# Let's find the mat3ra package structure
find . -type d -name "mat3ra" | head -5

Repository: Exabyte-io/api-examples

Length of output: 49


🏁 Script executed:

# Search for the mat3ra.api_client package __init__.py to check for re-exports
find . -path "*/mat3ra/api_client/__init__.py" 2>/dev/null

Repository: Exabyte-io/api-examples

Length of output: 49


🏁 Script executed:

# Let's also check what import patterns are used in the notebook
rg "from mat3ra" examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb -o | head -20

Repository: Exabyte-io/api-examples

Length of output: 234


🏁 Script executed:

# List files to understand the repo structure
git ls-files | grep -E "(mat3ra|\.ipynb)" | head -30

Repository: Exabyte-io/api-examples

Length of output: 1746


🏁 Script executed:

# Find the notebook file
fd "band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb"

Repository: Exabyte-io/api-examples

Length of output: 167


🏁 Script executed:

# Check if mat3ra is a local package or external dependency
find . -type f -name "__init__.py" | grep mat3ra

Repository: Exabyte-io/api-examples

Length of output: 49


🏁 Script executed:

# Look for imports in setup.py or requirements to understand mat3ra
fd -e txt -e cfg -e toml -e lock | xargs grep -l "mat3ra" 2>/dev/null | head -5

Repository: Exabyte-io/api-examples

Length of output: 81


🏁 Script executed:

# Check pyproject.toml for mat3ra dependency
cat pyproject.toml | grep -A 5 -B 5 "mat3ra"

Repository: Exabyte-io/api-examples

Length of output: 991


🏁 Script executed:

# Read the notebook file and extract cells around lines 394 and 641
# Notebooks are JSON, so we need to parse them carefully
python <<'EOF'
import json
import sys

# Read the notebook
with open('examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb', 'r') as f:
    nb = json.load(f)

# Count lines to find which cells correspond to lines 394 and 641
# Jupyter notebooks list cells, we need to find imports
line_count = 0
for i, cell in enumerate(nb['cells']):
    if cell['cell_type'] == 'code':
        source = ''.join(cell.get('source', []))
        cell_lines = len(source.split('\n'))
        
        # Check if this cell contains imports from mat3ra
        if 'from mat3ra' in source or 'import mat3ra' in source:
            print(f"\n=== Cell {i} (lines {line_count}-{line_count + cell_lines}) ===")
            print(source)
        
        line_count += cell_lines

EOF

Repository: Exabyte-io/api-examples

Length of output: 4982


🏁 Script executed:

# Now let's check if mat3ra-api-client is available and what it re-exports
# First, let's see if there's any local version or if we can inspect the dependency
python <<'EOF'
# Try to get more info about the mat3ra-api-client package from pyproject.toml
import re

with open('pyproject.toml', 'r') as f:
    content = f.read()
    # Find the mat3ra-api-client dependency line
    match = re.search(r'mat3ra-api-client.*', content)
    if match:
        print("Found dependency:")
        print(match.group())
EOF

Repository: Exabyte-io/api-examples

Length of output: 196


🌐 Web query:

mat3ra-api-client BankWorkflowEndpoints WorkflowEndpoints re-export root package __init__.py

💡 Result:

You can re-export those endpoint classes from the package root by importing them into the package init.py and declaring all. Example (put in mat3ra_api_client/init.py):

from .bank_workflow import BankWorkflowEndpoints
from .workflow import WorkflowEndpoints

all = ["BankWorkflowEndpoints", "WorkflowEndpoints"]

Notes:

  • Use explicit imports (not wildcard) so tools and linters know the public API. [1][2]
  • If you need to preserve backwards-compatibility when renaming, import using "as" and keep the old name in all. [3]

Sources:
[1] Correct way to re-export modules from init.py (StackOverflow).
[2] Best practices for re-exporting via all (pythontutorials.net).
[3] Discussion about explicit re-exports in init.py (mypy / GitHub issue).


🌐 Web query:

site:github.com Exabyte-io api-client endpoints BankWorkflowEndpoints

💡 Result:

I couldn't find any GitHub file or symbol named "BankWorkflowEndpoints" in the Exabyte-io (Exabyte-io / Mat3ra) repositories. I searched Exabyte's GitHub org and their API client/docs but found no match for that exact identifier. Sources: Exabyte GitHub org and Mat3ra/Exabyte API client docs. [1][2]

Would you like me to:

  • search the Exabyte repo contents for related names (e.g., "bank workflow", "BankWorkflow", "endpoints")? or
  • search other organizations/repos for "BankWorkflowEndpoints"?

Sources:
[1] Exabyte-io — GitHub organization page (repo list).
[2] Mat3ra (Exabyte) REST API / API client documentation.


🏁 Script executed:

# Let's check the actual line numbers in the notebook more carefully
python <<'EOF'
import json

with open('examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb', 'r') as f:
    nb = json.load(f)

# Count actual line numbers across all content
line_count = 0
for i, cell in enumerate(nb['cells']):
    if cell['cell_type'] == 'code':
        source = ''.join(cell.get('source', []))
        lines = source.split('\n')
        
        for j, line in enumerate(lines):
            line_count += 1
            if 'BankWorkflowEndpoints' in line or 'WorkflowEndpoints' in line or 'ProjectEndpoints' in line:
                print(f"Line {line_count} (Cell {i}): {line.strip()}")

EOF

Repository: Exabyte-io/api-examples

Length of output: 615


🏁 Script executed:

# Let's check the imported package's actual structure
# The package is at a specific commit, let's see if we can inspect what endpoints are available
python <<'EOF'
import json

# Parse the notebook to see all imports of mat3ra.api_client
with open('examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb', 'r') as f:
    nb = json.load(f)

root_imports = {}
endpoint_imports = {}

for cell in nb['cells']:
    if cell['cell_type'] == 'code':
        source = ''.join(cell.get('source', []))
        
        # Find all from mat3ra imports
        for line in source.split('\n'):
            line = line.strip()
            if line.startswith('from mat3ra.api_client import'):
                # Root level import
                imported = line.replace('from mat3ra.api_client import ', '').strip()
                root_imports[imported] = root_imports.get(imported, 0) + 1
            elif 'from mat3ra.api_client.endpoints' in line:
                # Endpoints import
                endpoint_imports[line] = endpoint_imports.get(line, 0) + 1

print("=== Root-level imports (from mat3ra.api_client) ===")
for imp, count in sorted(root_imports.items()):
    print(f"{imp}: {count} time(s)")

print("\n=== Endpoints imports (from mat3ra.api_client.endpoints.*) ===")
for imp, count in sorted(endpoint_imports.items()):
    print(f"{imp}: {count} time(s)")

EOF

Repository: Exabyte-io/api-examples

Length of output: 569


Inconsistent import patterns for API endpoints—standardize to endpoints.* imports.

The notebook mixes root-level and endpoint-specific imports:

  • Line 129 (Cell 27): from mat3ra.api_client import BankWorkflowEndpoints, WorkflowEndpoints
  • Line 196 (Cell 47): from mat3ra.api_client import ProjectEndpoints
  • Line 176 (Cell 43): from mat3ra.api_client.endpoints.projects import ProjectEndpoints

The majority of other endpoint classes (MaterialEndpoints, JobEndpoints, PropertiesEndpoints) use the endpoints.* path. ProjectEndpoints itself is imported both ways, creating inconsistency. To ensure compatibility and consistency, standardize all endpoint imports to use the explicit endpoints.* submodules:

♻️ Suggested fix
-from mat3ra.api_client import BankWorkflowEndpoints, WorkflowEndpoints
+from mat3ra.api_client.endpoints.bank_workflows import BankWorkflowEndpoints
+from mat3ra.api_client.endpoints.workflows import WorkflowEndpoints
-from mat3ra.api_client import ProjectEndpoints
+from mat3ra.api_client.endpoints.projects import ProjectEndpoints
📝 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
"from mat3ra.api_client import BankWorkflowEndpoints, WorkflowEndpoints\n",
"from mat3ra.api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n",
"from mat3ra.api_client.endpoints.workflows import WorkflowEndpoints\n",
🤖 Prompt for AI Agents
In
`@examples/reproducing_publications/band_gaps_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb`
at line 394, The notebook mixes root-level and submodule imports for API
endpoint classes (e.g., BankWorkflowEndpoints, WorkflowEndpoints,
ProjectEndpoints); standardize them by replacing any imports from
mat3ra.api_client that reference endpoint classes with explicit imports from
their endpoints submodules (e.g., mat3ra.api_client.endpoints.*) so all endpoint
classes (BankWorkflowEndpoints, WorkflowEndpoints, ProjectEndpoints,
MaterialEndpoints, JobEndpoints, PropertiesEndpoints, etc.) are imported via
their endpoints.* modules for consistency and compatibility.

"outputs": [],
"source": [
"from exabyte_api_client import ProjectEndpoints\n",
"from mat3ra.api_client import ProjectEndpoints\n",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, check if the notebook file exists and read it
if [ -f "examples/reproducing_publications/band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb" ]; then
  echo "=== File exists ==="
  # Extract line 647 context from notebook
  python3 << 'EOF'
import json
import sys

with open("examples/reproducing_publications/band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb", 'r') as f:
    notebook = json.load(f)

# Search for the import statement in cells
for i, cell in enumerate(notebook.get('cells', [])):
    if cell.get('cell_type') == 'code':
        source = ''.join(cell.get('source', []))
        if 'ProjectEndpoints' in source:
            print(f"\n=== Cell {i} ===")
            print(source)
            print("---")
        if 'from mat3ra.api_client' in source:
            print(f"\n=== Cell {i} (mat3ra import) ===")
            print(source)
            print("---")
EOF
else
  echo "File not found"
fi

Repository: Exabyte-io/api-examples

Length of output: 4543


🏁 Script executed:

#!/bin/bash
# Search for mat3ra package in the codebase to understand structure
echo "=== Looking for mat3ra package files ==="
find . -type f -path "*/mat3ra/*__init__.py" 2>/dev/null | head -20
find . -type f -name "*endpoints*" -o -name "*ProjectEndpoints*" 2>/dev/null | head -20

Repository: Exabyte-io/api-examples

Length of output: 107


🏁 Script executed:

#!/bin/bash
# Search for ProjectEndpoints references and imports in codebase
echo "=== Searching for ProjectEndpoints usage ==="
rg "ProjectEndpoints" -A 2 -B 2 --max-count 30

Repository: Exabyte-io/api-examples

Length of output: 13000


Align ProjectEndpoints import with the submodule path used elsewhere in the file.
This cell uses from mat3ra.api_client import ProjectEndpoints while Cell 43 in the same notebook imports from mat3ra.api_client.endpoints.projects. The full submodule path is also the standard across the entire codebase, providing clearer intent and avoiding reliance on potentially inconsistent top-level re-exports.

♻️ Suggested change
-from mat3ra.api_client import ProjectEndpoints
+from mat3ra.api_client.endpoints.projects import ProjectEndpoints
📝 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
"from mat3ra.api_client import ProjectEndpoints\n",
"from mat3ra.api_client.endpoints.projects import ProjectEndpoints\n",
🤖 Prompt for AI Agents
In
`@examples/reproducing_publications/band_structure_for_interface_bilayer_twisted_molybdenum_disulfide.ipynb`
at line 647, Import uses a top-level re-export; replace it with the canonical
submodule path to match the rest of the notebook. Change the import statement
that currently reads "from mat3ra.api_client import ProjectEndpoints" to "from
mat3ra.api_client.endpoints.projects import ProjectEndpoints" so the
ProjectEndpoints symbol is imported from mat3ra.api_client.endpoints.projects
and remains consistent with other cells.

Comment on lines +148 to +150
"from mat3ra.api_client.endpoints.workflows import WorkflowEndpoints\n",
"from mat3ra.api_client.endpoints.materials import MaterialEndpoints\n",
"from mat3ra.api_client.endpoints.jobs import JobEndpoints"
Copy link

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:

# Find dependency/requirements files to identify pinned mat3ra-api-client version
find . -type f \( -name "requirements*.txt" -o -name "setup.py" -o -name "pyproject.toml" -o -name "setup.cfg" -o -name "Pipfile" \) | head -20

Repository: Exabyte-io/api-examples

Length of output: 190


🌐 Web query:

mat3ra-api-client WorkflowEndpoints MaterialEndpoints JobEndpoints endpoints documentation

💡 Result:

You can find the Mat3ra (Exabyte) REST API endpoints and the Python API-client docs/examples here:

  • API Endpoints overview & list (endpoints documentation). [1]
  • API client (Python) page describing the exabyte/mat3ra API client. [2]
  • Example notebook showing use of JobEndpoints, MaterialEndpoints, WorkflowEndpoints (imports and example usage). [3]
  • Material endpoint example (listing materials by formula). [4]

Quick usage (from the examples): import and initialize the endpoint classes from the Python client:
from exabyte_api_client.endpoints.jobs import JobEndpoints
from exabyte_api_client.endpoints.materials import MaterialEndpoints
from exabyte_api_client.endpoints.workflows import WorkflowEndpoints
job_endpoints = JobEndpoints(*ENDPOINT_ARGS)
material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)
workflow_endpoints = WorkflowEndpoints(*ENDPOINT_ARGS)

References:
[1] Mat3ra — Endpoints (REST API).
[2] Mat3ra — API client (Python).
[3] Mat3ra — Create and submit job (API examples, shows Job/Material/Workflow endpoints).
[4] Mat3ra — Get materials by formula (API examples).


Fix incorrect endpoint import paths.
The imports use mat3ra.api_client.endpoints but the official mat3ra-api-client package exports these endpoints from exabyte_api_client.endpoints. Update lines 148-150 to:

from exabyte_api_client.endpoints.workflows import WorkflowEndpoints
from exabyte_api_client.endpoints.materials import MaterialEndpoints
from exabyte_api_client.endpoints.jobs import JobEndpoints
🤖 Prompt for AI Agents
In `@examples/workflow/qe_scf_calculation.ipynb` around lines 148 - 150, The
imports for WorkflowEndpoints, MaterialEndpoints, and JobEndpoints are using the
wrong module path; replace the current mat3ra.api_client.endpoints imports with
the correct exabyte_api_client.endpoints imports so that WorkflowEndpoints,
MaterialEndpoints, and JobEndpoints are imported from
exabyte_api_client.endpoints instead of mat3ra.api_client.endpoints.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@other/jarvis/run_job_using_material_from_jarvis_db.ipynb`:
- Around line 254-258: The notebook's imports (e.g.,
mat3ra.api_client.endpoints.jobs.JobEndpoints, .projects.ProjectEndpoints,
.materials.MaterialEndpoints, .bank_workflows.BankWorkflowEndpoints,
.properties.PropertiesEndpoints) will fail because mat3ra-api-client isn't
installed; update the setup cell to pip-install mat3ra-api-client explicitly and
pin it to the version used in pyproject.toml (match the version string there) so
those imports resolve in isolated environments like Colab. Ensure the pip
install runs before the cells that import
JobEndpoints/ProjectEndpoints/MaterialEndpoints/BankWorkflowEndpoints/PropertiesEndpoints.

In `@other/materials_designer/workflows/band_gap.ipynb`:
- Around line 65-66: The comment above the ORGANIZATION_NAME constant contains a
grammatical typo ("you personal" should be "your personal"); update the comment
string that starts "# Set organization name..." to read "your personal account"
so it correctly says "otherwise your personal account is used", keeping the
surrounding context and the ORGANIZATION_NAME = None line unchanged.
🧹 Nitpick comments (1)
other/materials_designer/workflows/band_gap.ipynb (1)

156-164: Add error handling for organization lookup.

If ORGANIZATION_NAME is set to a non-existent organization, client.get_account(name=ORGANIZATION_NAME) may return None, leading to an AttributeError when accessing selected_account.id. Adding validation improves the user experience in the notebook.

💡 Suggested improvement
     "selected_account = client.my_account\n",
     "\n",
     "if ORGANIZATION_NAME:\n",
     "    selected_account = client.get_account(name=ORGANIZATION_NAME)\n",
+    "    if selected_account is None:\n",
+    "        raise ValueError(f\"Organization '{ORGANIZATION_NAME}' not found. Check available accounts above.\")\n",
     "\n",
     "ACCOUNT_ID = selected_account.id\n",
     "print(f\"✅ Selected account ID: {ACCOUNT_ID}, name: {selected_account.name}\")"

Comment on lines +254 to +258
"from mat3ra.api_client.endpoints.jobs import JobEndpoints\n",
"from mat3ra.api_client.endpoints.projects import ProjectEndpoints\n",
"from mat3ra.api_client.endpoints.materials import MaterialEndpoints\n",
"from mat3ra.api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n",
"from mat3ra.api_client.endpoints.properties import PropertiesEndpoints\n",
Copy link

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:

# First, let's find the notebook and examine its content
find . -name "run_job_using_material_from_jarvis_db.ipynb" -type f

Repository: Exabyte-io/api-examples

Length of output: 125


🏁 Script executed:

# Also search for dependency files and express-py info
find . -name "setup.py" -o -name "pyproject.toml" -o -name "requirements.txt" | head -20

Repository: Exabyte-io/api-examples

Length of output: 83


🏁 Script executed:

# Read the notebook file to check imports and dependencies
cat ./other/jarvis/run_job_using_material_from_jarvis_db.ipynb | head -200

Repository: Exabyte-io/api-examples

Length of output: 6211


🏁 Script executed:

# Read the pyproject.toml to see express-py and its dependencies
cat ./pyproject.toml

Repository: Exabyte-io/api-examples

Length of output: 2441


🏁 Script executed:

# Let me read more of the notebook to find lines around 254-258
# First, let's check the file size
wc -l ./other/jarvis/run_job_using_material_from_jarvis_db.ipynb

Repository: Exabyte-io/api-examples

Length of output: 129


🏁 Script executed:

# Use python to parse the notebook JSON and extract cell contents to find the imports
python3 << 'EOF'
import json

with open('./other/jarvis/run_job_using_material_from_jarvis_db.ipynb', 'r') as f:
    nb = json.load(f)

# Flatten all cell sources to find the lines mentioned
line_num = 0
for cell_idx, cell in enumerate(nb['cells']):
    if cell['cell_type'] == 'code':
        source = ''.join(cell['source']) if isinstance(cell['source'], list) else cell['source']
        source_lines = source.split('\n')
        for line in source_lines:
            line_num += 1
            # Look for imports from mat3ra.api_client
            if 'mat3ra.api_client.endpoints' in line:
                print(f"Found at notebook line {line_num}: {line}")

EOF

Repository: Exabyte-io/api-examples

Length of output: 541


🏁 Script executed:

# Now let's check what express-py depends on
web_search "express-py package PyPI dependencies mat3ra-api-client"

Repository: Exabyte-io/api-examples

Length of output: 117


🌐 Web query:

express-py PyPI package dependencies

💡 Result:

express-py (latest: 2025.10.16.post0) depends on: pymatgen, ase, jarvis-tools, mat3ra-esse, numpy, munch. [1]

It also declares Python >= 3.10. [2]

Sources: [1] https://www.piwheels.org/project/express-py/ [2] https://pypi.org/project/express-py/


🏁 Script executed:

# Let me check all pip install commands in the notebook
python3 << 'EOF'
import json

with open('./other/jarvis/run_job_using_material_from_jarvis_db.ipynb', 'r') as f:
    nb = json.load(f)

# Find all pip install commands
for cell_idx, cell in enumerate(nb['cells']):
    if cell['cell_type'] == 'code':
        source = ''.join(cell['source']) if isinstance(cell['source'], list) else cell['source']
        if 'pip install' in source or '!pip' in source:
            print(f"Cell {cell_idx}:")
            print(source)
            print("---")

EOF

Repository: Exabyte-io/api-examples

Length of output: 119


🏁 Script executed:

# Now let's verify the mat3ra-api-client is a direct dependency in pyproject.toml
grep -A 2 -B 2 "mat3ra-api-client" ./pyproject.toml

Repository: Exabyte-io/api-examples

Length of output: 257


Add explicit mat3ra-api-client installation to the notebook.

The notebook installs only express-py, which does not declare mat3ra-api-client as a dependency. However, lines 254–258 import from mat3ra.api_client.endpoints, which will fail in isolation (e.g., in Google Colab). Add an explicit pip install for mat3ra-api-client to the notebook's setup cell, pinned to the version specified in the project's pyproject.toml.

🤖 Prompt for AI Agents
In `@other/jarvis/run_job_using_material_from_jarvis_db.ipynb` around lines 254 -
258, The notebook's imports (e.g.,
mat3ra.api_client.endpoints.jobs.JobEndpoints, .projects.ProjectEndpoints,
.materials.MaterialEndpoints, .bank_workflows.BankWorkflowEndpoints,
.properties.PropertiesEndpoints) will fail because mat3ra-api-client isn't
installed; update the setup cell to pip-install mat3ra-api-client explicitly and
pin it to the version used in pyproject.toml (match the version string there) so
those imports resolve in isolated environments like Colab. Ensure the pip
install runs before the cells that import
JobEndpoints/ProjectEndpoints/MaterialEndpoints/BankWorkflowEndpoints/PropertiesEndpoints.

@VsevolodX VsevolodX merged commit 9348205 into main Jan 23, 2026
5 checks passed
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.

3 participants