Skip to content

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Sep 30, 2025

No description provided.

njzjz and others added 30 commits June 11, 2025 21:39
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from
2.23 to 3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/releases">pypa/cibuildwheel's
releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<p>See <a
href="https://github.com/henryiii"><code>@​henryiii</code></a>'s <a
href="https://iscinumpy.dev/post/cibuildwheel-3-0-0/">release post</a>
for more info on new features!</p>
<ul>
<li>
<p>🌟 Adds the ability to <a
href="https://cibuildwheel.pypa.io/en/stable/platforms/#ios">build
wheels for iOS</a>! Set the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#platform"><code>platform</code>
option</a> to <code>ios</code> on a Mac with the iOS toolchain to try it
out! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2286">#2286</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2363">#2363</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2432">#2432</a>)</p>
</li>
<li>
<p>🌟 Adds support for the GraalPy interpreter! Enable for your project
using the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable"><code>enable</code>
option</a>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/1538">#1538</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2411">#2411</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2414">#2414</a>)</p>
</li>
<li>
<p>✨ Adds CPython 3.14 support, under the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable"><code>enable</code>
option</a> <code>cpython-prerelease</code>. This version of cibuildwheel
uses 3.14.0b2. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2390">#2390</a>)</p>
<p><em>While CPython is in beta, the ABI can change, so your wheels
might not be compatible with the final release. For this reason, we
don't recommend distributing wheels until RC1, at which point 3.14 will
be available in cibuildwheel without the flag.</em> (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2390">#2390</a>)</p>
</li>
<li>
<p>✨ Adds the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-sources">test-sources
option</a>, and changes the working directory for tests. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2062">#2062</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2284">#2284</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2437">#2437</a>)</p>
<ul>
<li>If this option is set, cibuildwheel will copy the files and folders
specified in <code>test-sources</code> into the temporary directory we
run from. This is required for iOS builds, but also useful for other
platforms, as it allows you to avoid placeholders.</li>
<li>If this option is not set, behaviour matches v2.x - cibuildwheel
will run the tests from a temporary directory, and you can use the
<code>{project}</code> placeholder in the <code>test-command</code> to
refer to the project directory. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2420">#2420</a>)</li>
</ul>
</li>
<li>
<p>✨ Adds <a
href="https://cibuildwheel.pypa.io/en/stable/options/#dependency-versions"><code>dependency-versions</code></a>
inline syntax (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2122">#2122</a>)</p>
</li>
<li>
<p>✨ Improves support for Pyodide builds and adds the experimental <a
href="https://cibuildwheel.pypa.io/en/stable/options/#pyodide-version"><code>pyodide-version</code></a>
option, which allows you to specify the version of Pyodide to use for
builds. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2002">#2002</a>)</p>
</li>
<li>
<p>✨ Add <code>pyodide-prerelease</code> <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable">enable</a>
option, with an early build of 0.28 (Python 3.13). (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2431">#2431</a>)</p>
</li>
<li>
<p>✨ Adds the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#test-environment"><code>test-environment</code></a>
option, which allows you to set environment variables for the test
command. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2388">#2388</a>)</p>
</li>
<li>
<p>✨ Adds the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#xbuild-tools"><code>xbuild-tools</code></a>
option, which allows you to specify tools safe for cross-compilation.
Currently only used on iOS; will be useful for Android in the future.
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2317">#2317</a>)</p>
</li>
<li>
<p>🛠 The default <a
href="https://cibuildwheel.pypa.io/en/stable/options/#linux-image">manylinux
image</a> has changed from <code>manylinux2014</code> to
<code>manylinux_2_28</code>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2330">#2330</a>)</p>
</li>
<li>
<p>🛠 EOL images <code>manylinux1</code>, <code>manylinux2010</code>,
<code>manylinux_2_24</code> and <code>musllinux_1_1</code> can no longer
be specified by their shortname. The full OCI name can still be used for
these images, if you wish. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2316">#2316</a>)</p>
</li>
<li>
<p>🛠 Invokes <code>build</code> rather than <code>pip wheel</code> to
build wheels by default. You can control this via the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#build-frontend"><code>build-frontend</code></a>
option. You might notice that you can see your build log output now! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2321">#2321</a>)</p>
</li>
<li>
<p>🛠 Build verbosity settings have been reworked to have consistent
meanings between build backends when non-zero. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2339">#2339</a>)</p>
</li>
<li>
<p>🛠 Removed the <code>CIBW_PRERELEASE_PYTHONS</code> and
<code>CIBW_FREE_THREADED_SUPPORT</code> options - these have been folded
into the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable"><code>enable</code></a>
option instead. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2095">#2095</a>)</p>
</li>
<li>
<p>🛠 Build environments no longer have setuptools and wheel
preinstalled. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2329">#2329</a>)</p>
</li>
<li>
<p>🛠 Use the standard Schema line for the integrated JSONSchema. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2433">#2433</a>)</p>
</li>
<li>
<p>⚠️ Dropped support for building Python 3.6 and 3.7 wheels. If you
need to build wheels for these versions, use cibuildwheel v2.23.3 or
earlier. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2282">#2282</a>)</p>
</li>
<li>
<p>⚠️ The minimum Python version required to run cibuildwheel is now
Python 3.11. You can still build wheels for Python 3.8 and newer. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/1912">#1912</a>)</p>
</li>
<li>
<p>⚠️ 32-bit Linux wheels no longer built by default - the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#archs">arch</a>
was removed from <code>&quot;auto&quot;</code>. It now requires explicit
<code>&quot;auto32&quot;</code>. Note that modern manylinux images (like
the new default, <code>manylinux_2_28</code>) do not have 32-bit
versions. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2458">#2458</a>)</p>
</li>
<li>
<p>⚠️ PyPy wheels no longer built by default, due to a change to our
options system. To continue building PyPy wheels, you'll now need to set
the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable"><code>enable</code>
option</a> to <code>pypy</code> or <code>pypy-eol</code>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2095">#2095</a>)</p>
</li>
<li>
<p>⚠️ Dropped official support for Appveyor. If it was working for you
before, it will probably continue to do so, but we can't be sure,
because our CI doesn't run there anymore. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2386">#2386</a>)</p>
</li>
<li>
<p>📚 A reorganisation of the docs, and numerous updates. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2280">#2280</a>)</p>
</li>
<li>
<p>📚 Use Python 3.14 color output in docs CLI output. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2407">#2407</a>)</p>
</li>
<li>
<p>📚 Docs now primarily use the pyproject.toml name of options, rather
than the environment variable name. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2389">#2389</a>)</p>
</li>
<li>
<p>📚 README table now matches docs and auto-updates. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2427">#2427</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2428">#2428</a>)</p>
</li>
</ul>
<h2>v3.0.0rc3</h2>
<p>Not yet released, but available for testing.</p>
<p>Note - when using a beta version, be sure to check the <a
href="https://cibuildwheel.pypa.io/en/latest/">latest docs</a>, rather
than the stable version, which is still on v2.X.</p>
<!-- raw HTML omitted -->
<p>If you've used previous versions of the beta:</p>
<ul>
<li>⚠️ Previous betas of v3.0 changed the working directory for tests.
This has been rolled back to the v2.x behaviour, so you might need to
change configs if you adapted to the beta 1 or 2 behaviour. See [issue
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2406">#2406</a>](<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2406">pypa/cibuildwheel#2406</a>)
for more information.</li>
<li>⚠️ GraalPy shipped with the identifier <code>gp242-*</code> in
previous betas, this has been changed to <code>gp311_242-*</code> to be
consistent with other interpreters, and to fix a bug with GraalPy and
project requires-python detection. If you were using GraalPy, you might
need to update your config to use the new identifier.</li>
<li>⚠️ <code>test-sources</code> now uses <code>project</code> directory
instead of the <code>package</code> directory (matching the docs).</li>
<li>⚠️ 32-bit linux builds were removed from
<code>&quot;auto&quot;</code> (the default), now require
<code>&quot;auto32&quot;</code> or explicit archs, as modern manylinux
images (including our new default) do not support them.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md">pypa/cibuildwheel's
changelog</a>.</em></p>
<blockquote>
<h3>v2.23.0</h3>
<p><em>1 March 2025</em></p>
<ul>
<li>✨ Adds official support for the new GitHub Actions Arm runners. In
fact these worked out-of-the-box, now we include them in our tests and
example configs. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2135">#2135</a>
via <a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2281">#2281</a>)</li>
<li>✨ Adds support for building PyPy 3.11 wheels (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2268">#2268</a>
via <a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2281">#2281</a>)</li>
<li>🛠 Adopts the beta pypa/manylinux image for armv7l builds (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2269">#2269</a>
via <a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2281">#2281</a>)</li>
<li>🛠 Dependency updates, including Pyodide 0.27 (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2117">#2117</a>
and <a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2281">#2281</a>)</li>
</ul>
<h3>v2.22.0</h3>
<p><em>23 November 2024</em></p>
<ul>
<li>🌟 Added a new <code>CIBW_ENABLE</code>/<code>enable</code> feature
that replaces
<code>CIBW_FREETHREADED_SUPPORT</code>/<code>free-threaded-support</code>
and <code>CIBW_PRERELEASE_PYTHONS</code> with a system that supports
both. In cibuildwheel 3, this will also include a PyPy setting and the
deprecated options will be removed. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2048">#2048</a>)</li>
<li>🌟 <a href="https://peps.python.org/pep-0735/">Dependency groups</a>
are now supported for tests. Use
<code>CIBW_TEST_GROUPS</code>/<code>test-groups</code> to specify groups
in <code>[dependency-groups]</code> for testing. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2063">#2063</a>)</li>
<li>🌟 Support for the experimental Ubuntu-based ARMv7l manylinux image
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2052">#2052</a>)</li>
<li>✨ Show a warning when cibuildwheel is run from Python 3.10 or older;
cibuildwheel 3.0 will require Python 3.11 or newer as host (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2050">#2050</a>)</li>
<li>🐛 Fix issue with stderr interfering with checking the docker version
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2074">#2074</a>)</li>
<li>🛠 Python 3.9 is now used in
<code>CIBW_BEFORE_ALL</code>/<code>before-all</code> on linux, replacing
3.8, which is now EoL (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2043">#2043</a>)</li>
<li>🛠 Error messages for producing a pure-Python wheel are slightly more
informative (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2044">#2044</a>)</li>
<li>🛠 Better error when <code>uname -m</code> fails on ARM (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2049">#2049</a>)</li>
<li>🛠 Better error when repair fails and docs for abi3audit on Windows
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2058">#2058</a>)</li>
<li>🛠 Better error when <code>manylinux-interpreters ensure</code> fails
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2066">#2066</a>)</li>
<li>🛠 Update Pyodide to 0.26.4, and adapt to the unbundled pyodide-build
(now 0.29) (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2090">#2090</a>)</li>
<li>🛠 Now cibuildwheel uses dependency-groups for development
dependencies (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2064">#2064</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2085">#2085</a>)</li>
<li>📚 Docs updates and tidy ups (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2061">#2061</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2067">#2067</a>,
<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2072">#2072</a>)</li>
</ul>
<h3>v2.21.3</h3>
<p><em>9 October 2024</em></p>
<ul>
<li>🛠 Update CPython 3.13 to 3.13.0 final release (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2032">#2032</a>)</li>
<li>📚 Docs updates and tidy ups (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2035">#2035</a>)</li>
</ul>
<h3>v2.21.2</h3>
<p><em>2 October 2024</em></p>
<ul>
<li>✨ Adds support for building 32-bit armv7l wheels on musllinux. On a
Linux system with emulation set up, set <a
href="https://cibuildwheel.pypa.io/en/stable/options/#archs">CIBW_ARCHS</a>
to <code>armv7l</code> on Linux to try it out if you're interested! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2017">#2017</a>)</li>
<li>🐛 Fix Linux Podman builds on some systems (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2016">#2016</a>)</li>
<li>✨ Adds official support for running on Python 3.13 (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2026">#2026</a>)</li>
<li>🛠 Update CPython 3.13 to 3.13.0rc3 (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2029">#2029</a>)</li>
</ul>
<p>Note: the default <a
href="https://cibuildwheel.pypa.io/en/stable/options/#linux-image">manylinux
image</a> is <strong>scheduled to change</strong> from
<code>manylinux2014</code> to <code>manylinux_2_28</code> in a
cibuildwheel release on or after <strong>6th May 2025</strong> - you can
set the value now to avoid getting upgraded if you want. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/1992">#1992</a>)</p>
<h3>v2.21.1</h3>
<p><em>16 September 2024</em></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/5f22145df44122af0f5a201f93cf0207171beca7"><code>5f22145</code></a>
Bump version: v3.0.0</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/a73177515a438c947d6e6e7a7356dfe67991d740"><code>a731775</code></a>
Docs: mobile layout fix (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2466">#2466</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/ff86a6457781e53a6edbb60d3c2677c64be4f282"><code>ff86a64</code></a>
docs: add tips for numpy (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2465">#2465</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/6f5e480fec0d367f9230ee0be4bcb56136eeec43"><code>6f5e480</code></a>
chore: use pip's groups in CI (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2463">#2463</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/3c5ff0988806752c5a6502c845f9edc2d98095d6"><code>3c5ff09</code></a>
Bump version: v3.0.0rc3</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/1b9a56e01487f7fd9146e622505ea22d4d35e954"><code>1b9a56e</code></a>
[Bot] Update dependencies (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2455">#2455</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/aa9fe2a24edd67db40cbd394e4621a479e9e69f1"><code>aa9fe2a</code></a>
ci: use uv python for docs (binary b1) (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2462">#2462</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/e188d9e26007031c475bb5293b90c5f386ecb439"><code>e188d9e</code></a>
feat: remove 32-bit linux from auto arch, fix auto32 on linux aarch64
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2458">#2458</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/3fa7bd1e72c565f4efc61363db6b2f14dbdbb198"><code>3fa7bd1</code></a>
ci: fix cirrus and reduce rebuilds (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2460">#2460</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/c6368be701a99f8315656f925236dbcec5b9b9c2"><code>c6368be</code></a>
Move to the <code>OS-latest</code> image tags on Azure Pipelines (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2461">#2461</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/cibuildwheel/compare/v2.23...v3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pypa/cibuildwheel&package-manager=github_actions&previous-version=2.23&new-version=3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR fixes the error in UT where the argument of `xp.reshape` should
be a tuple, not a list.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Style**
- Standardized the use of tuple syntax for shape arguments in array
reshaping operations throughout the application, replacing previous
list-based syntax. This change ensures consistency and aligns with best
practices for array manipulation. No functional behavior is affected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ng#4804)

This brings ~10% speedup for the training of DPA3 model with 24 thin
layers and dynamic sel (average training time: 0.6891 s/batch vs 0.7635
s/batch, batch size = auto:128).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Updated the shape and indexing conventions for edge and angle index
arrays and tensors across multiple components, standardizing them to
column-major format for improved consistency.
- Adjusted initialization and handling of index arrays/tensors to match
the new conventions in both NumPy and PyTorch implementations.
- Updated relevant method calls and internal logic to align with the
revised index shapes and access patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!--pre-commit.ci start-->
updates:
- [github.com/pre-commit/mirrors-clang-format: v20.1.5 →
v20.1.6](pre-commit/mirrors-clang-format@v20.1.5...v20.1.6)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jinzhe Zeng <[email protected]>
pop unnecessary item when wrapping model with `jit.to_static`, so we can
support se_e2_a/dpa2/dpa3 without extra modification.

@njzjz can you give some suggestions for better code improvements? The
current approach of fetching data via `self.get_data` isn't very
concise.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved compatibility by dynamically matching label input
specifications to available label keys during model compilation when
CINN is enabled. This prevents errors caused by mismatched label keys at
runtime.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: HydrogenSulfate <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1. get local rank from `PADDLE_LOCAL_RANK` environment variable instead
of `get_rank()`(which will return global rank).
2. disable gradient synchronization in forward-backward and synchronize
manually before optimizer update
4. update parallel training tutorial(multi-node multi-GPU) in document

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved gradient synchronization in distributed training for
multi-process setups.
- Updated local rank assignment to use environment variables for
enhanced compatibility.

- **Documentation**
- Added an example using `mpirun` and a sample shell script to the
parallel training guide for distributed training launch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: HydrogenSulfate <[email protected]>
Co-authored-by: Copilot <[email protected]>
fix deepmodeling#4212

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Improved the logic for accumulating and reporting training time during
model training, resulting in clearer and more consistent step counting
and average time logging.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
adapt preparing input spec in paddle backend to support `loc_mapping`
for dpa3

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for dynamic neighbor and angle selection, enabling
flexible graph-based computations.
- Introduced options for local atom index mapping and alternative edge
feature initialization.
  - Added exponential switch function for neighbor smoothing.
- Introduced JIT-compiled SiLUT activation with higher-order gradient
support, configurable via environment variable.
  - New utility functions for aggregation and graph index computation.

- **Improvements**
  - Enhanced documentation for descriptor parameters.
  - Defaulted local mapping to enabled for relevant descriptors.
- Improved device handling and tensor operations for better
compatibility and clarity.

- **Bug Fixes**
  - Simplified test skipping logic to rely on a unified flag.

- **Chores**
- Refactored and clarified internal logic for smoother weight and switch
function computations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.13 →
v0.12.0](astral-sh/ruff-pre-commit@v0.11.13...v0.12.0)
- [github.com/pycqa/flake8: 7.2.0 →
7.3.0](PyCQA/flake8@7.2.0...7.3.0)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 2433566)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved the reliability of neighbor selection for angle calculations,
ensuring more accurate identification of neighbors within the angular
cutoff radius.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced support for optional fitting and atomic parameters during
calculations.
- **Tests**
- Added tests to verify correct handling of models with multiple fitting
and atomic parameters, ensuring consistent results under atom
permutation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
It has been moved to PyPI. See
https://github.com/mpi4py/mpi4py/releases/tag/4.1.0

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Removed use of a custom package index for installing certain
dependencies in the build and test configurations.
* Updated workflow and build settings to use the default package index
for installations.
* Improved environment variable handling to preserve existing paths
during testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
`jaxlib.xla_extension` has been removed in recent versions of JAX.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Improved exception handling by updating error type checks and removing
an unnecessary dependency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ynamic shape (deepmodeling#4826)

Add flag `CINN_ALLOW_DYNAMIC_SHAPE` for allow compiling dynamic input
shape, if set to `0` or `False`, performance might be slightly enhanced
for fixed shape. We set default value to `True` for compativility.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **New Features**
* Added support for the "paddle" backend, including updated help and
error messages to reflect new output file formats.
* Introduced a new environment variable to control dynamic shape support
for the CINN compiler, allowing users to choose between improved
compatibility or enhanced performance.

* **Improvements**
* Enhanced training setup to conditionally enable or disable dynamic
shape support based on user configuration.
* Updated documentation to guide users on configuring CINN compilation
for fixed or dynamic input shapes during training.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.0 →
v0.12.1](astral-sh/ruff-pre-commit@v0.12.0...v0.12.1)
- [github.com/pre-commit/mirrors-clang-format: v20.1.6 →
v20.1.7](pre-commit/mirrors-clang-format@v20.1.6...v20.1.7)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.1 →
v0.12.2](astral-sh/ruff-pre-commit@v0.12.1...v0.12.2)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…le & support TF tensor fitting trainable (deepmodeling#4793)

1. For dpmodel, pt, and pd, pass the trainable parameter to the layer
(not actually used in this PR).
2. For JAX, support the `trainable` parameter in the layer.
3. "trainable" is now serialized in dpmodel, tf, pt, pd, etc.
4. Support trainable in TF dipole & polar fitting.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Added a `trainable` parameter to numerous model components,
descriptors, embedding and fitting networks, and attention layers,
allowing users to enable or disable parameter trainability.
- Ensured consistent propagation of the `trainable` flag across
submodules and layers in PyTorch, TensorFlow, and JAX backends.
- Enhanced serialization and deserialization processes to include the
`trainable` attribute, maintaining trainability settings during model
save and load.
- Implemented conditional parameter wrapping in the JAX backend to
differentiate trainable parameters from fixed variables.

- **Tests**
- Updated test configurations to include the `trainable` flag,
validating behavior with non-trainable components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: Duo <[email protected]>
support running `input_torch_dynamic.json` with paddle backend(including
CINN)


TODO list:

- [x] PaddlePaddle/Paddle#73601
- [x] PaddlePaddle/Paddle#73622
- [x] PaddlePaddle/Paddle#73737
- [x] PaddlePaddle/Paddle#73747
- [x] PaddlePaddle/Paddle#73809
- [x] PaddlePaddle/Paddle#73761


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Resolved issues with tensor shape and indexing consistency, preventing
assertion errors during model execution.
* Improved handling of default tensor initialization to avoid JIT
assertion issues.

* **Refactor**
* Standardized tensor dimension handling and broadcasting for improved
clarity and maintainability.
* Enhanced code readability with clearer indexing conventions and
formatting.
* Updated aggregation logic for safer and more efficient tensor
operations.

* **New Features**
* Added an option to control graph index mapping behavior for greater
flexibility in advanced use cases.

* **Tests**
* Introduced comprehensive tests validating descriptor model consistency
with dynamic selection enabled.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added support for displaying "observed-type" information in the model
reporting tool, showing element types observed during training for
single-task and multi-task models.
- **Tests**
- Updated tests to verify correct reporting of observed types for both
single-task and multi-task models.
- **Documentation**
- Updated documentation to include the new "observed-type" attribute in
model information display, with examples and explanations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Duo <[email protected]>
Co-authored-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added the ability to evaluate and retrieve the output of the last
hidden layer in fitting neural networks, providing access to
intermediate model outputs.
- Extended evaluation interfaces to support fetching intermediate
fitting outputs for both standard and mixed-type models.
- **Improvements**
- Enhanced output dictionaries to optionally include intermediate
network outputs when enabled, allowing for more detailed inspection
during evaluation.
- **Tests**
- Introduced tests to verify correctness and consistency of fitting last
layer evaluations across supported model types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
As reported by
deepmodeling#4837 (comment),
the pytorch in the cuda 11 image is currently cuda12.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Cleaned up documentation formatting by removing unnecessary blank
lines for improved readability and consistency.

* **Refactor**
* Improved Docker installation process to better manage PyTorch backend
selection for CUDA 11 environments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.2 →
v0.12.3](astral-sh/ruff-pre-commit@v0.12.2...v0.12.3)
- [github.com/pre-commit/mirrors-clang-format: v20.1.7 →
v20.1.8](pre-commit/mirrors-clang-format@v20.1.7...v20.1.8)
- [github.com/scop/pre-commit-shfmt: v3.11.0-1 →
v3.12.0-1](scop/pre-commit-shfmt@v3.11.0-1...v3.12.0-1)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
dict.insert will not replace old value of the key value while lammps
reallocate will keep old value in old address. This may cause dict
always use the initial value of some keys.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved handling of communication settings to ensure that updates to
existing entries are correctly applied, preventing potential issues with
outdated or duplicate information during tensor communication.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.3 →
v0.12.4](astral-sh/ruff-pre-commit@v0.12.3...v0.12.4)
- [github.com/scop/pre-commit-shfmt: v3.12.0-1 →
v3.12.0-2](scop/pre-commit-shfmt@v3.12.0-1...v3.12.0-2)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.0
to 3.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/releases">pypa/cibuildwheel's
releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<ul>
<li>🌟 CPython 3.14 wheels are now built by default - without the
<code>&quot;cpython-prerelease&quot;</code> <code>enable</code> set.
It's time to build and upload these wheels to PyPI! This release
includes CPython 3.14.0rc1, which is guaranteed to be ABI compatible
with the final release. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2507">#2507</a>)
Free-threading is no longer experimental in 3.14, so you have to skip it
explicitly with <code>'cp31?t-*'</code> if you don't support it yet. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2503">#2503</a>)</li>
<li>🌟 Adds the ability to <a
href="https://cibuildwheel.pypa.io/en/stable/platforms/#android">build
wheels for Android</a>! Set the <a
href="https://cibuildwheel.pypa.io/en/stable/options/#platform"><code>platform</code>
option</a> to <code>android</code> on Linux or macOS to try it out! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2349">#2349</a>)</li>
<li>🌟 Adds Pyodide 0.28, which builds 3.13 wheels (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2487">#2487</a>)</li>
<li>✨ Support for 32-bit <code>manylinux_2_28</code> (now a consistent
default) and <code>manylinux_2_34</code> added (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2500">#2500</a>)</li>
<li>🛠 Improved summary, will also use markdown summary output on GHA (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2469">#2469</a>)</li>
<li>🛠 The riscv64 images now have a working default (as they are now
part of pypy/manylinux), but are still experimental (and behind an
<code>enable</code>) since you can't push them to PyPI yet (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2506">#2506</a>)</li>
<li>🛠 Fixed a typo in the 3.9 MUSL riscv64 identifier
(<code>cp39-musllinux_ricv64</code> -&gt;
<code>cp39-musllinux_riscv64</code>) (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2490">#2490</a>)</li>
<li>🛠 Mistyping <code>--only</code> now shows the correct possibilities,
and even suggests near matches on Python 3.14+ (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2499">#2499</a>)</li>
<li>🛠 Only support one output from the repair step on linux like other
platforms; auditwheel fixed this over four years ago! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2478">#2478</a>)</li>
<li>🛠 We now use pattern matching extensively (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2434">#2434</a>)</li>
<li>📚 We now have platform maintainers for our special platforms and
interpreters! (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2481">#2481</a>)</li>
</ul>
<h2>v3.0.1</h2>
<ul>
<li>🛠 Updates CPython 3.14 prerelease to 3.14.0b3 (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2471">#2471</a>)</li>
<li>✨ Adds a CPython 3.14 prerelease iOS build (only when prerelease
builds are <a
href="https://cibuildwheel.pypa.io/en/stable/options/#enable">enabled</a>)
(<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2475">#2475</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md">pypa/cibuildwheel's
changelog</a>.</em></p>
<blockquote>
<h3>v2.23.1</h3>
<p><em>15 March 2025</em></p>
<ul>
<li>⚠️ Added warnings when the shorthand values <code>manylinux1</code>,
<code>manylinux2010</code>, <code>manylinux_2_24</code>, and
<code>musllinux_1_1</code> are used to specify the images in linux
builds. The shorthand to these (unmaintainted) images will be removed in
v3.0. If you want to keep using these images, explicitly opt-in using
the full image URL, which can be found in <a
href="https://github.com/pypa/cibuildwheel/blob/v2.23.1/cibuildwheel/resources/pinned_docker_images.cfg">this
file</a>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2312">#2312</a>)</li>
<li>🛠 Dependency updates, including a manylinux update which fixes an <a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2303">issue
with rustup</a>. (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2315">#2315</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/e6de07ed3921b51089aae6981989889cf1eddd0c"><code>e6de07e</code></a>
Bump version: v3.1.1</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/2ca692b1e55a1f924bfb460099c9d7e015671a8d"><code>2ca692b</code></a>
docs: iOS typo fix in docs (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2510">#2510</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/1ac7fa7f004958fbde774ee89523c446a5d99934"><code>1ac7fa7</code></a>
fix: report defects in logs and HTML summaries (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2512">#2512</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/ffd835cef18fa11522f608fc0fa973b89f5ddc87"><code>ffd835c</code></a>
Bump version: v3.1.0</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/3e2a9aa6e85824999f897fc2c060ca12a5113ef6"><code>3e2a9aa</code></a>
fix: regenerate schema</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/10c727eed9fc962f75d33d472272e3ad78c3e707"><code>10c727e</code></a>
feat: Python 3.14rc1 build by default (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2507">#2507</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/f628c9dd23fe6e263cb91cef755a51a0af3bcddc"><code>f628c9d</code></a>
[pre-commit.ci] pre-commit autoupdate (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2505">#2505</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/0f487ee2cb00876d95290da49d04208c91237857"><code>0f487ee</code></a>
feat: add support for building Android wheels (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2349">#2349</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/e2e24882d8422e974295b1b9079d4ce80a5098a4"><code>e2e2488</code></a>
feat: add default riscv64 images (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2506">#2506</a>)</li>
<li><a
href="https://github.com/pypa/cibuildwheel/commit/a8bff94dbb5f3a4a914e29cf8353c2f6f1b9ab8b"><code>a8bff94</code></a>
[Bot] Update dependencies (<a
href="https://redirect.github.com/pypa/cibuildwheel/issues/2504">#2504</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/cibuildwheel/compare/v3.0...v3.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pypa/cibuildwheel&package-manager=github_actions&previous-version=3.0&new-version=3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.4 →
v0.12.5](astral-sh/ruff-pre-commit@v0.12.4...v0.12.5)
- [github.com/njzjz/mirrors-bibtex-tidy: v1.13.0 →
v1.14.0](njzjz/mirrors-bibtex-tidy@v1.13.0...v1.14.0)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Remove version `>=a.b.crc0` from dependencies. The stable version should
be preferred.
This prevents the installation of TensorFlow 2.20.0rc0, which breaks the
CI. However, the incompatibility should still be fixed in the future.
TensorFlow 2.20.0rc0 removes the version information from the header
files.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated version requirements for TensorFlow and myst-nb packages to
use stable releases instead of release candidate versions in build and
documentation workflows.
* Adjusted dependency handling for TensorFlow CPU to ensure stable
versions are used during build processes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <[email protected]>
…ed. (deepmodeling#4854)

feat: add Mean absolute percentage error (MAPE) loss for property
prediction

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added support for the Mean Absolute Percentage Error (MAPE) as a
selectable loss function and metric.

* **Documentation**
* Updated user-facing documentation to include "mape" as an option for
loss function selection.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copilot AI and others added 12 commits September 15, 2025 08:20
…ackend (deepmodeling#4967)

This PR enables the Ruff ANN (type annotation) rule for the JAX backend
and adds comprehensive type hints to all methods across the core JAX
implementation.

## Changes Made

**Configuration Changes:**
- [x] Removed `ANN` from the exclude list for `deepmd/jax/**` in
`pyproject.toml`, enabling type annotation checking for the entire JAX
backend
- [x] Removed unnecessary exclusion for `deepmd/jax/jax2tf/**` as it now
passes ANN checks with proper type annotations
- [x] The global `ANN401` ignore remains active to allow necessary `Any`
type usage

**Type Annotations Added:**
- [x] **Base functions**: Added type hints to
`base_atomic_model_set_attr` and `forward_common_atomic` functions that
are used throughout the JAX backend
- [x] **Atomic models**: Complete type annotations for all classes in
`deepmd/jax/atomic_model/`
- [x] **Descriptors**: Type hints verified for all descriptor classes  
- [x] **Fitting modules**: Type annotations confirmed for fitting
implementations
- [x] **Inference**: Added return types for `_eval_model`,
`_get_output_shape`, and nested evaluation functions
- [x] **Models**: Complete type hints for model classes including
complex HLO model parameters
- [x] **Utilities**: Type annotations for network classes, neighbor
statistics, and serialization functions
- [x] **Array protocol methods**: Proper typing for `__array__`,
`__array_namespace__`, `__dlpack__`, and `__dlpack_device__` methods
- [x] **Root level**: Type hints for common utility functions like
`scatter_sum`
- [x] **JAX2TF interop**: Added comprehensive type annotations to all
functions in the `deepmd/jax/jax2tf/` directory including:
- `format_nlist.py`: Return type annotation for nlist formatting
function
  - `make_model.py`: Return type for model call wrapper function  
- `nlist.py`: Type hints for neighbor list functions including
`nlist_distinguish_types`, `tf_outer`, and `extend_coord_with_ghosts`
  - `region.py`: Type annotations for region distance calculations
- `serialization.py`: Complete type hints for all model serialization
functions and nested closures, using proper `jax.export.Exported` type
- `tfmodel.py`: Type annotations for TensorFlow model wrapper class
methods

**Bug Fixes:**
- [x] **Third-party file protection**: Reverted accidental changes to
`source/3rdparty/implib/implib-gen.py` which should not be modified
- [x] **Improved type accuracy**: Updated
`exported_whether_do_atomic_virial` return type from `Any` to
`jax.export.Exported` for better type safety
- [x] **Enhanced return type precision**: Updated
`TFModelWrapper.call()` and `TFModelWrapper.call_lower()` return types
from `Any` to `dict[str, jnp.ndarray]` for better type safety
- [x] **Improved HLO parameter types**: Updated HLO model stablehlo
parameters from `Any` to `bytearray` for more precise typing
- [x] **Fixed TF2 eager mode test hanging**: Used string literals for
JAX type annotations (`"jax_export.Exported"`) to prevent import-time
evaluation issues that could cause tests to hang in environments where
JAX is not fully available

## Technical Details

The implementation follows existing codebase patterns:
- Uses `Any` for complex interop types (properly ignored by global
ANN401 rule)
- Leverages forward references for circular dependencies (e.g.,
`"BaseModel"`)
- Maintains consistency with existing type annotation styles
- Handles JAX-specific array types (`jnp.ndarray`) and TensorFlow types
(`tnp.ndarray`, `tf.Tensor`) appropriately
- Uses appropriate return types for TensorFlow interop functions (e.g.,
`dict[str, tnp.ndarray]` for model outputs)
- Uses precise JAX export types like `jax.export.Exported` where
applicable
- Uses appropriate binary data types like `bytearray` for serialized HLO
models
- **Uses string literals for JAX types** to prevent import-time
evaluation issues in test environments where JAX may not be fully
available

## Validation

All core JAX backend directories now pass ruff checks with the ANN rule
enabled:
- `deepmd/jax/atomic_model/` ✅
- `deepmd/jax/descriptor/` ✅  
- `deepmd/jax/fitting/` ✅
- `deepmd/jax/infer/` ✅
- `deepmd/jax/model/` ✅
- `deepmd/jax/utils/` ✅
- `deepmd/jax/jax2tf/` ✅ (now fully compliant with ANN rules)
- Root level files ✅

**Test Hanging Issue Fixed**: The TF2 eager mode test hanging issue was
caused by runtime evaluation of JAX type annotations in environments
where JAX was not fully available. This has been resolved by using
string literals for the problematic type annotations.

**Configuration Simplified**: Removed the specific exclusion for
`deepmd/jax/jax2tf/` directory as it now passes all ANN checks with
proper type annotations, making the configuration cleaner and more
consistent.

This change significantly improves type safety and developer experience
for the entire JAX backend while maintaining backward compatibility and
fixing the test hanging issue.

Fixes deepmodeling#4942.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
This pull request updates the MPI CUDA-awareness detection and handling
logic in the `Border` autograd function, simplifying how CUDA support is
determined and removing some legacy checks. The changes ensure that
CUDA-aware MPI support is queried more directly, and some unnecessary
device synchronization calls are removed.

* The logic for checking CUDA-aware MPI support has been simplified:
version checks and redundant branches have been removed, and the code
now directly queries `MPIX_Query_cuda_support()` unless `NO_CUDA_AWARE`
is defined.
[[1]](diffhunk://#diff-7b7590fd4222d9c50f1dd7dde5ce7ed4b27695fbe591b536787db7575c35e32cL102-L112)
[[2]](diffhunk://#diff-7b7590fd4222d9c50f1dd7dde5ce7ed4b27695fbe591b536787db7575c35e32cL227-L237)

* Removed explicit `gpuDeviceSynchronize()` calls from both the forward
and backward paths, relying on PyTorch's internal synchronization
mechanisms instead.
[[1]](diffhunk://#diff-7b7590fd4222d9c50f1dd7dde5ce7ed4b27695fbe591b536787db7575c35e32cL196-L198)
[[2]](diffhunk://#diff-7b7590fd4222d9c50f1dd7dde5ce7ed4b27695fbe591b536787db7575c35e32cL332-L334)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- Performance
- Reduced explicit GPU synchronization, potentially improving throughput
during distributed forward/backward operations.
- Compatibility
- Safer default when CUDA-aware MPI isn’t present: automatically falls
back to CPU-based transfers unless support is detected, improving
stability across varied clusters.
- Reliability
- Simplified CUDA-aware detection reduces edge-case misconfigurations in
mixed MPI environments.
- No API Changes
- Public interfaces remain unchanged; existing workflows continue to
work.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.12 →
v0.13.0](astral-sh/ruff-pre-commit@v0.12.12...v0.13.0)
<!--pre-commit.ci end-->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jinzhe Zeng <[email protected]>
change the unit eV/A to eV/Å for dp test

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- Bug Fixes
- Standardized unit display from eV/A and eV/A^2 to eV/Å and eV/Å^2
across all distance-related logs. Affects force metrics (MAE/RMSE,
weighted, per-atom), Hessian, WFC, polarizability, dipole, and
corresponding system-average summaries. Improves readability, aligns
with scientific notation, and removes ambiguity in reported units. No
changes to calculations or results—only log message text was updated.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This PR moves `.github/copilot-instructions.md` to `AGENTS.md` in the
repository root to follow the standard convention used by different AI
agents.

## Background

According to the [GitHub blog
post](https://github.blog/changelog/2025-08-28-copilot-coding-agent-now-supports-agents-md-custom-instructions/),
`AGENTS.md` is the commonly used filename for agent instructions that
can be recognized by various AI coding agents, not just GitHub Copilot.

## Changes

- Moved `.github/copilot-instructions.md` to `AGENTS.md` in the
repository root
- Preserved all existing content exactly (191 lines of detailed
instructions)
- Removed the old file location

## Benefits

- Makes agent instructions discoverable by multiple AI coding agents
- Follows the established convention in the AI development community
- Maintains all the valuable build, test, and development guidance for
the DeePMD-kit repository

No functional changes were made - this is purely a file relocation to
improve discoverability and standardization.

Fixes deepmodeling#4981.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Style**
* Simplified RMSE log messages by removing the " eV/Å" unit suffix for
WFC, Polarizability, and Dipole metrics in both per-system and
aggregated outputs.
* Minor wording and formatting tweaks in test/log output messages; no
changes to calculations, reported values, or program behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
…eepmodeling#4962)

- [x] Implement decoupled out_bias and out_std architecture in
TensorFlow backend
- [x] Add bias/std application in Model classes (EnerModel, TensorModel,
DOSModel)
- [x] Create shared _apply_out_bias_std method to eliminate code
duplication
- [x] Remove unnecessary hasattr checks since variables are always
initialized
- [x] Address review feedback: clean up fallback logic and simplify
model type checking
- [x] Remove bias_atom_e conversion fallback (decoupled architecture)
- [x] Remove unnecessary getattr usage
- [x] Consolidate duplicate dim_out calculation logic
- [x] Remove unnecessary hasattr checks for model_type
- [x] Simplify model type checking logic
- [x] Use _get_dim_out() method consistently in bias/std application and
serialization
- [x] Fix polar model output dimension (9 instead of 3) in
_get_dim_out()
- [x] Merge duplicate nout calculation logic in _apply_out_bias_std
method
- [x] Remove unnecessary try-except fallback in serialize method
- [x] Fix reshape errors in _apply_out_bias_std method causing CI
failures
- [x] Add missing get_out_bias/set_out_bias methods required by tests  
- [x] Add safety checks to prevent reshape errors for incompatible model
types
- [x] Initialize out_bias/out_std in PairwiseDPRc model to fix test
failures
- [x] Add robust error handling for invalid atom types and dimension
mismatches
- [x] Fix all major CI test failures (pairwise_dprc, model_spin,
out_bias_std tests)
- [x] Remove get/set methods for out_bias and out_std and update tests
- [x] Fix missing _apply_out_bias_std call in TensorModel causing CI
failures
- [x] Remove r_differentiable and c_differentiable parameters from polar
fitting serialize method
- [x] Remove system directory test files and add to .gitignore
- [x] Add debug logging for out_bias/out_std fallback behavior
- [x] Update logging pattern to follow codebase standard and remove
unnecessary pass statements
- [x] Remove unused _get_selected_atype method to clean up TensorModel
code

## Implementation Details:
✅ **Complete Model Coverage**: All model types (Energy, Tensor, DOS) now
properly apply out_bias/out_std using the shared method
✅ **Defensive Programming**: Added safety checks to gracefully handle
cases where tensor dimensions don't match expectations
✅ **Invalid Atom Type Handling**: Properly mask out -1 atom types to
prevent tf.gather index errors
✅ **Test Compatibility**: Removed unnecessary getter/setter methods and
updated tests to use direct property access
✅ **Robust Architecture**: Method works across different model types
(energy, DOS, spin, pairwise, dipole, polar) without breaking existing
functionality
✅ **Consistent Serialization**: Removed r_differentiable and
c_differentiable from polar fitting to match dpmodel reference
implementation
✅ **Clean Repository**: Removed accidentally committed test system files
and added system/ to .gitignore
✅ **Debug Logging**: Added debug-level logging using proper logger
pattern (`log = logging.getLogger(__name__)`) to indicate when
out_bias/out_std variables fall back to default values
✅ **Code Style**: Updated logging calls to follow codebase conventions
and removed unnecessary pass statements
✅ **Code Cleanup**: Removed unused _get_selected_atype method that was
previously part of bias/std application but is no longer needed

## Status: Ready for Review
The implementation now provides a clean, robust, and backward-compatible
solution for applying output bias and standard deviation consistently
across all TensorFlow model types. The public API has been simplified by
removing unnecessary getter/setter methods. All model types now
correctly apply bias/std transformations. The polar fitting
serialization is now consistent with the dpmodel reference
implementation. Test system files have been properly removed from the
repository. Debug logging follows the codebase's standard pattern using
proper logger instantiation and formatting. Unused methods have been
removed to maintain clean, maintainable code.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
Co-authored-by: Jinzhe Zeng <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: anyangml <[email protected]>
✅ **UPDATED: Fixed Documentation Structure and Language**

## Changes Made Based on Review Comments

### 📝 Addressed Feedback from @njzjz

**Issue**: The inserted section broke the original content structure and
the language was too informal.

**Changes**:

1. **Fixed broken documentation structure**
- Removed the standalone section that was inserted in the middle of
"Train a deep Wannier model for Wannier centroids"
- Integrated the atomic_dipole explanation into the existing flow
without breaking the section

2. **Formalized language and presentation**
- Converted informal bullet points and step-by-step lists to more formal
prose
- Integrated the explanation naturally into the existing sentence about
atomic_dipole being trained as labels
- Maintained technical accuracy while using more formal documentation
style

3. **Restored proper content flow**
- The section now flows properly from the loss configuration to the
atomic dipole explanation to the training commands
- No longer interrupts the original structure of the "Train a deep
Wannier model" section

### 📖 Final Result

The DPLR documentation now includes a concise, formal explanation of
what atomic_dipole means in the DPLR context (displacement from atom to
Wannier centroid) integrated seamlessly into the existing training
workflow description, without breaking the document structure.

Fixes deepmodeling#4970.

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.13.0 →
v0.13.1](astral-sh/ruff-pre-commit@v0.13.0...v0.13.1)
- [github.com/pre-commit/mirrors-clang-format: v21.1.0 →
v21.1.1](pre-commit/mirrors-clang-format@v21.1.0...v21.1.1)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary:
1. support python inference with `DP(model=paddle_inference.json)` for
ase, and add an unitest.
2. update ase document with different backend
3. fix typos in `DeepPotPD.cc`


---
This pull request introduces significant enhancements and refactoring to
the Paddle backend implementation of `DeepEval` in
`deepmd/pd/infer/deep_eval.py`, along with minor improvements to model
freezing in `deepmd/pd/entrypoints/main.py`. The most important changes
are the addition of support for static models loaded from `.json` files,
expanded model type handling, and improved output shape and evaluation
logic for various model branches and output variable categories.

### Static model and inference support

* Added support for loading and evaluating static models from `.json`
files, including Paddle inference engine integration and input/output
handle management for efficient prediction.
(`deepmd/pd/infer/deep_eval.py`)
[[1]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68L117-R181)
[[2]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68R470)
[[3]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68R481-R508)
[[4]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68R532-R547)
[[5]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68L420-R566)

### Expanded model type and branch handling

* Enhanced model type detection to support additional output types such
as DOS, dipole, polar, global polar, WFC, and property models, with
corresponding evaluator selection. Also added methods for model branch
information retrieval and default parameter checks.
(`deepmd/pd/infer/deep_eval.py`)
[[1]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68L152-R259)
[[2]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68L187-R306)

### Output variable and evaluation improvements

* Improved output shape determination for new output variable categories
(e.g., `DERV_R_DERV_R`), and refactored evaluation logic to handle both
static and dynamic models, including proper output conversion.
(`deepmd/pd/infer/deep_eval.py`)
[[1]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68R412)
[[2]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68R681-R683)
[[3]](diffhunk://#diff-8c2ffd525a36d0190726f1aca380b9a4e05e67cd8ba6fa5e3842f810c69e6c68L420-R566)
* Implemented the previously unimplemented `_eval_model_spin` method to
support spin-dependent model evaluation and output extraction.
(`deepmd/pd/infer/deep_eval.py`)

### Type embedding evaluation

* Added a new method `eval_typeebd` to extract and concatenate type
embedding network outputs from the loaded model.
(`deepmd/pd/infer/deep_eval.py`)

### Model freezing improvements

* Updated the `freeze` function to support freezing additional model
methods and atomic virial computation, and changed input specifications
for better compatibility. (`deepmd/pd/entrypoints/main.py`)
[[1]](diffhunk://#diff-e3f56cd14511cf86a0db88d6d9ee5b08cf45374edfdef0625a0f519d94c58507R345)
[[2]](diffhunk://#diff-e3f56cd14511cf86a0db88d6d9ee5b08cf45374edfdef0625a0f519d94c58507L377-R378)
[[3]](diffhunk://#diff-e3f56cd14511cf86a0db88d6d9ee5b08cf45374edfdef0625a0f519d94c58507L393-R400)
[[4]](diffhunk://#diff-e3f56cd14511cf86a0db88d6d9ee5b08cf45374edfdef0625a0f519d94c58507R413-R432)

Let me know if you'd like a walkthrough of any specific new
functionality or code sections!

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- New Features
- Dual evaluation modes: dynamic (.json) and static (.pd) with optional
no-JIT; new evaluation branches for additional model types and spin
support.
- Freeze can include atomic virial; frozen exports expose additional
buffer-backed getters (type map, cutoffs, parameter dims, ntypes).

- Improvements
- Wider static-graph support via persistent buffers across
descriptors/models; more consistent inference input handling and
batching.

- Documentation
  - ASE guide extended with backend-specific examples.

- Tests
- New end-to-end training, inference, and frozen-model validation tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: HydrogenSulfate <[email protected]>
Co-authored-by: Jinzhe Zeng <[email protected]>
- [x] Analyze DeepPotPT.cc pattern and understand requirements
- [x] Implement proper neighbor list support using model's forward_lower
interface
- [x] Add comprehensive neighbor list processing with
nlist_data.copy_from_nlist(), shuffle_exclude_empty(), and padding()
- [x] Implement atom selection and mapping using
select_real_atoms_coord() and select_map()
- [x] Create proper tensor creation with createNlistTensor() function
- [x] Handle dipole and polar model output keys (global_dipole, dipole,
global_polar, polar)
- [x] Support both simple compute method (without neighbor list) and
optimized method (with neighbor list)
- [x] Fix compilation errors and basic functionality
- [x] Resolve segmentation fault in neighbor list processing
- [x] Fix atomic tensor dimension mapping in neighbor list method
- [x] Adjust numerical tolerances for tests
- [x] Remove build artifacts and temp files from repository
- [x] Remove duplicate test model file (tests/infer/deepdipole_pt.pth)
- [x] Address all review comments: Remove try-catch block for
get_task_dim, fix global dipole assignment logic, update error messages,
and remove unused variables
- [x] Clean up build artifacts: Remove accidentally committed
build_pt_only directory and restore 3rdparty file
- [x] Fix test suite: Remove incorrect cpu_build_nlist_auto test case
- [x] Improve gitignore: Add build_*/ pattern to prevent future build
directory commits
- [x] **Address review feedback: Remove try-catch from output_dim(),
merge duplicate dipole/polar processing code, throw errors for
unsupported tensor types**

**Review Feedback Addressed:**
- ✅ **Simplified output_dim()**: Removed try-catch block since odim is
already initialized in init() method
- ✅ **Fixed else block in atomic tensor processing**: Now throws error
instead of creating zeros for unsupported tensor types
- ✅ **Merged duplicate dipole/polar code**: Consolidated processing
logic and added proper error handling for unsupported outputs
- ✅ **Error handling**: Added proper exceptions for unsupported atomic
tensor types following the same pattern as global tensors

**Current Status:** 
- Simple compute method works correctly (tests pass)
- C++ components build successfully without compilation errors
- Implementation follows DeepPotPT.cc pattern for consistency
- All review feedback has been addressed with proper error handling
- Ready for final testing and validation

The implementation is now complete and robust with proper error handling
for all edge cases.

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/deepmodeling/deepmd-kit/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: Jinzhe Zeng <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.13.1 →
v0.13.2](astral-sh/ruff-pre-commit@v0.13.1...v0.13.2)
- [github.com/pre-commit/mirrors-clang-format: v21.1.1 →
v21.1.2](pre-commit/mirrors-clang-format@v21.1.1...v21.1.2)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Comment on lines +253 to +255
from deepmd.dpmodel.common import (
get_xp_precision,
)

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.dpmodel.common
begins an import cycle.
)

if TYPE_CHECKING:
from deepmd.dpmodel.array_api import Array

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.dpmodel.array_api
begins an import cycle.
input: np.ndarray, from_precision: str, to_precision: str
) -> np.ndarray: ...
input: "Array", from_precision: str, to_precision: str
) -> "Array": ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
# get test data
test_data = data.get_test()
mixed_type = data.mixed_type
natoms = len(test_data["type"][0])

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable natoms is not used.
@njzjz njzjz merged commit bfa6245 into deepmodeling:master Sep 30, 2025
156 of 157 checks passed
@njzjz njzjz deleted the devel-3.1.1 branch September 30, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.