Files
screen/main.sh
2025-12-07 15:22:36 +08:00

64 lines
1.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# =====================
# 项目自动化筛选脚本
# =====================
# 1. 初始化设置
# 修改上一级目录权限
chmod -R u+w ../Screen
# 启用 screen 环境 (Python 3.11)
source $(conda info --base)/etc/profile.d/conda.sh
conda activate screen
# 设置当前目录为 PYTHONPATH
cd py/
export PYTHONPATH=$(pwd):$PYTHONPATH
echo "============ Stage 1: Pre-process & Basic Screening ============"
# 调用预筛选 (处理 input_pre 到 input)
python pre_process.py
# 调用第一步筛选
# 功能:读取 CIF进行基础检查按阴离子分类创建独立文件夹 (Anion/ID/ID.cif)
python step1.py
# 为所有材料生成 Zeo++ 分析脚本
# 功能:生成 analyze.sh输出重定向至 log.txt
python make_sh.py
# 2. 切换环境运行 Zeo++
echo "============ Stage 2: Zeo++ Calculations ============"
conda deactivate
conda activate zeo
# 进入数据目录执行所有生成的 shell 脚本
cd ../data/after_step1
if [ -f "sh_all.sh" ]; then
source sh_all.sh
rm sh_all.sh
else
echo "Error: sh_all.sh not found!"
fi
# 3. 后处理与筛选 (Step 2-4)
echo "============ Stage 3: Data Extraction & Advanced Screening ============"
# 切回 screen 环境
conda deactivate
conda activate screen
cd ../../py
# 提取日志数据
# 功能:遍历所有 log.txt提取孔径、距离等参数生成汇总 CSV 到 ../output
python extract_data.py
# 联合筛选 (Step 2, 3, 4)
# 功能:读取 CSV根据阈值筛选将符合条件的材料软链接到 ../data/after_screening
python step2_4_combined.py
# Step 5 (扩胞与实际检查)
# 注意:这一步目前尚未更新适配新的软链接结构,待后续处理
# python step5.py
echo "Done! Check results in ../data/after_screening"