Skip to content

Commit d81cdc2

Browse files
authored
v0.15.0 (#128)
- Replaces data backend with DuckDB + Ibis, making plotting 2-3x faster and object lookup up to 10x faster - Changes default unit of right ascension to degrees (0...360) - Improves performance of constellation label placement - Separates the constellation Serpens into two "separate" parts (Cauda and Caput) - Adds a new "blue gold" style extension - Adds a new field to the constellation model: `star_hip_ids` which is a list of hip ids for stars that make up the lines in the constellation - Dropped support for Python 3.9 (Ibis requires 3.10 or higher) - Increased minimum required version of GeoPandas to `1.0.1`
1 parent 1354bdb commit d81cdc2

File tree

622 files changed

+127829
-9789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

622 files changed

+127829
-9789
lines changed

.github/workflows/docs.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ jobs:
1616

1717
- name: Build Docker image
1818
run: make build
19+
20+
- name: Build sky.db
21+
run: make db CI=true
1922

2023
- name: Build Examples
2124
run: make examples
2225

2326
- name: Build Tutorial
2427
run: make tutorial
2528

26-
- name: Build OpenNGC Data Reference
27-
run: make scripts SCRIPT=ongc_docdata
29+
- name: Build Data Reference
30+
run: make build-doc-data
2831

2932
- name: Build Docs
3033
run: make docs-build

.github/workflows/release.yml

+10
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,28 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v4
13+
1314
- name: Build Docker Image
1415
run: make build
16+
1517
- name: Check Lint
1618
run: make lint CI=true
19+
1720
- name: Check Format
1821
run: make format CI=true ARGS=--check
22+
23+
- name: Build sky.db
24+
run: make db CI=true
25+
1926
- name: Run Tests
2027
run: make test CI=true
28+
2129
- name: Check Image Hashes
2230
run: make check-hashes CI=true
31+
2332
- name: Build
2433
run: make flit-build
34+
2535
- name: Publish
2636
env:
2737
FLIT_USERNAME: __token__

.github/workflows/test.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- name: Build Docker Image
1717
run: make build
18+
- name: Build sky.db
19+
run: make db CI=true
1820
- name: Check Lint
1921
run: make lint CI=true
2022
- name: Check Format
@@ -25,30 +27,28 @@ jobs:
2527
run: make check-hashes CI=true
2628
- name: Build PIP Package
2729
run: make flit-build
28-
test-python-3-9:
29-
runs-on: ubuntu-22.04
30-
steps:
31-
- uses: actions/checkout@v4
32-
- name: Run Tests - Python 3.9
33-
run: make test-3.9 CI=true
30+
3431
test-python-3-10:
3532
runs-on: ubuntu-22.04
3633
steps:
3734
- uses: actions/checkout@v4
3835
- name: Run Tests - Python 3.10
3936
run: make test-3.10 CI=true
37+
4038
test-python-3-11:
4139
runs-on: ubuntu-22.04
4240
steps:
4341
- uses: actions/checkout@v4
4442
- name: Run Tests - Python 3.11
4543
run: make test-3.11 CI=true
44+
4645
test-python-3-12:
4746
runs-on: ubuntu-22.04
4847
steps:
4948
- uses: actions/checkout@v4
5049
- name: Run Tests - Python 3.12
5150
run: make test-3.12 CI=true
51+
5252
# Python 3.13 not supported yet, needs investigation!
5353
# test-python-3-13:
5454
# runs-on: ubuntu-22.04

.gitignore

+15-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,28 @@ hip8.dat
99
CometEls.txt
1010
ongc.gpkg
1111

12-
# Big Sky - Full Catalog
12+
duckdb-extensions
13+
14+
# Sky Object Database
15+
# ignore this because it's large and created on release
16+
sky.db
17+
18+
# Data Folder
19+
data/build/*
20+
!data/build/.keep
21+
22+
# Big Sky Catalog
1323
# we ignore this because of its size (50+ MB)
14-
bigsky.stars.csv.gz
15-
stars.bigsky.parquet
24+
bigsky.*.csv.gz
25+
bigsky*.parquet
1626

1727
hash_checks/data/*.png
1828
hash_checks/results.html
1929

30+
temp*
2031
temp.py
2132
temp/
22-
raw/
33+
# raw/
2334
scripts/temp/
2435

2536
# Documentation Generated Files

Dockerfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ WORKDIR /starplot
77
RUN apt-get clean && apt-get update -y && apt-get install -y libgeos-dev libgdal-dev
88

99
# ---------------------------------------------------------------------
10-
FROM base as dev
10+
FROM base AS dev
1111

1212
WORKDIR /starplot
1313

1414
COPY . .
1515

16-
RUN pip install -r requirements.txt
17-
RUN pip install -r requirements-dev.txt
16+
RUN pip install uv
17+
RUN uv pip install --system -r requirements.txt
18+
RUN uv pip install --system -r requirements-dev.txt
1819

1920
ENV PYTHONPATH=/starplot/src/
2021

2122
RUN git config --global --add safe.directory /starplot
2223

24+
# Build database
25+
RUN python data/scripts/db.py
26+
2327
CMD ["bash", "-c", "python -m pytest . && python hash_checks/hashio.py check"]

Makefile

+29-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ DE421_URL=https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/a_old_v
44
ifeq ($(CI), true)
55
DR_ARGS=
66
else
7-
DR_ARGS=-it
7+
DR_ARGS=-it --env-file ./.env
88
endif
99

1010
ifeq ($(PROFILE), true)
@@ -13,11 +13,11 @@ else
1313
SCRATCH_ARGS=
1414
endif
1515

16-
DOCKER_RUN=docker run --rm --env-file ./.env $(DR_ARGS) -v $(shell pwd):/starplot starplot-dev bash -c
16+
DOCKER_RUN=docker run --rm $(DR_ARGS) -v $(shell pwd):/starplot starplot-dev bash -c
1717
DOCKER_BUILDER=starplot-builder
1818

1919
DOCKER_BUILD_PYTHON=docker build -t starplot-$(PYTHON_VERSION) $(DOCKER_BUILD_ARGS) --build-arg="PYTHON_VERSION=$(PYTHON_VERSION)" --target dev .
20-
DOCKER_RUN_PYTHON_TEST=docker run --rm $(DR_ARGS) -v $(shell pwd):/starplot starplot-$(PYTHON_VERSION)
20+
DOCKER_RUN_PYTHON_TEST=docker run --rm $(DR_ARGS) starplot-$(PYTHON_VERSION)
2121

2222
export PYTHONPATH=./src/
2323

@@ -36,7 +36,7 @@ lint:
3636
$(DOCKER_RUN) "ruff check src/ tests/ hash_checks/ $(ARGS)"
3737

3838
format:
39-
$(DOCKER_RUN) "python -m black src/ tests/ scripts/ examples/ hash_checks/ tutorial/ $(ARGS)"
39+
$(DOCKER_RUN) "python -m black src/ tests/ scripts/ examples/ hash_checks/ tutorial/ data/ $(ARGS)"
4040

4141
test:
4242
$(DOCKER_RUN) "python -m pytest --cov=src/ --cov-report=term --cov-report=html ."
@@ -70,11 +70,28 @@ profile:
7070
$(DOCKER_RUN) "python -m cProfile -o temp/results.prof scripts/scratchpad.py && \
7171
snakeviz -s -p 8080 -H 0.0.0.0 temp/results.prof"
7272

73-
prep-dsos:
74-
$(DOCKER_RUN) "python -m starplot.data.prep.dsos"
73+
# builds ALL data files and then database:
74+
db:
75+
@$(DOCKER_RUN) "python data/scripts/db.py"
7576

76-
prep-constellations:
77-
$(DOCKER_RUN) "python -m starplot.data.prep.constellations"
77+
build-data-clean:
78+
mkdir -p data/build
79+
rm -rf data/build/*
80+
81+
build-stars-mag11:
82+
@$(DOCKER_RUN) "python data/scripts/bigsky_mag11.py"
83+
84+
build-dsos:
85+
@$(DOCKER_RUN) "python data/scripts/dsos.py"
86+
87+
build-star-designations:
88+
@$(DOCKER_RUN) "python data/scripts/star_designations.py"
89+
90+
build-constellations:
91+
@$(DOCKER_RUN) "python data/scripts/constellations.py"
92+
93+
build-doc-data:
94+
@$(DOCKER_RUN) "python data/scripts/docdata.py"
7895

7996
version:
8097
@$(DOCKER_RUN) "python -c 'import starplot as sp; print(sp.__version__)'"
@@ -129,6 +146,9 @@ flit-publish: DR_ARGS=-e FLIT_USERNAME -e FLIT_PASSWORD
129146
flit-publish:
130147
$(DOCKER_RUN) "python -m flit publish"
131148

149+
flit-install:
150+
FLIT_ROOT_INSTALL=1 flit install
151+
132152
# ------------------------------------------------------------------
133153
# Utils
134154
ephemeris:
@@ -151,4 +171,4 @@ clean:
151171
rm -rf htmlcov
152172
rm -f tests/data/*.png
153173

154-
.PHONY: build test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts tutorial
174+
.PHONY: build test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts tutorial prep-dsos prep-constellations

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# <img src="https://raw.githubusercontent.com/steveberardi/starplot/main/docs/images/favicon.svg" width="48" style="vertical-align:middle"> Starplot
2-
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/steveberardi/starplot/test.yml?style=for-the-badge&color=a2c185)
3-
![Python](https://img.shields.io/pypi/pyversions/starplot?style=for-the-badge&color=85A2C1)
4-
![PyPI](https://img.shields.io/pypi/v/starplot?style=for-the-badge&color=85C0C1)
5-
![License](https://img.shields.io/github/license/steveberardi/starplot?style=for-the-badge&color=A485C1)
2+
![Python](https://img.shields.io/pypi/pyversions/starplot?style=for-the-badge&color=6388b0)
3+
![PyPI](https://img.shields.io/pypi/v/starplot?style=for-the-badge&color=57a8a8)
4+
![License](https://img.shields.io/github/license/steveberardi/starplot?style=for-the-badge&color=8b63b0)
5+
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/steveberardi/starplot/test.yml?style=for-the-badge&color=88b063)
66

77
**Starplot** is a Python library for creating star charts and maps of the sky.
88

@@ -13,6 +13,7 @@
1313
- 🪐 **Planets and Deep Sky Objects (DSOs)** - more than 14,000 objects built-in
1414
- 🎨 **Custom Styles** - for all objects
1515
- 📥 **Export** - png, svg, jpeg
16+
- 🚀 **Data Backend** - powered by DuckDB + Ibis for fast object lookup
1617
- 🧭 **Label Collision Avoidance**
1718

1819
## Examples
@@ -48,7 +49,7 @@ p = sp.MapPlot(
4849
autoscale=True,
4950
)
5051
p.constellations()
51-
p.stars(mag=4.6)
52+
p.stars(where=[_.magnitude < 4.6])
5253
p.constellation_labels()
5354
p.export("starchart.png")
5455
```
@@ -74,7 +75,6 @@ https://discord.gg/WewJJjshFu
7475
Contributing to Starplot is welcome and very much appreciated! Please see [here](CONTRIBUTING.md) for details.
7576

7677
## Coming Soon
77-
- 🗄️ Data optimizations
7878
- 🧮 Coordinate system helpers
7979
- 🌑 Planet moons
8080
- ✴️ Custom markers

0 commit comments

Comments
 (0)