Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keep hashed scientific fixtures, evidence, and manuscript sources identical
# when a Windows checkout has core.autocrlf enabled.
validation_cases/**/*.md text eol=lf
validation_cases/**/*.json text eol=lf
validation_cases/**/*.csv text eol=lf
validation_cases/**/*.cif text eol=lf
src/diffractscout/benchmark_data/*.cif text eol=lf
src/diffractscout/benchmark_data/*.json text eol=lf
scripts/compare_reference_engines.py text eol=lf
paper/*.md text eol=lf
paper/*.bib text eol=lf
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ jobs:
run: |
python -c "import mp_api, pymatgen; from diffractscout.providers.materials_project import _matrix; assert _matrix([[1 if i == j else 0 for j in range(6)] for i in range(6)]) is not None"
pytest -q tests/test_provider_helpers.py
- name: Compare independent diffraction and elasticity implementations
run: python scripts/compare_reference_engines.py --output ci_reference_engines
- name: Upload independent numerical comparison
if: always()
uses: actions/upload-artifact@v7
with:
name: reference-engines-python-${{ matrix.python-version }}
path: ci_reference_engines
if-no-files-found: warn

cross-platform-smoke:
name: Smoke / ${{ matrix.os }}
Expand Down Expand Up @@ -174,11 +183,15 @@ jobs:
wheel-test/bin/diffractscout --version
wheel-test/bin/diffractscout demo -o wheel_demo
wheel-test/bin/diffractscout verify wheel_demo
wheel-test/bin/diffractscout inspect wheel_demo --json
wheel-test/bin/diffractscout benchmark -o wheel_benchmark
wheel_cif=$(wheel-test/bin/python -c "import pathlib,diffractscout; print(pathlib.Path(diffractscout.__file__).with_name('benchmark_data')/'fcc_al.cif')")
test -f "$wheel_cif"
wheel-test/bin/diffractscout-quick-export "$wheel_cif" -o wheel_quick.xlsx
wheel-test/bin/diffractscout preset save -o wheel_preset.json --no-patterns
wheel-test/bin/diffractscout preset show wheel_preset.json --json
wheel-test/bin/diffractscout-quick-export "$wheel_cif" -o wheel_quick.xlsx --preset wheel_preset.json
wheel-test/bin/diffractscout verify wheel_quick_bundle
wheel-test/bin/diffractscout inspect wheel_quick_bundle --json
test -x wheel-test/bin/diffractscout-gui
- name: Upload distributions
uses: actions/upload-artifact@v7
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ All notable changes are recorded here. The project follows semantic versioning a

### Added

- Reusable CLI/desktop analysis presets and read-only inspection of verified
result bundles, with explicit command-line override semantics. Presets exclude
credentials, paths, overwrite authorization, and manual tensor overrides.
- Reproducible comparisons with pymatgen for synthetic diffraction peak
positions and cubic directional moduli, with numerical reports retained by CI.
- Revised JOSS manuscript, software-comparison references, and evidence-based
submission documentation.
- Separate evidence-file input for JOSS readiness checks, so final verification
records can reference a committed source without changing its Git identity.
- Excel result overview and worksheet navigation, semantic header colors,
consistent scientific number formats, frozen phase columns, expandable
detail columns, and phase-relative intensity bars without changing canonical
data-sheet headers or stored scientific values.
- Separate Excel preview, permanent workbook-copy, and result-folder actions,
with phase/reflection/diagnostic counts in completion feedback.

- Windows launchers: `启动DiffractScout.bat` (GUI) and `quick_export_diffractscout.bat` (drag-and-drop quick-export with Excel next to the first input).
- Packaging stub `scripts/package_windows_portable.py` documenting a future PyInstaller portable layout (`--help` / `--print-recipe`; no freeze yet).
- Optional dependencies `figures` (matplotlib) and `gui-dnd` (tkinterdnd2); `paper` remains as a matplotlib alias.
Expand All @@ -22,6 +38,15 @@ All notable changes are recorded here. The project follows semantic versioning a

### Fixed

- Preserved saved changes in temporary Excel previews when closing the GUI.
- Rejected `.xlsx` quick-export targets combined with disabled Excel output
before writing, and reported the retained bundle workbook if publishing its
separate Excel copy fails.
- Prevented concurrent preset saves from replacing a newly created target
without explicit overwrite authorization.
- Reported CLI error diagnostics with their actual severity and exposed the
generated result files in completion summaries.

- Windows `quick_export_diffractscout.bat` now uses `scripts/diffractscout_entry.py`
and the same checkout interpreter order as the GUI launcher (repository
`.venv`, then `python`, then `py -3`), so drag-and-drop works after the README
Expand Down
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

**DiffractScout turns a chemical-system question or a folder of CIF files into a verifiable theoretical powder-diffraction reference bundle.** It preserves database identity, exact CIF hashes, structural diagnostics, radiation settings, optional elastic-tensor provenance, indexed reflections, warnings, and file checksums in one workflow.

[中文说明](README.zh-CN.md) · [API](docs/API.md) · [GUI guide](docs/GUI.md) · [Scientific contracts](docs/SCIENTIFIC_CONTRACTS.md) · [Validation](docs/VALIDATION.md) · [Release procedure](docs/RELEASE.md) · [JOSS readiness](docs/JOSS_READINESS.md)
[中文说明](README.zh-CN.md) · [CLI guide](docs/CLI.md) · [API](docs/API.md) · [GUI guide](docs/GUI.md) · [Scientific contracts](docs/SCIENTIFIC_CONTRACTS.md) · [Validation](docs/VALIDATION.md) · [Release procedure](docs/RELEASE.md) · [JOSS readiness](docs/JOSS_READINESS.md)

## Why this software exists

Expand Down Expand Up @@ -61,6 +61,24 @@ DiffractScout reimplements the CIF2Peaks desktop workflow inside a provenance-fi

Column-name mapping and intensity-channel aliases: [docs/SCHEMA_ALIASES.md](docs/SCHEMA_ALIASES.md). Engine semantics vs CIF2Peaks/pymatgen: [docs/ENGINE_PARITY.md](docs/ENGINE_PARITY.md).

Excel results include an overview with worksheet navigation, grouped table
headers, consistent scientific number formats, frozen phase columns, and
phase-relative intensity bars. The GUI can save/load analysis presets and
offers separate Excel preview, permanent-copy, and result-folder actions.
See [Working with Excel results](docs/EXCEL.md).

The CLI can save and reuse the same parameter presets and inspect a completed
bundle after verifying its integrity:

```bash
diffractscout preset save -o presets/energy-30.json --energy-keV 30
diffractscout analyze path/to/cifs -o outputs/run --preset presets/energy-30.json
diffractscout inspect outputs/run --json
```

Explicit command-line options override preset values. See the [CLI guide](docs/CLI.md)
for batch exit statuses, radiation overrides, and parameter-file handling.

When a *d*-spacing filter is used, the inclusive Bragg intersection is stored
separately from the requested angular window. `provenance.json` and phase
metadata distinguish `requested_two_theta_range_deg`,
Expand Down Expand Up @@ -197,6 +215,10 @@ PASS

Set `SOURCE_DATE_EPOCH` when an archive requires reproducible generated timestamps. See [docs/ANALYTIC_BENCHMARKS.md](docs/ANALYTIC_BENCHMARKS.md).

An optional [independent-engine comparison](validation_cases/independent_engines/README.md)
checks the same synthetic CIFs and cubic directional moduli against pymatgen.
CI preserves the numerical reports and dependency versions.

## Analyze local CIF files

```bash
Expand Down Expand Up @@ -343,7 +365,19 @@ Those repositories remain independent and unchanged by this project. Source snap

## JOSS preparation status

The repository contains an OSI-approved license, installable package metadata, tests, analytic benchmarks, CI, user and API documentation, governance, examples, contribution and support routes, tag-driven deterministic release packaging, a monthly reproducibility audit, dependency-update automation, a JOSS-format manuscript, and a specific AI usage disclosure. The public-development clock began on 12 August 2026. Formal submission remains blocked by the six-month/distributed-history gate, a completed real multiphase research case, independent diffraction and elasticity validation, external engagement, and human-confirmed metadata. The immutable software archive DOI is required after successful JOSS review for the publication stage, not for the initial submission. First run `python scripts/check_release.py` to create the current-source release receipt, then use `python scripts/joss_readiness.py --stage release|submission|publication`; see [docs/JOSS_READINESS.md](docs/JOSS_READINESS.md) and [docs/JOSS_REVIEW_CHECKLIST.md](docs/JOSS_REVIEW_CHECKLIST.md).
The repository includes an MIT license, installable package, tests, analytic and
independent numerical comparisons, CI, documentation, contribution and support
routes, reproducible release packaging, and a JOSS-format manuscript with AI
disclosure. The author reports use in published research; representative
citations and the associated software uses will be added to the submission
record. Public development began on 12 August 2026, so the JOSS requirement for
more than six months of active public history remains outstanding. The project
also tracks its own scientific-validation and engagement criteria separately
from official JOSS requirements. Run `python scripts/check_release.py` for the
current-source software acceptance checks; see [JOSS readiness](docs/JOSS_READINESS.md)
and the [review checklist](docs/JOSS_REVIEW_CHECKLIST.md) for the remaining
submission evidence and author confirmations. The final archive DOI is a
post-review publication step.

## Contributing, support, and citation

Expand Down
18 changes: 16 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**DiffractScout 将合金/化学体系候选相检索、本地 CIF 检查、理论粉末衍射计算、可选晶面法向弹性分析和可验证结果导出连接为一个流程。** 每项结果均可追溯到数据库记录或本地文件、CIF 哈希、辐射条件、计算定义、软件版本和结构化诊断。

[英文主页](README.md) · [API](docs/API.md) · [GUI 使用说明](docs/GUI.md) · [科研计算约定](docs/SCIENTIFIC_CONTRACTS.md) · [验证策略](docs/VALIDATION.md) · [发布流程](docs/RELEASE.md) · [JOSS 准备状态](docs/JOSS_READINESS.md)
[英文主页](README.md) · [CLI 使用说明](docs/CLI.md) · [API](docs/API.md) · [GUI 使用说明](docs/GUI.md) · [科研计算约定](docs/SCIENTIFIC_CONTRACTS.md) · [验证策略](docs/VALIDATION.md) · [发布流程](docs/RELEASE.md) · [JOSS 准备状态](docs/JOSS_READINESS.md)

## 两类工作流

Expand Down Expand Up @@ -52,6 +52,18 @@ DiffractScout 在可追溯结果包中重实现了 CIF2Peaks 的主要桌面工

列名与强度通道别名见 [docs/SCHEMA_ALIASES.md](docs/SCHEMA_ALIASES.md);与 CIF2Peaks/pymatgen 引擎差异见 [docs/ENGINE_PARITY.md](docs/ENGINE_PARITY.md)。

Excel 提供结果概览和工作表导航,按列的含义区分表头颜色,统一科学数值显示格式,冻结物相标识列,并用数据条辅助查看相内相对强度。界面支持保存、加载常用分析参数,以及独立的 Excel 预览、永久副本另存和结果文件夹入口。完整用法见 [Excel 结果使用说明](docs/EXCEL.md)。

CLI 同样可以保存、复用参数,并校验和查看已有结果包:

```powershell
diffractscout preset save -o presets/energy-30.json --energy-keV 30
diffractscout analyze path/to/cifs -o outputs/run --preset presets/energy-30.json
diffractscout inspect outputs/run --json
```

命令行显式参数优先于预设。批处理退出码、辐射条件覆盖和参数文件用法见 [CLI 使用说明](docs/CLI.md)。

启用 *d* 间距过滤时,程序会单独记录包含端点的 Bragg 求交结果。
`provenance.json` 和物相元数据区分用户请求的
`requested_two_theta_range_deg`、过滤后的
Expand Down Expand Up @@ -170,6 +182,8 @@ diffractscout benchmark -o outputs/analytic_benchmark

该命令对简单立方、BCC、FCC、NaCl 和立方晶体方向弹性执行 45 项闭式解检查,并输出固定输入、预期值、容差、软件版本、运行环境、报告和 SHA-256 清单。成功结果为 `45/45 passed`。详见 [docs/ANALYTIC_BENCHMARKS.md](docs/ANALYTIC_BENCHMARKS.md)。

另有可复现的 [pymatgen 独立数值对照](validation_cases/independent_engines/README.md),比较相同合成 CIF 的峰位和立方晶体方向模量,并在 CI 中保留数值报告和依赖版本。

## 本地 CIF 分析

```powershell
Expand Down Expand Up @@ -250,7 +264,7 @@ J_no_LP = I_no_LP / V_cell²

当前离线 pytest 套件覆盖成分解析、子体系枚举及组合数量上限、大小写 CIF 扫描、同名文件防覆盖、CIF 数据块和空间群解析、特殊位置占位转换、系统消光、解析结构因子、Bragg 几何、边界反射、刚度单位换算、弹性张量检查、侧车配对、资源限制、数据库失败语义、事务式输出、电子表格安全、确定性证据归档、严格清单校验和投稿准备检查。测试收集数由 pytest/CI 报告,不再复制到静态文档;另有稳定的 45 项解析科学基准。GitHub Actions 还配置了多 Python 版本、Windows/macOS、Linux 无头 GUI、wheel 安装、解析基准、发布制品、月度复现审计、依赖更新和 JOSS 论文构建。月度定时运行只记录某一公开提交的可复现状态;只有由真实缺陷、依赖更新、验证、文档改进或用户反馈形成的公开提交、Issue、Pull Request 或 Release 才构成开发活动证据。

JOSS 正式投稿仍需要真实且分布式的六个月公开开发记录、真实材料用例、独立衍射与弹性验证、外部互动、人工确认的元数据,以及通过官方 Open Journals 构建并逐页检查的稿件。先执行 `python scripts/check_release.py` 生成与当前源码绑定的发布验收收据,再用 `python scripts/joss_readiness.py --stage submission --output build/joss-readiness` 生成投稿阻塞项报告。不可变软件归档 DOI 属于 JOSS 审稿完成后的 `publication` 阶段,不是初次投稿的前置条件;工作计划见 [docs/JOSS_6_MONTH_PLAN.md](docs/JOSS_6_MONTH_PLAN.md)。
作者已确认软件用于其已发表研究,代表论文及具体使用情况将在投稿记录中补充。项目自 2026 年 8 月 12 日开始公开开发,目前尚未满足 JOSS 超过六个月的持续公开开发要求。项目自定的科学验证、社区参与要求与 JOSS 官方门槛分别列于 [投稿准备状态](docs/JOSS_READINESS.md)。先执行 `python scripts/check_release.py` 验收当前软件,再用 `python scripts/joss_readiness.py --stage submission --output build/joss-readiness` 检查待补的投稿证据和作者确认事项。最终软件归档 DOI 在审稿完成后的 `publication` 阶段补入;工作计划见 [docs/JOSS_6_MONTH_PLAN.md](docs/JOSS_6_MONTH_PLAN.md)。

## 来源与许可

Expand Down
Loading
Loading