Skip to content

docs: tutorial for running a custom Python script on materials [SOF-8004] - #397

Open
VsevolodX wants to merge 5 commits into
mainfrom
feature/SOF-8004
Open

docs: tutorial for running a custom Python script on materials [SOF-8004]#397
VsevolodX wants to merge 5 commits into
mainfrom
feature/SOF-8004

Conversation

@VsevolodX

@VsevolodX VsevolodX commented Aug 22, 2026

Copy link
Copy Markdown
Member

What

A tutorial page for running an arbitrary Python script against one or more
materials, covering the custom_python_calculation.ipynb notebook added in
api-examples#360.

Jira: SOF-8004

Contents

lang/en/docs/tutorials/other/custom-python-calculation.md, under 3.3. Tools
and Environments
:

  1. Prepare the script — reading material.json, printing results as JSON,
    adding data files from the uploads folder, declaring pip dependencies, and
    the reserved file names.
  2. Run the notebook — opening it in a JupyterLite session, the parameters
    cell, the script cell, and where the results appear.
  3. Anatomy of the workflow — the four units of Custom Python Script, and
    why the script is fetched as a file rather than embedded.
  4. Reuse the saved workflow — selecting it in the Jobs Designer, and how an
    edited script reaches it without a workflow change.
  5. Limits — the 50 MB request body cap and the one-material-per-job shape.

Checks

  • Post-build link check passes: Checked 332660 internal links. No broken internal links found.
  • Every cross-site target verified present in the built site; no unresolved
    {{ }} macros in the rendered page.
  • Style checklist from AGENTS.md: one H1, no list directly under a heading,
    flat lists, third person throughout, none of the words WRITING-STYLE.md
    rules out, relative link for the same-site reference and macros for the rest.
  • Navigation added to both mkdocs.yml and mkdocs-guide.yml.

Not included

Screenshots. The page is text and code only; images can follow through the
Cypress route described in AGENTS.md.

🤖 Generated with Claude Code

Covers the custom_python_calculation.ipynb notebook: how the script reads the
material and its own data files, how dependencies are declared, how the run
proceeds, what the four workflow units do, and how the saved workflow is reused
from the Jobs Designer.

Navigation entries added to mkdocs.yml and mkdocs-guide.yml. Post-build link
check passes with no broken internal links.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 22, 2026

Copy link
Copy Markdown

Deploy Preview for mat3ra-documentation ready!

Name Link
🔨 Latest commit 0242f14
🔍 Latest deploy log https://app.netlify.com/projects/mat3ra-documentation/deploys/6a8cb7c0b2bd1d00080fdbba
😎 Deploy Preview https://deploy-preview-397--mat3ra-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

VsevolodX and others added 4 commits August 21, 2026 18:28
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The notebook uploads UTF-8 text, since an upload travels as a string in a JSON
body. Section 1.3 says so, and Section 5 no longer implies that a file placed in
the object storage folder by hand is covered by USER_ASSET_FILES - it is not, and
the notebook's upload cell carries the lines that add such an object instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An upload feeds any application: the notebook's closing example runs a QE band structure with an uploaded Si.upf. Limits and Links renumbered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The QE-with-uploaded-pseudo example runs through custom_shell_calculation.ipynb now; section 5 describes that flow instead of the in-notebook workflow surgery.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant