FP

fsibt/pymcnp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

23 stars 质量 52 趋势 30NOASSERTION

MCNP 的 Python 工具

概览

PyMCNP 支持运行蒙特卡洛 N-粒子(MCNP)仿真。它解析 MCNP 文件,实现参数扫描等自动化,使用 pyvista 创建 MCNP 几何可视化。PyMCNP 提供 Python API 用于 MCNP 输入和输出文件,并提供命令行接口以与 MCNP 和 MCNP 文件交互。 PyMCNP 可在 PyPI 上使用,并且可以“pip 安装”: 截至2026-10-14,PyMCNP不支持Python 3.15,因为通过pyvsta的PyMCNP依赖vtk不支持Python 3.15。 PyMCNP 会向 AI 编码代理如 Claude Code 发布一个技能文件 SKILL.md,描述 API、解析合同及常见陷阱。安装技能后(Claude Code 的话,复制到 ~/.claude/skills/pymcnp/SKILL.md),代理可以根据简短描述为你编写、扫描、运行和绘制 MCNP 模型,因此即使是复杂几何体,自动化 MCNP 也变得容易。

概述(AI 翻译)

PyMCNP 支持运行蒙特卡洛 N-粒子(MCNP)仿真。它解析 MCNP 文件,实现参数扫描等自动化,使用 pyvista 创建 MCNP 几何可视化。PyMCNP 提供 Python API 用于 MCNP 输入和输出文件,并提供命令行接口以与 MCNP 和 MCNP 文件交互。

在ReadTheDocs上了解更多信息。

安装

PyMCNP 可在 PyPI 上使用,并且可以“pip 安装”:

PIP 安装 PYMCNP

PyMCNP 支持 Python 3.11 到 3.14。

截至2026-10-14,PyMCNP不支持Python 3.15,因为通过pyvista的PyMCNP依赖关系不支持Python 3.15。

人工智能编码代理自动化

PyMCNP 向 Claude Code 等 AI 编码代理提供一个技能文件 SKILL.md,描述 API、解析合同及常见陷阱。 安装了该技能(对于Claude代码,复制到~/.claude/skills/pymcnp/SKILL.md),代理可以根据简短描述为你编写、扫描、运行和绘制MCNP模型,因此即使是复杂几何体,自动化MCNP也变得容易。 ReadTheDocs上的示例是,441个铁盘在粗糙的混凝土地板上,带有通量图,就是根据一个简短的提示词这样创作的。

本页由 AI 翻译,技术细节请以原文为准。

README

PyMCNP

PyMCNP supports running Monte Carlo N-Particle (MCNP) simulations. It parses MCNP files, enabling automation such as parameter scans, creates MCNP geometry visualization using pyvista. PyMCNP provides a Python API for MCNP input and output files and a command line interface for interacting with MCNP and MCNP files.

Find more information on ReadTheDocs.

Installation

PyMCNP is available on PyPI and can be “pip installed”:

pip install pymcnp

PyMCNP supports Python 3.11 to 3.14.

As of 2026-10-14, PyMCNP doe snot support Python 3.15 since PyMCNP dependency vtk via pyvista does not support Python 3.15.

Automation with AI Coding Agents

PyMCNP ships a skill file, SKILL.md, that describes the API, the parsing contract, and the common pitfalls to an AI coding agent such as Claude Code. With the skill installed (for Claude Code, copy it to ~/.claude/skills/pymcnp/SKILL.md), an agent can write, scan, run, and plot MCNP models for you from a short description, so automating MCNP becomes easy even for complex geometries. The example on ReadTheDocs, 441 iron discs over a rough concrete floor with a flux plot, was created this way from a short prompt. Always review generated models and results before relying on them.

Contributing

PyMCNP welcomes contributions, including issues, pull requests, and MCNP files that PyMCNP fails to parse or visualize.

For more information, see the CONTRIBUTING.md file.

For copyright and license information, see the COPYRIGHT.md and LICENSE.md files.

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add fsibt/pymcnp
新手?先看 mcpskill.org 教程 →