Skip to content

Commit bd6677a

Browse files
authored
add jupyter to toml files (#283)
* feat: Add dptbplas example > > This commit introduces a new example demonstrating the integration of DeePTB with TBPLaS for calculating the AC conductivity of crystalline silicon using two different methods: > > 1. **Lindhard function method:** An accurate but computationally expensive method performed in k-space. > 2. **TBPM method:** A linear-scaling method performed in real-space on a supercell, suitable for large and complex systems. > > The example includes a Jupyter notebook (deeptb_tbplas.ipynb) that walks through the calculation process for both methods, along with the necessary input files (conv2.vasp and mix.latest.pth). > > This example serves as a tutorial for users to understand the workflow of using DeePTB models with TBPLaS and to explore the effects of different computational parameters on the results. * docs: add TBPlaS tutorial and update index * docs: 添加 GEMINI 文档,概述项目结构和使用说明 * feat: Introduce `uv` for dependency management and centralize installation logic into `install.sh` while updating Dockerfiles and documentation. * feat: explicitly specify the Python executable for `uv sync` and print it during installation. * feat: add validation for install script variant parameter * feat: Add several new Python package dependencies and update the lock file.
1 parent e777f1f commit bd6677a

File tree

3 files changed

+1834
-90
lines changed

3 files changed

+1834
-90
lines changed

dptb/__main__.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,31 @@
77
log = logging.getLogger(__name__)
88

99
def print_logo():
10-
f = pyfiglet.Figlet(font='dos_rebel') # 您可以选择您喜欢的字体
11-
logo = f.renderText("DeePTB")
12-
log.info(" ")
13-
log.info(" ")
14-
log.info("#"*81)
15-
log.info("#" + " "*79 + "#")
16-
log.info("#" + " "*79 + "#")
17-
for line in logo.split('\n'):
18-
if line.strip(): # 避免记录空行
19-
log.info('# '+line+ ' #')
20-
log.info("#" + " "*79 + "#")
21-
version_info = f"Version: {__version__}"
22-
padding = (79 - len(version_info)) // 2
23-
nspace = 79-padding
24-
format_str = "#" + "{}"+"{:<"+f"{nspace}" + "}"+ "#"
25-
log.info(format_str.format(" "*padding, version_info))
26-
log.info("#" + " "*79 + "#")
27-
log.info("#"*81)
28-
log.info(" ")
29-
log.info(" ")
10+
try:
11+
from rich.console import Console, Group
12+
from rich.panel import Panel
13+
from rich.align import Align
14+
from rich.text import Text
15+
# Create Figlet with classic dos_rebel font
16+
f = pyfiglet.Figlet(font='dos_rebel')
17+
logo_text = f.renderText("DeePTB")
18+
# Build Rich components with centered version
19+
logo = Align.center(Text(logo_text, style="bold cyan"))
20+
version = Align.center(Text(f"Version: {__version__}", style="bold white"))
21+
panel = Panel(
22+
Group(logo, version),
23+
border_style="blue",
24+
padding=(1, 2),
25+
title="Deep Learning Tight-Binding",
26+
subtitle="https://github.com/deepmodeling/DeePTB"
27+
)
28+
console = Console()
29+
console.print(panel)
30+
except ImportError:
31+
# Fallback if rich is not installed (though it should be)
32+
f = pyfiglet.Figlet(font='dos_rebel')
33+
print(f.renderText("DeePTB"))
34+
print(f"Version: {__version__}")
3035
def main() -> None:
3136
"""
3237
The main entry point for the dptb package.

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies = [
4444
"pyfiglet==1.0.2",
4545
"tensorboard",
4646
"seekpath",
47+
"rich>=13.0.0",
4748
]
4849

4950
[project.optional-dependencies]
@@ -75,3 +76,10 @@ fallback_version = "0.0.0-dev" # Fallback for non-git installs (e.g. zip downlo
7576
# uv sync --find-links https://data.pyg.org/whl/torch-2.5.0+cu121.html
7677
# OR use the helper script: ./install.sh cu121
7778
find-links = ["https://data.pyg.org/whl/torch-2.5.0+cpu.html"]
79+
80+
[dependency-groups]
81+
dev = [
82+
"ipykernel",
83+
"jupyter",
84+
"notebook",
85+
]

0 commit comments

Comments
 (0)