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..87ac2d2f 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. + +**(1) Install uv:** + +MacOS/Linux: ```bash -cd StarPerf_Simulator -pip install -r requirements.txt +# MacOS/Linux +curl -LsSf https://astral.sh/uv/install.sh | sh +# Alternative for MacOS +brew install uv ``` -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 - -# StarPerf overview and processing flow +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/). + +**(2) Installing Dependencies:** + +Once you have cloned the repository, you can install all required dependencies using the following `uv` command: + +```bash +cd StarPerf_Simulator/ +uv sync +``` + +This will automatically create a virtual environment and install all necessary libraries. + +# 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). @@ -76,23 +84,23 @@ 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. +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. -### 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. +Currently this project has not been "thoroughly" tested. You are more than welcome to build any test cases for this project. # License 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" 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