{"id":34253639,"url":"https://github.com/bagabaga007/ion_csp","last_synced_at":"2026-03-11T08:02:33.519Z","repository":{"id":289779139,"uuid":"899296659","full_name":"Bagabaga007/ion_CSP","owner":"Bagabaga007","description":"Crystal Structure Design Software Based on Molecular/Ionic Configuration","archived":false,"fork":false,"pushed_at":"2025-12-12T06:48:00.000Z","size":209239,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T06:35:53.822Z","etag":null,"topics":["crystal-structure-prediction","ionic"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bagabaga007.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-06T01:33:09.000Z","updated_at":"2025-12-12T06:46:00.000Z","dependencies_parsed_at":"2025-06-27T04:35:51.328Z","dependency_job_id":null,"html_url":"https://github.com/Bagabaga007/ion_CSP","commit_stats":null,"previous_names":["bagabaga007/ion_csp"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Bagabaga007/ion_CSP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bagabaga007%2Fion_CSP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bagabaga007%2Fion_CSP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bagabaga007%2Fion_CSP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bagabaga007%2Fion_CSP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bagabaga007","download_url":"https://codeload.github.com/Bagabaga007/ion_CSP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bagabaga007%2Fion_CSP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30375481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal-structure-prediction","ionic"],"created_at":"2025-12-16T11:48:33.686Z","updated_at":"2026-03-11T08:02:33.514Z","avatar_url":"https://github.com/Bagabaga007.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 基于分子/离子构型的晶体结构设计软件 V2.3\n\n[![Version](https://img.shields.io/badge/version-2.3.0-blue.svg)](https://github.com/Bagabaga007/ion_CSP)\n[![Python](https://img.shields.io/badge/python-3.11+-green.svg)](https://www.python.org/)\n[![License](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE)\n[![Tests](https://img.shields.io/badge/tests-420%20passed-brightgreen.svg)](tests/)\n[![Coverage](https://img.shields.io/badge/coverage-99.39%25-brightgreen.svg)](htmlcov/)\n\n## 项目概述\n\n基于分子/离子构型的晶体结构设计软件通过结合经验公式、机器学习势函数微调、第一性原理分步优化和分子/离子识别技术，实现了从分子/离子构型出发的高效晶体结构设计。该软件采用模块化设计，支持全流程自动化材料筛选，在保证预测精度的同时显著提升计算效率。\n\n## 🎯 功能特性\n\n### 核心功能\n\n- **双模块工作流**\n  - **EE模块**：基于经验评估的离子组合生成\n  - **CSP模块**：基于离子晶体结构预测的优化筛选\n- **智能任务管理**\n  - 实时进程监控（PID跟踪）\n  - 日志文件自动符号链接\n  - 进程安全终止与资源清理\n- **高级日志系统**\n  - 分页浏览（10条/页）\n  - 模块过滤（CSP/EE）\n  - 软链接解析显示实际路径\n\n### 技术特性\n\n- 跨平台支持（Linux/Docker）\n- 基于Python 3.11+的面向对象架构\n- 集成psutil进程管理\n- 结构化日志记录系统\n- **工业级测试覆盖**（420个测试，99.39%覆盖率）\n\n## 📊 质量保证\n\n### 测试统计\n\n| 测试层级 | 测试数量 | 覆盖率 | 状态 |\n| ------- | -------- | ----- | ---- |\n| 单元测试 | 338 | 99.39% | ✅ |\n| 集成测试 | 48 | 85%+ | ✅ |\n| 配置项测试 | 31 | N/A | ✅ |\n| 系统测试 | 3 | N/A | ✅ |\n| **总计** | **420** | **99.39%** | ✅ |\n\n### 测试特点\n\n- ✅ **0个跳过测试** - 所有测试都能实际运行\n- ✅ **快速执行** - 完整测试套件60秒内完成\n- ✅ **自动清理** - 测试后自动清理临时文件\n- ✅ **跨平台兼容** - 支持命令行和VSCode运行\n\n详细测试报告请查看 [docs/TEST_REPORT.md](docs/TEST_REPORT.md)\n\n## 🚀 安装指南\n\n### 环境要求\n\n| 组件        | 最低版本 |\n|-------------|----------|\n| Python      | 3.11     |\n| psutil      | 5.9      |\n| Docker      | 20.10    |\n| ase         | 3.23.0   |\n| deepmd-kit  | 3.0.1    |\n| torch       | 2.5.0    |\n| dpdispatcher| 0.6.7    |\n| numpy       | 1.26.4   |\n| paramiko    | 3.5.1    |\n| pyxtal      | 1.0.4    |\n| phonopy     | 2.28.0   |\n| rdkit       | 2024.03.3|\n| pytest      | 8.3.4    |\n| pytest-cov  | 6.2.1    |\n\n### 安装步骤\n\n#### 方式一：从PyPI安装（推荐）\n\n```bash\npip install ion-csp\n```\n\n#### 方式二：从源码安装\n\n```bash\n# 创建虚拟环境\npython -m venv venv\nsource venv/bin/activate  # Linux/Mac\n# Windows: venv\\Scripts\\activate\n\n# 克隆仓库\ngit clone https://github.com/Bagabaga007/ion_CSP.git\ncd ion_CSP\n\n# 安装依赖\npip install -e .\n```\n\n## 💡 快速入门\n\n### 交互模式\n\n```bash\nion-csp\n```\n\n启动交互式命令行界面，支持以下操作：\n\n- 模块选择\n- 日志查看\n- 进程管理\n\n### 脚本调用\n\n#### EE模块示例\n\n```bash\n./scripts/main_EE.sh examples/example_1\n```\n\n从SMILES表格生成离子组合\n\n#### CSP模块示例\n\n```bash\n./scripts/main_CSP.sh examples/example_2\n```\n\n从离子组合生成并优化晶体结构\n\n## 🏗️ 技术架构\n\n```mermaid\ngraph TD\n    A[用户界面] --\u003e B[任务管理器]\n    B --\u003e C[EE模块]\n    B --\u003e D[CSP模块]\n    B --\u003e E[日志系统]\n    B --\u003e F[任务调度]\n    C --\u003e G[经验评估引擎]\n    D --\u003e H[离子晶体结构预测引擎]\n    E --\u003e I[结构化日志]\n    F --\u003e J[进程终止]\n```\n\n## 🧪 运行测试\n\n```bash\n# 运行所有测试\npytest\n\n# 查看覆盖率报告\npytest --cov=src/ion_CSP --cov-report=html\n\n# 运行特定层级的测试\npytest tests/unit/        # 单元测试\npytest tests/integration/ # 集成测试\npytest tests/ci/          # 配置项测试\npytest tests/system/      # 系统测试\n```\n\n详细测试说明请查看 [tests/README.md](tests/README.md)\n\n## 📚 文档\n\n- [测试报告](docs/TEST_REPORT.md) - 完整的测试实施报告\n- [测试说明](tests/README.md) - 测试分层和运行指南\n- [CSP使用示例](docs/example_usage_CSP.py) - CSP模块使用示例\n- [EE使用示例](docs/example_usage_EE.py) - EE模块使用示例\n\n## 🔄 版本历史\n\n### V2.3.0 (2026-03-05)\n\n#### 测试系统重大升级\n\n- ✅ 实现完整的4层测试金字塔（420个测试）\n- ✅ 达到99.39%代码覆盖率\n- ✅ 消除所有跳过的测试（从3个减少到0个）\n- ✅ 修复VSCode测试兼容性问题\n- ✅ 添加自动清理临时文件功能\n- ✅ 优化Coverage配置，排除__main__块\n- ✅ 重新设计系统测试，使用mock替代真实依赖\n\n#### 配置项测试（CI Tests）\n\n- ✅ 新增31个配置项测试，覆盖7大类别\n- ✅ 文档审查、静态分析、内存测试、功能测试\n- ✅ 性能测试、兼容性测试、维护性测试、可移植性测试\n\n#### 测试基础设施\n\n- ✅ 添加全局Python路径自动设置\n- ✅ 实现多重回退策略获取版本号\n- ✅ 优化测试执行时间（60秒内完成）\n\n### V2.2.6 (2025-12-12)\n\n- 重构VaspProcessing模块，测试覆盖率提升至88%\n- 改进task_manager.py测试覆盖率至98.59%\n- 增强分子识别和代码覆盖率测试\n\n## 🤝 贡献指南\n\n1. Fork仓库并创建特性分支\n2. 编写单元测试覆盖新功能（保持99%+覆盖率）\n3. 确保所有测试通过：`pytest`\n4. 提交Pull Request时注明关联Issue\n5. 遵循PEP8代码规范\n\n### 开发环境设置\n\n```bash\n# 安装开发依赖\npip install -e \".[dev]\"\n\n# 运行测试\npytest\n\n# 检查代码风格\nflake8 src/\n\n# 生成覆盖率报告\npytest --cov=src/ion_CSP --cov-report=html\n```\n\n## 📄 许可证\n\n本项目采用MIT许可证，详见[LICENSE](LICENSE)文件。\n\n## 👥 作者\n\n- **Ze Yang** - *主要开发者* - yangze1995007@163.com\n\n## 🙏 致谢\n\n感谢所有为本项目做出贡献的开发者和用户。\n\n---\n\n## Project Overview (English)\n\nThis software enables efficient crystal structure design from molecular/ion configurations by integrating empirical formulas, tuned machine learning potentials, stepwise first-principles optimization, and molecular/ion recognition techniques. The modular architecture ensures extensibility and maintainability while maintaining prediction accuracy.\n\n## Key Features\n\n### Core Functionalities\n\n- **Dual-Module Workflow**\n  - **EE Module**: Empirical evaluation-based ion combination generation\n  - **CSP Module**: Ion crystal structure prediction and optimization\n- **Intelligent Task Management**\n  - Real-time process monitoring (PID tracking)\n  - Automatic log file symlink creation\n  - Safe process termination with resource cleanup\n- **Advanced Logging System**\n  - Paginated log viewing (10 entries/page)\n  - Module-based filtering (CSP/EE)\n  - Symlink resolution for actual log paths\n\n### Technical Specifications\n\n- Cross-platform support (Linux/Docker)\n- Object-oriented architecture with Python 3.11+\n- Integrated process management via psutil\n- Structured logging system\n- **Industrial-grade test coverage** (420 tests, 99.39% coverage)\n\n## Quality Assurance\n\n### Test Statistics\n\n| Test Level | Count | Coverage | Status |\n| ---------- | ----- | -------- | ------ |\n| Unit Tests | 338 | 99.39% | ✅ |\n| Integration Tests | 48 | 85%+ | ✅ |\n| CI Tests | 31 | N/A | ✅ |\n| System Tests | 3 | N/A | ✅ |\n| **Total** | **420** | **99.39%** | ✅ |\n\n### Test Features\n\n- ✅ **0 skipped tests** - All tests can actually run\n- ✅ **Fast execution** - Complete test suite in 60 seconds\n- ✅ **Auto cleanup** - Automatic cleanup of temporary files\n- ✅ **Cross-platform** - Works in CLI and VSCode\n\nSee [docs/TEST_REPORT.md](docs/TEST_REPORT.md) for detailed test report.\n\n## Installation\n\n### Prerequisites\n\n| Component   | Min Version |\n|-------------|-------------|\n| Python      | 3.11        |\n| psutil      | 5.9         |\n| Docker      | 20.10       |\n| ase         | 3.23.0      |\n| deepmd-kit  | 3.0.1       |\n| torch       | 2.5.0       |\n| dpdispatcher| 0.6.7       |\n| numpy       | 1.26.4      |\n| paramiko    | 3.5.1       |\n| pyxtal      | 1.0.4       |\n| phonopy     | 2.28.0      |\n| rdkit       | 2024.03.3   |\n| pytest      | 8.3.4       |\n| pytest-cov  | 6.2.1       |\n\n### Installation Steps\n\n```bash\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # Linux/Mac\n\n# Install dependencies\ngit clone https://github.com/Bagabaga007/ion_CSP.git\ncd ion_CSP\npip install -e .\n```\n\n## Quick Start\n\n### Interactive Mode\n\n```bash\nion-csp\n```\n\nLaunches CLI interface with:\n\n- Module selection\n- Log management\n- Process control\n\n### Script Execution\n\n#### EE Module Example\n\n```bash\n./scripts/main_EE.sh examples/example_1\n```\n\nGenerates ion combinations from SMILES tables\n\n#### CSP Module Example\n\n```bash\n./scripts/main_CSP.sh examples/example_2\n```\n\nOptimizes crystal structures from ion combinations\n\n## Running Tests\n\n```bash\n# Run all tests\npytest\n\n# View coverage report\npytest --cov=src/ion_CSP --cov-report=html\n\n# Run specific test levels\npytest tests/unit/        # Unit tests\npytest tests/integration/ # Integration tests\npytest tests/ci/          # CI tests\npytest tests/system/      # System tests\n```\n\n## Documentation\n\n- [Test Report](docs/TEST_REPORT.md) - Complete test implementation report\n- [Test Guide](tests/README.md) - Test layering and execution guide\n- [CSP Examples](docs/example_usage_CSP.py) - CSP module usage examples\n- [EE Examples](docs/example_usage_EE.py) - EE module usage examples\n\n## Contribution Guide\n\n1. Fork repository and create feature branch\n2. Write unit tests for new features (maintain 99%+ coverage)\n3. Ensure all tests pass: `pytest`\n4. Submit PR with issue reference\n5. Follow PEP8 coding standards\n\n## License\n\nMIT License, see [LICENSE](LICENSE) file.\n\n## Author\n\n- **Ze Yang** - *Lead Developer* - yangze1995007@163.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbagabaga007%2Fion_csp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbagabaga007%2Fion_csp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbagabaga007%2Fion_csp/lists"}