Skip to content

Commit e3a6f89

Browse files
committed
chore: upgrade to uv for venv management
1 parent 8a3a8dd commit e3a6f89

4 files changed

Lines changed: 68 additions & 22 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
*.h5
33
*.pyc
44
__pycache__/
5+
6+
# UV virtual environment
7+
.venv/
8+
uv.lock

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

README.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,46 @@ Now, we have made a major upgrade to StarPerf, extending its usability and enric
2121

2222
Compared with StarPerf 1.0, StarPerf 2.0 is fully implemented in Python and no longer depends on any third-party orbit analysis or computation tools. You only need to ensure that **Python 3.10** or above is installed on your system.
2323

24-
You can install all required dependencies at once using the following commands:
24+
## Installation
25+
26+
We recommend using [uv](https://github.com/astral-sh/uv), a fast Python package and project manager, to manage dependencies and virtual environments for this project.
27+
28+
**Install uv:**
29+
30+
MacOS/Linux:
31+
32+
```bash
33+
# MacOS/Linux
34+
curl -LsSf https://astral.sh/uv/install.sh | sh
35+
# Alternative for MacOS
36+
brew install uv
37+
```
38+
39+
Windows:
40+
41+
```powershell
42+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
43+
```
44+
45+
For more installation options, please refer to [official uv documentation](https://docs.astral.sh/uv/getting-started/installation/).
46+
47+
**Installing Dependencies:**
48+
49+
Once you have cloned the repository, you can install all required dependencies using the following `uv` command:
2550

2651
```bash
27-
cd StarPerf_Simulator
28-
pip install -r requirements.txt
52+
cd StarPerf_Simulator/
53+
uv sync
2954
```
3055

31-
This will automatically install all necessary libraries to ensure the system runs properly. Specifically, we used the following packages to support the simulation:
32-
33-
- h3==4.0.0b2
34-
- h5py==3.10.0
35-
- numpy==1.24.4
36-
- openpyxl==3.1.2
37-
- importlib-metadata==6.8.0
38-
- skyfield==1.46
39-
- sgp4==2.22
40-
- pandas==2.1.0
41-
- poliastro==0.17.0
42-
- astropy==5.3.3
43-
- networkx==3.1
44-
- requests==2.31.0
45-
- jenkspy==0.4.0
46-
- pyecharts==2.0.4
47-
- global_land_mask==1.0.0
48-
- ephem==4.2
56+
This will automatically create a virtual environment and install all necessary libraries to ensure the system runs properly.
4957

5058
# StarPerf overview and processing flow
5159

5260
You can directly run our simulation example using the following command:
5361

5462
```bash
55-
python3 StarPerf.py
63+
uv run python StarPerf.py
5664
```
5765

5866
Of course, you can also write your own simulation scripts. For specific guidelines and important notes, please refer to [interface\_convention](./docs/interface_convention.pdf).

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[project]
2+
name = "starperf"
3+
version = "2.0.0"
4+
description = "A Network Performance Simulator for Emerging Mega-Constellations"
5+
authors = [
6+
{ name = "StarPerf Team", email = "zeqilai@tsinghua.edu.cn" }
7+
]
8+
readme = "README.md"
9+
license = { text = "BSD-2-Clause" }
10+
requires-python = ">=3.10"
11+
dependencies = [
12+
"h3==4.0.0b2",
13+
"h5py==3.10.0",
14+
"numpy==1.24.4",
15+
"openpyxl==3.1.2",
16+
"importlib-metadata==6.8.0",
17+
"skyfield==1.46",
18+
"sgp4==2.22",
19+
"pandas==2.1.0",
20+
"poliastro==0.17.0",
21+
"astropy==5.3.3",
22+
"networkx==3.1",
23+
"requests==2.31.0",
24+
"jenkspy==0.4.0",
25+
"pyecharts==2.0.4",
26+
"global-land-mask==1.0.0",
27+
"ephem==4.2",
28+
"ruptures==1.1.10",
29+
]
30+
31+
[build-system]
32+
requires = ["hatchling"]
33+
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)