From e3a6f8967cf051451c0eb39f1065511f9cdf6d72 Mon Sep 17 00:00:00 2001 From: root_hbx Date: Fri, 5 Dec 2025 00:26:11 +0800 Subject: [PATCH 1/4] chore: upgrade to uv for venv management --- .gitignore | 4 ++++ .python-version | 1 + README.md | 52 ++++++++++++++++++++++++++++--------------------- pyproject.toml | 33 +++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 22 deletions(-) create mode 100644 .python-version create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index b19b8d60..0628b05a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ *.h5 *.pyc __pycache__/ + +# UV virtual environment +.venv/ +uv.lock diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..c8cfe395 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/README.md b/README.md index 94ea5f28..30905c16 100644 --- a/README.md +++ b/README.md @@ -21,38 +21,46 @@ Now, we have made a major upgrade to StarPerf, extending its usability and enric 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. -You can install all required dependencies at once using the following commands: +## Installation + +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. + +**Install uv:** + +MacOS/Linux: + +```bash +# MacOS/Linux +curl -LsSf https://astral.sh/uv/install.sh | sh +# Alternative for MacOS +brew install uv +``` + +Windows: + +```powershell +powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" +``` + +For more installation options, please refer to [official uv documentation](https://docs.astral.sh/uv/getting-started/installation/). + +**Installing Dependencies:** + +Once you have cloned the repository, you can install all required dependencies using the following `uv` command: ```bash -cd StarPerf_Simulator -pip install -r requirements.txt +cd StarPerf_Simulator/ +uv sync ``` -This will automatically install all necessary libraries to ensure the system runs properly. Specifically, we used the following packages to support the simulation: - -- h3==4.0.0b2 -- h5py==3.10.0 -- numpy==1.24.4 -- openpyxl==3.1.2 -- importlib-metadata==6.8.0 -- skyfield==1.46 -- sgp4==2.22 -- pandas==2.1.0 -- poliastro==0.17.0 -- astropy==5.3.3 -- networkx==3.1 -- requests==2.31.0 -- jenkspy==0.4.0 -- pyecharts==2.0.4 -- global_land_mask==1.0.0 -- ephem==4.2 +This will automatically create a virtual environment and install all necessary libraries to ensure the system runs properly. # StarPerf overview and processing flow You can directly run our simulation example using the following command: ```bash -python3 StarPerf.py +uv run python StarPerf.py ``` 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). diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..669db1b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[project] +name = "starperf" +version = "2.0.0" +description = "A Network Performance Simulator for Emerging Mega-Constellations" +authors = [ + { name = "StarPerf Team", email = "zeqilai@tsinghua.edu.cn" } +] +readme = "README.md" +license = { text = "BSD-2-Clause" } +requires-python = ">=3.10" +dependencies = [ + "h3==4.0.0b2", + "h5py==3.10.0", + "numpy==1.24.4", + "openpyxl==3.1.2", + "importlib-metadata==6.8.0", + "skyfield==1.46", + "sgp4==2.22", + "pandas==2.1.0", + "poliastro==0.17.0", + "astropy==5.3.3", + "networkx==3.1", + "requests==2.31.0", + "jenkspy==0.4.0", + "pyecharts==2.0.4", + "global-land-mask==1.0.0", + "ephem==4.2", + "ruptures==1.1.10", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" From 99e279aa5bf943742a1fe94a49f211172afa959b Mon Sep 17 00:00:00 2001 From: root_hbx Date: Fri, 5 Dec 2025 00:29:39 +0800 Subject: [PATCH 2/4] nits --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 30905c16..f5c5dab5 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ Now, we have made a major upgrade to StarPerf, extending its usability and enric 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. -## Installation +# Installation 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. -**Install uv:** +**(1) Install uv:** MacOS/Linux: @@ -44,7 +44,7 @@ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | ie For more installation options, please refer to [official uv documentation](https://docs.astral.sh/uv/getting-started/installation/). -**Installing Dependencies:** +**(2) Installing Dependencies:** Once you have cloned the repository, you can install all required dependencies using the following `uv` command: @@ -53,9 +53,9 @@ cd StarPerf_Simulator/ uv sync ``` -This will automatically create a virtual environment and install all necessary libraries to ensure the system runs properly. +This will automatically create a virtual environment and install all necessary libraries. -# StarPerf overview and processing flow +# StarPerf Overview and Processing Flow You can directly run our simulation example using the following command: @@ -84,21 +84,21 @@ http-server -p 8081 5. Open the constellation visualization webpage by entering `http://127.0.0.1:8081/` in your browser. Here, `` refers to the name of the webpage file generated by our visualization code under `/StarPerf_Simulator/visualization/CesiumApp`. -# Contributors are more than welcome +# Contributors Are More Than Welcome Wanna to join the construction of "NewSpace" constellations and networks? Awesome! This project follows the [Github contribution work flow.](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/github-flow) Submissions can fork and use a Github pull request to get merged into this code base. Ways to help are listed as follows. -### Bug reports +### Bug Reports If you come across a bug in using StarPerf, you are more than welcome to file a bug report to our mail box. -### Contribute more constellation designs +### Contribute More Constellation Designs As emerging mega-constellations are still evolving rapidly and constellations such as Starlink and OneWeb are still under heavy development, we welcome all who are interested in this research topic to contribute their innovative designs, documents, insights, comments and suggestions. -### Write test cases +### Write Test Cases Currently this project has not be ''thoroughly''' tested. You are more than welcome to build any test cases for this project. From 5ead688738037edab31feff6c54020bb127e847c Mon Sep 17 00:00:00 2001 From: root_hbx Date: Fri, 5 Dec 2025 00:33:26 +0800 Subject: [PATCH 3/4] chore: rm conda-related files --- requirements.txt | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7a3b8326..00000000 --- a/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -h3==4.0.0b2 -h5py==3.10.0 -numpy==1.24.4 -openpyxl==3.1.2 -importlib-metadata==6.8.0 -skyfield==1.46 -sgp4==2.22 -pandas==2.1.0 -poliastro==0.17.0 -astropy==5.3.3 -networkx==3.1 -requests==2.31.0 -jenkspy==0.4.0 -pyecharts==2.0.4 -global_land_mask==1.0.0 -ephem==4.2 -ruptures==1.1.10 From fe5645f413293e13bd2901e0c388ed7744135cc6 Mon Sep 17 00:00:00 2001 From: root_hbx Date: Fri, 5 Dec 2025 00:47:41 +0800 Subject: [PATCH 4/4] nits --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5c5dab5..87ac2d2f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ http-server -p 8081 # Contributors Are More Than Welcome -Wanna to join the construction of "NewSpace" constellations and networks? Awesome! This project follows the [Github contribution work flow.](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/github-flow) Submissions can fork and use a Github pull request to get merged into this code base. +Wanna join the construction of "NewSpace" constellations and networks? Awesome! This project follows the [Github contribution work flow.](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/github-flow) Submissions can fork and use a Github pull request to get merged into this code base. Ways to help are listed as follows. @@ -100,7 +100,7 @@ As emerging mega-constellations are still evolving rapidly and constellations su ### Write Test Cases -Currently this project has not be ''thoroughly''' tested. You are more than welcome to build any test cases for this project. +Currently this project has not been "thoroughly" tested. You are more than welcome to build any test cases for this project. # License