alloy-model-forge 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. alloy_model_forge-1.0.1/.github/workflows/python-package.yml +102 -0
  2. alloy_model_forge-1.0.1/.github/workflows/tests.yml +36 -0
  3. alloy_model_forge-1.0.1/.gitignore +25 -0
  4. alloy_model_forge-1.0.1/.python-version +1 -0
  5. alloy_model_forge-1.0.1/CHANGELOG.md +49 -0
  6. alloy_model_forge-1.0.1/CITATION.cff +20 -0
  7. alloy_model_forge-1.0.1/CONTRIBUTING.md +17 -0
  8. alloy_model_forge-1.0.1/ENVIRONMENT.md +64 -0
  9. alloy_model_forge-1.0.1/LICENSE +21 -0
  10. alloy_model_forge-1.0.1/PKG-INFO +618 -0
  11. alloy_model_forge-1.0.1/README.md +555 -0
  12. alloy_model_forge-1.0.1/benchmarks/golden_cases.yaml +38 -0
  13. alloy_model_forge-1.0.1/docs/NATIVE_SQS_METHOD.md +163 -0
  14. alloy_model_forge-1.0.1/docs/PUBLICATION_WORKFLOW.md +70 -0
  15. alloy_model_forge-1.0.1/docs/SRO_ALGORITHM_RESEARCH.md +480 -0
  16. alloy_model_forge-1.0.1/environment.yml +16 -0
  17. alloy_model_forge-1.0.1/examples/fcc_bcc_dual_phase.yaml +29 -0
  18. alloy_model_forge-1.0.1/examples/fcc_bcc_hcp_core_shell.yaml +50 -0
  19. alloy_model_forge-1.0.1/examples/fcc_bcc_hcp_core_shell_directional_sqs.yaml +69 -0
  20. alloy_model_forge-1.0.1/examples/fcc_bcc_spherical_precipitate.yaml +40 -0
  21. alloy_model_forge-1.0.1/examples/fcc_cocrfeni_native_sqs.yaml +28 -0
  22. alloy_model_forge-1.0.1/examples/fcc_polycrystal.yaml +28 -0
  23. alloy_model_forge-1.0.1/examples/fcc_polycrystal_region_sqs.yaml +51 -0
  24. alloy_model_forge-1.0.1/examples/fcc_rectangular_cell.yaml +20 -0
  25. alloy_model_forge-1.0.1/examples/hcp_ti_single_crystal.yaml +22 -0
  26. alloy_model_forge-1.0.1/pyproject.toml +63 -0
  27. alloy_model_forge-1.0.1/requirements-lock.txt +49 -0
  28. alloy_model_forge-1.0.1/scripts/bootstrap-dev.ps1 +32 -0
  29. alloy_model_forge-1.0.1/scripts/check_installed_distribution.py +59 -0
  30. alloy_model_forge-1.0.1/scripts/golden_benchmark.py +271 -0
  31. alloy_model_forge-1.0.1/scripts/journal_validation.py +339 -0
  32. alloy_model_forge-1.0.1/scripts/ovito_gold_standard.py +143 -0
  33. alloy_model_forge-1.0.1/scripts/publication_benchmark.py +123 -0
  34. alloy_model_forge-1.0.1/scripts/recover_codex_transcript.py +195 -0
  35. alloy_model_forge-1.0.1/scripts/reproducibility_check.py +61 -0
  36. alloy_model_forge-1.0.1/scripts/run-web.ps1 +10 -0
  37. alloy_model_forge-1.0.1/scripts/scientific_validation.py +83 -0
  38. alloy_model_forge-1.0.1/scripts/validate_web_workflows.py +118 -0
  39. alloy_model_forge-1.0.1/src/alloyforge/__init__.py +14 -0
  40. alloy_model_forge-1.0.1/src/alloyforge/_version.py +3 -0
  41. alloy_model_forge-1.0.1/src/alloyforge/analysis.py +334 -0
  42. alloy_model_forge-1.0.1/src/alloyforge/backends/__init__.py +2 -0
  43. alloy_model_forge-1.0.1/src/alloyforge/backends/sqs.py +148 -0
  44. alloy_model_forge-1.0.1/src/alloyforge/builder.py +1230 -0
  45. alloy_model_forge-1.0.1/src/alloyforge/chemistry.py +1407 -0
  46. alloy_model_forge-1.0.1/src/alloyforge/cli.py +111 -0
  47. alloy_model_forge-1.0.1/src/alloyforge/config.py +361 -0
  48. alloy_model_forge-1.0.1/src/alloyforge/orientation.py +76 -0
  49. alloy_model_forge-1.0.1/src/alloyforge/progress.py +34 -0
  50. alloy_model_forge-1.0.1/src/alloyforge/provenance.py +58 -0
  51. alloy_model_forge-1.0.1/src/alloyforge/rendering.py +227 -0
  52. alloy_model_forge-1.0.1/src/alloyforge_web/__init__.py +2 -0
  53. alloy_model_forge-1.0.1/src/alloyforge_web/app.py +359 -0
  54. alloy_model_forge-1.0.1/src/alloyforge_web/jobs.py +256 -0
  55. alloy_model_forge-1.0.1/src/alloyforge_web/render_jobs.py +53 -0
  56. alloy_model_forge-1.0.1/src/alloyforge_web/static/3Dmol-min.js +2 -0
  57. alloy_model_forge-1.0.1/src/alloyforge_web/static/3Dmol-min.js.LICENSE.txt +5 -0
  58. alloy_model_forge-1.0.1/src/alloyforge_web/static/3Dmol.js.LICENSE +90 -0
  59. alloy_model_forge-1.0.1/src/alloyforge_web/static/app.js +114 -0
  60. alloy_model_forge-1.0.1/src/alloyforge_web/static/index.html +172 -0
  61. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-core-shell.png +0 -0
  62. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-dual-phase.png +0 -0
  63. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-polycrystal-elements.png +0 -0
  64. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-region-sqs.png +0 -0
  65. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-sro-benchmark.png +0 -0
  66. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase-workbench.png +0 -0
  67. alloy_model_forge-1.0.1/src/alloyforge_web/static/showcase.css +110 -0
  68. alloy_model_forge-1.0.1/src/alloyforge_web/static/styles.css +2 -0
  69. alloy_model_forge-1.0.1/src/alloyforge_web/static/web-overrides.css +10 -0
  70. alloy_model_forge-1.0.1/src/alloymodelforge/__init__.py +25 -0
  71. alloy_model_forge-1.0.1/tests/test_builder.py +420 -0
  72. alloy_model_forge-1.0.1/tests/test_config.py +33 -0
  73. alloy_model_forge-1.0.1/tests/test_ovito_analysis.py +35 -0
  74. alloy_model_forge-1.0.1/tests/test_ovito_rendering.py +72 -0
  75. alloy_model_forge-1.0.1/tests/test_public_brand.py +39 -0
  76. alloy_model_forge-1.0.1/tests/test_render_jobs.py +49 -0
  77. alloy_model_forge-1.0.1/tests/test_scientific_validation.py +369 -0
  78. alloy_model_forge-1.0.1/tests/test_web.py +91 -0
  79. alloy_model_forge-1.0.1/tests/test_web_ui.py +85 -0
@@ -0,0 +1,102 @@
1
+ name: Python package
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ inputs:
7
+ index:
8
+ description: Package index to publish to
9
+ type: choice
10
+ required: true
11
+ default: testpypi
12
+ options:
13
+ - testpypi
14
+ - pypi
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ with:
25
+ persist-credentials: false
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.13"
29
+ - name: Verify the requested release tag
30
+ if: github.event_name == 'workflow_dispatch'
31
+ run: |
32
+ python - <<'PY'
33
+ import os
34
+ from pathlib import Path
35
+ import tomllib
36
+
37
+ version = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]["version"]
38
+ expected = f"refs/tags/v{version}"
39
+ if os.environ["GITHUB_REF"] != expected:
40
+ raise SystemExit(f"Run this workflow from the release tag v{version}.")
41
+ PY
42
+ - name: Build the wheel and source distribution
43
+ run: |
44
+ python -m pip install build twine
45
+ python -m build
46
+ python -m twine check --strict dist/*
47
+ - uses: actions/upload-artifact@v5
48
+ with:
49
+ name: python-distributions
50
+ path: dist/
51
+ if-no-files-found: error
52
+
53
+ installed-package:
54
+ needs: build
55
+ strategy:
56
+ fail-fast: false
57
+ matrix:
58
+ include:
59
+ - os: ubuntu-latest
60
+ python: "3.11"
61
+ - os: windows-latest
62
+ python: "3.13"
63
+ runs-on: ${{ matrix.os }}
64
+ steps:
65
+ - uses: actions/checkout@v6
66
+ with:
67
+ persist-credentials: false
68
+ - uses: actions/setup-python@v6
69
+ with:
70
+ python-version: ${{ matrix.python }}
71
+ - uses: actions/download-artifact@v6
72
+ with:
73
+ name: python-distributions
74
+ path: dist/
75
+ - name: Install the built wheel and run smoke tests
76
+ shell: bash
77
+ run: |
78
+ wheel=(dist/*.whl)
79
+ python -m pip install "${wheel[0]}[web,test]"
80
+ python -m pip check
81
+ python -I scripts/check_installed_distribution.py
82
+
83
+ publish:
84
+ if: github.event_name == 'workflow_dispatch'
85
+ needs: installed-package
86
+ runs-on: ubuntu-latest
87
+ environment: ${{ inputs.index }}
88
+ permissions:
89
+ id-token: write
90
+ steps:
91
+ - uses: actions/download-artifact@v6
92
+ with:
93
+ name: python-distributions
94
+ path: dist/
95
+ - name: Publish to TestPyPI
96
+ if: inputs.index == 'testpypi'
97
+ uses: pypa/gh-action-pypi-publish@release/v1
98
+ with:
99
+ repository-url: https://test.pypi.org/legacy/
100
+ - name: Publish to PyPI
101
+ if: inputs.index == 'pypi'
102
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,36 @@
1
+ name: conda-tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ full:
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ os: [ubuntu-latest, windows-latest]
13
+ runs-on: ${{ matrix.os }}
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: conda-incubator/setup-miniconda@v3
17
+ with:
18
+ activate-environment: alloymodelforge-dev
19
+ environment-file: environment.yml
20
+ auto-activate-base: false
21
+ channel-priority: strict
22
+ - shell: bash -el {0}
23
+ run: python -m pip check
24
+ - name: Run headless-safe automated tests
25
+ shell: bash -el {0}
26
+ run: python -m pytest -q -m "not ovito_render"
27
+ - shell: bash -el {0}
28
+ run: python scripts/scientific_validation.py --output scientific-validation-conda.json
29
+ - shell: bash -el {0}
30
+ run: python scripts/journal_validation.py --output journal-validation
31
+ - uses: actions/upload-artifact@v4
32
+ with:
33
+ name: scientific-validation-${{ matrix.os }}
34
+ path: |
35
+ scientific-validation-conda.json
36
+ journal-validation/
@@ -0,0 +1,25 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ output/
9
+ node_modules/
10
+ .venv/
11
+ .conda/
12
+ repro-output/
13
+ validation-output/
14
+ test-output/
15
+ test-dual-output/
16
+ conversation-recovery/
17
+ scientific-validation*.json
18
+ journal-validation/
19
+ publication-benchmark/
20
+ ovito-gold-standard/
21
+ *.log
22
+ .coverage
23
+ htmlcov/
24
+ .idea/
25
+ .vscode/
@@ -0,0 +1 @@
1
+ 3.13.5
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 1.0.1 - 2026-12-03
6
+
7
+ - Include the YAML presets in installed packages so all eight Web templates work after `pip install`.
8
+ - Include notices for the bundled 3Dmol.js viewer and exclude literature comparison figures from the source distribution.
9
+ - Verify the installed wheel on Windows and Linux before publishing to PyPI.
10
+
11
+ ## 1.0 - 2026-08-28
12
+
13
+ - Declared the first stable AlloyModelForge release and unified the package,
14
+ Python API, Web API, provenance, citation metadata and documentation version.
15
+ - Upgraded native SQS to finite-size fixed-composition pair targets, region
16
+ feasibility diagnostics, internal/touching pair scopes, composition-directed
17
+ swaps, adaptive acceptance-rate control and reproducible early stopping.
18
+ - Added dimensionless objective decomposition, independent multi-start
19
+ statistics, MILP proof of joint regional-composition feasibility, crossing
20
+ interface bonds, non-random pair propensity targets and exact small-cell
21
+ optimality benchmarks.
22
+ - Added Native SQS v4 directional source-to-target Warren-Cowley objectives
23
+ with frozen phase reference compositions and restricted finite-composition
24
+ angular triplet motifs with local incremental updates.
25
+ - Added serialized, non-blocking OVITO render jobs with unique outputs and status API.
26
+ - Added Tachyon figure legends, counts, fractions, DPI metadata and publication controls.
27
+ - Added grain equivalent-diameter, centroid and empty-grain validation.
28
+ - Added inclusion/core-shell composition, connectivity, center-offset and radial phase profiles.
29
+ - Added CNA/PTM interior-versus-interface statistics.
30
+ - Added model resource limits, disk-space checks and safe completed-job deletion.
31
+ - Added publication workflow, interpretation limits and reproducibility checklist.
32
+
33
+ ## 0.2.0 - 2026-08-27
34
+
35
+ - Renamed the public software brand from AlloyForge to AlloyModelForge to make
36
+ its role as an atomistic alloy model generator explicit.
37
+ - Added the formal `alloy-model-forge` and `alloy-model-forge-web` commands,
38
+ while preserving the legacy short commands and Python import path.
39
+ - Renamed the reproducible Conda environment to `alloymodelforge-dev` and the
40
+ default local Web data directory to `.alloymodelforge/jobs`.
41
+ - Updated Web, documentation, citation metadata, validation reports and
42
+ publication terminology for the new public name.
43
+
44
+ ## 0.1.0 - 2026-08-25
45
+
46
+ - Initial FCC, BCC, HCP, polycrystal, multiphase and inclusion builders.
47
+ - Native SQS, sqsgenerator and icet adapters with SRO reporting.
48
+ - OVITO CNA/PTM analysis, CLI, Python API and optional browser interface.
49
+ - Scientific validation, provenance and deterministic structure fingerprints.
@@ -0,0 +1,20 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use AlloyModelForge in published work, please cite this software."
3
+ title: "AlloyModelForge: high-throughput construction and validation of atomistic alloy models for downstream MD and DFT"
4
+ type: software
5
+ authors:
6
+ - family-names: "Contributors"
7
+ given-names: "AlloyModelForge"
8
+ version: "1.0.1"
9
+ date-released: 2026-12-03
10
+ repository-code: "https://github.com/caojian1134/AlloyModelForge"
11
+ url: "https://github.com/caojian1134/AlloyModelForge"
12
+ license: MIT
13
+ keywords:
14
+ - alloys
15
+ - polycrystals
16
+ - special quasirandom structures
17
+ - atomistic modelling
18
+ - molecular dynamics
19
+ - density functional theory
20
+ - high-throughput modelling
@@ -0,0 +1,17 @@
1
+ # Contributing
2
+
3
+ Use the repository-local environment described in `ENVIRONMENT.md`. Before a
4
+ change is submitted, run:
5
+
6
+ ```powershell
7
+ conda run -n alloymodelforge-dev python -m pytest
8
+ conda run -n alloymodelforge-dev python scripts\scientific_validation.py
9
+ ```
10
+
11
+ Scientific changes must include a test with a physical invariant or an
12
+ independent reference result. Tests that only assert that a file exists or a
13
+ function returns are not sufficient for model-building changes. Do not change
14
+ scientific tolerances without documenting the physical or numerical reason.
15
+
16
+ External backends must record their name and version and must never silently
17
+ fall back to an AlloyModelForge implementation.
@@ -0,0 +1,64 @@
1
+ # AlloyModelForge development environment
2
+
3
+ ## Environments
4
+
5
+ - Full scientific environment: Conda environment `alloymodelforge-dev`
6
+ - Python: 3.13 (currently resolved and tested as 3.13.15, 64-bit Windows)
7
+ - SciPy: 1.18.1 (pinned because 1.18.0 changes the fixed-seed rotation result)
8
+ - Definition: `environment.yml`
9
+ - Includes: icet 3.0, sqsgenerator 0.5.6, OVITO 3.16.0, Web and tests
10
+ - Bootstrap/update command: `powershell -ExecutionPolicy Bypass -File scripts\bootstrap-dev.ps1`
11
+
12
+ Do not install or run AlloyModelForge from the Conda `base` environment. All project
13
+ commands, tests, Web services, and scientific validation use `alloymodelforge-dev`.
14
+ The environment file uses `nodefaults`, and the bootstrap script enforces strict
15
+ channel priority, so a machine-level `.condarc` cannot silently add the Anaconda
16
+ defaults channel. The script also persists `PYTHONNOUSERSITE=1` in this environment
17
+ to prevent unrelated packages from `%APPDATA%\\Python` entering validation runs.
18
+
19
+ ## Verified capabilities
20
+
21
+ The Conda environment includes ASE, NumPy, SciPy, FastAPI, icet,
22
+ sqsgenerator, and the official OVITO distribution. `pip check` passes and all
23
+ 81 tests pass in the current release, including the environment-contract test,
24
+ the real icet backend, Web
25
+ workflow coverage, scientific invariants, and OVITO CNA/PTM tests.
26
+
27
+ ## Reproducibility baseline
28
+
29
+ Run:
30
+
31
+ ```powershell
32
+ conda run -n alloymodelforge-dev python scripts\reproducibility_check.py
33
+ ```
34
+
35
+ Expected structure fingerprint:
36
+
37
+ ```text
38
+ 96b3b5a0860682320679c70617c7134e7179aea5f7fbee6dbbadcf18c6f49753
39
+ ```
40
+
41
+ Expected atom count and composition: 459 atoms, Co=230, Ni=229. The minimum
42
+ distance is 1.554171787371 angstrom. The expected validation status is
43
+ `WARNING`, because this deliberately small random-orientation polycrystal has
44
+ non-commensurate periodic seams and a high boundary fraction. The script
45
+ returns a non-zero exit code if any part of this baseline changes.
46
+
47
+ ## Conda environment with icet
48
+
49
+ The authoritative full scientific environment is created with:
50
+
51
+ ```powershell
52
+ conda env create -f environment.yml
53
+ conda activate alloymodelforge-dev
54
+ ```
55
+
56
+ It installs the conda-forge binary build of `icet 3.0` and the official OVITO
57
+ Conda build from `https://conda.ovito.org`, avoiding local C++ compilation and
58
+ the Qt DLL conflict caused by mixing the PyPI OVITO wheel with Conda. PyPI
59
+ `icet 3.2` remains source-only on this platform;
60
+ the package extra accepts compatible icet releases from 3.0 through 3.2, while
61
+ the reproducible Conda environment deliberately pins the tested 3.0 build.
62
+ SciPy is installed from the pip section at exactly 1.18.1 after Conda resolves
63
+ the compiled scientific stack; this is required for the documented fixed-seed
64
+ fingerprint.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AlloyModelForge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.