Skip to content

Commit 510d2cf

Browse files
authored
v0.13.0 (#120)
1 parent 24e7cbf commit 510d2cf

File tree

104 files changed

+7421
-827
lines changed

Some content is hidden

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

104 files changed

+7421
-827
lines changed

.github/workflows/test.yml

+7
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ jobs:
4949
- uses: actions/checkout@v4
5050
- name: Run Tests - Python 3.12
5151
run: make test-3.12 CI=true
52+
# Python 3.13 not supported yet, needs investigation!
53+
# test-python-3-13:
54+
# runs-on: ubuntu-22.04
55+
# steps:
56+
# - uses: actions/checkout@v4
57+
# - name: Run Tests - Python 3.13
58+
# run: make test-3.13 CI=true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ hash_checks/results.html
2020
temp.py
2121
temp/
2222
raw/
23+
scripts/temp/
2324

2425
# Documentation Generated Files
2526
examples/*.png

Dockerfile

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
ARG PYTHON_VERSION=3.11.7
1+
ARG PYTHON_VERSION=3.11.11
22
FROM python:${PYTHON_VERSION}-bookworm AS base
33

44
WORKDIR /starplot
55

6+
# Install required system libraries (GEOS + GDAL)
67
RUN apt-get clean && apt-get update -y && apt-get install -y libgeos-dev libgdal-dev
78

8-
# Install fonts
9-
# not required, but make the maps look better (especially greek letters)
10-
RUN mkdir -p /usr/share/fonts/truetype
11-
RUN wget https://github.com/google/fonts/raw/main/ofl/gfsdidot/GFSDidot-Regular.ttf -P /tmp/fonts
12-
RUN install -m644 /tmp/fonts/*.ttf /usr/share/fonts/truetype/
13-
RUN fc-cache -f
14-
159
# ---------------------------------------------------------------------
1610
FROM base as dev
1711

Makefile

+14-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ DOCKER_RUN_PYTHON_TEST=docker run --rm $(DR_ARGS) -v $(shell pwd):/starplot star
2222
export PYTHONPATH=./src/
2323

2424
# ------------------------------------------------------------------
25-
build: PYTHON_VERSION=3.11.7
25+
build: PYTHON_VERSION=3.11.11
2626
build: DOCKER_BUILD_ARGS=-t starplot-dev
2727
build:
2828
touch -a .env
@@ -82,26 +82,32 @@ version:
8282
# ------------------------------------------------------------------
8383
# Python version testing
8484
# ------------------------------------------------------------------
85-
test-3.9: PYTHON_VERSION=3.9.18
85+
test-3.9: PYTHON_VERSION=3.9.21
8686
test-3.9:
8787
$(DOCKER_BUILD_PYTHON)
8888
$(DOCKER_RUN_PYTHON_TEST)
8989

90-
test-3.10: PYTHON_VERSION=3.10.13
90+
test-3.10: PYTHON_VERSION=3.10.16
9191
test-3.10:
9292
$(DOCKER_BUILD_PYTHON)
9393
$(DOCKER_RUN_PYTHON_TEST)
9494

95-
test-3.11: PYTHON_VERSION=3.11.7
95+
test-3.11: PYTHON_VERSION=3.11.11
9696
test-3.11:
9797
$(DOCKER_BUILD_PYTHON)
9898
$(DOCKER_RUN_PYTHON_TEST)
9999

100-
test-3.12: PYTHON_VERSION=3.12.1
100+
test-3.12: PYTHON_VERSION=3.12.8
101101
test-3.12:
102102
$(DOCKER_BUILD_PYTHON)
103103
$(DOCKER_RUN_PYTHON_TEST)
104104

105+
# Python 3.13 not supported yet!
106+
test-3.13: PYTHON_VERSION=3.13.1
107+
test-3.13:
108+
$(DOCKER_BUILD_PYTHON)
109+
$(DOCKER_RUN_PYTHON_TEST)
110+
105111
# ------------------------------------------------------------------
106112
# Docs
107113
docs-serve: DR_ARGS=-it -p 8000:8000
@@ -134,6 +140,9 @@ hip8:
134140
scripts:
135141
$(DOCKER_RUN) "python ./scripts/$(SCRIPT).py"
136142

143+
allsky:
144+
$(DOCKER_RUN) "python ./scripts/temp/allsky.py"
145+
137146
clean:
138147
rm -rf __pycache__
139148
rm -rf venv

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

9-
-**Zenith Plots** - showing the stars from a specific time/location
9+
-**Zenith Plots** - showing the whole sky from a specific time/location
1010
- 🗺️ **Map Plots** - including many map projections
1111
- 🔭 **Optic Plots** - simulates what you'll see through an optic (e.g. binoculars, telescope) from a time/location
1212
- 🪐 **Planets and Deep Sky Objects (DSOs)**
@@ -21,7 +21,7 @@
2121
*Map around the constellation Orion:*
2222
![map-orion](https://starplot.dev/images/examples/map_orion.png)
2323

24-
*Optic plot of The Pleiades through a refractor as seen from a specific time/location:*
24+
*The Pleiades star cluster, as seen through a refractor telescope from a specific time and location:*
2525
![optic-pleiades](https://starplot.dev/images/examples/optic_m45.png)
2626

2727
## Basic Usage
@@ -42,9 +42,9 @@ p = sp.MapPlot(
4242
dt=datetime.now(tz).replace(hour=22),
4343
style=sp.styles.PlotStyle().extend(
4444
sp.styles.extensions.BLUE_MEDIUM,
45-
sp.styles.extensions.ZENITH,
4645
),
47-
resolution=2000,
46+
resolution=3200,
47+
autoscale=True,
4848
)
4949
p.constellations()
5050
p.stars(mag=4.6)
@@ -72,12 +72,11 @@ https://discord.gg/WewJJjshFu
7272
Contributing to Starplot is welcome and very much appreciated! Please see [here](CONTRIBUTING.md) for details.
7373

7474
## Coming Soon
75+
- 🌄 Horizon plots
7576
- 🌑 Planet moons
7677
- ✴️ Custom markers
77-
- 🚀 Plotting Optimizations
7878
- ☄️ Comet model
79-
- 🌄 Horizon plots
80-
- ⚖️ Better auto font-size adjustment
79+
- 💫 Better constellation label placement
8180
- 😄 🔭 Clear skies
8281

8382
See more details on the [Public Roadmap](https://trello.com/b/sUksygn4/starplot-roadmap)

docs/about.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
![Starplot](images/favicon.svg){ align=right width="128" .off-glb }
22

3-
**Starplot** is a Python library for creating star charts and maps. It lets you create zenith plots that show the whole sky from a time/place, map plots that show more detail of an area, and optic plots that simulate the field of view from a particular optic (e.g. telescope, binoculars, or a camera).
3+
**Starplot** is a Python library for creating star charts and maps of the sky. It lets you create zenith plots that show the whole sky from a time/place, map plots that show more detail of an area, and optic plots that simulate the field of view from a particular optic (e.g. telescope, binoculars, or a camera).
4+
5+
👷 **Work In Progress** 🚧 Starplot is still very much a work in progress, and under active development. We try to follow [semantic versioning](https://semver.org/), which means that [_anything_ can change between versions before `1.0.0`](https://semver.org/#spec-item-4).
6+
7+
However, the Starplot API becomes more stable with each new version. We anticipate that version `1.0.0` is still at least a year away. The best way to help us get there faster is to [join as a contributor](https://github.com/steveberardi/starplot/blob/main/CONTRIBUTING.md) 😃 help is wanted and very much appreciated!
48

59
Join other starplotters on [Discord :fontawesome-brands-discord:{ .fg-primary }](https://discord.gg/WewJJjshFu)
610

docs/changelog.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
## v0.13.x
2+
3+
- Adds a `scale` factor to control sizing of all objects/text
4+
- Adds an "auto" option for label offsets from markers
5+
- Adds constellation lines to label collision detection
6+
- Adds a `gid` to plotted objects to make exported SVGs easier to work with in external applications (e.g. Inkscape)
7+
- Adds Flamsteed numbers to stars
8+
- Adds all star names from IAU
9+
- Adds the standard symbol for planetary nebulae
10+
- Adds a border size/color property to label styles
11+
- Bundles fonts: Inter & GFS Didot
12+
113
## v0.12.x
14+
[Documentation](https://archives.starplot.dev/0.12.5/)
215

316
- Adds Shapely geometry to all sky object models, including support for `intersects` in `where` clauses
417
- Adds kwarg to map plots to allow custom clip paths

docs/coming-soon.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11

2+
- 🌄 Horizon plots
23
- 🌑 Planet moons
34
- ☄️ Comet model
4-
- 🌄 Horizon plots
55
- ✴️ Custom markers
6-
- 🚀 Plotting Optimizations
7-
- ⚖️ Better auto font-size adjustment
6+
- 💫 Better constellation label placement
87
- 😄 🔭 Clear skies
98

109
<br/>

docs/examples/map-canis-major.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ title: Map of Canis Major
77

88
![map-canis-major](/images/examples/map_canis_major.png)
99

10+
In this example, we set the plot's `clip_path` to the boundary of Canis Major, so only objects in that constellation are plotted:
11+
1012
```python
1113
--8<-- "examples/map_canis_major.py"
1214
```

docs/examples/map-orion.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Map of Orion
77

88
![map-orion](/images/examples/map_orion.png)
99

10-
The following code will create a simple map plot that shows the area around the constellation Orion, including a legend and an ellipse around [Orion's Belt](https://en.wikipedia.org/wiki/Orion%27s_Belt):
10+
The following code will create a simple map plot that shows the area around the constellation [Orion](https://en.wikipedia.org/wiki/Orion_(constellation)):
1111

1212
```python
1313
--8<-- "examples/map_orion.py"

docs/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Starplot is a Python library for creating star charts and maps of the sky.
2828

2929
Join other starplotters on [Discord :fontawesome-brands-discord:{ .fg-primary }](https://discord.gg/WewJJjshFu)
3030

31+
3132
*Example charts and maps created with Starplot:*
3233
<!-- {.text-subtitle} -->
3334

@@ -38,7 +39,7 @@ Join other starplotters on [Discord :fontawesome-brands-discord:{ .fg-primary }]
3839

3940
<figure markdown>
4041
<img src="images/examples/map_orion.png" width="900">
41-
<figcaption>Map around the constellation Orion, with an ellipse around Orion's Belt (<a href="/examples/map-orion/">source code</a>)</figcaption>
42+
<figcaption>Map around the constellation Orion (<a href="/examples/map-orion/">source code</a>)</figcaption>
4243
</figure>
4344

4445

docs/installation.md

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ apt-get install libgeos-dev libgdal-dev
2828
pip install starplot
2929
```
3030

31+
## Docker
32+
33+
Here's a basic Docker container definition that'll get you up and running:
34+
35+
```docker
36+
FROM python:3.11.11-bookworm
37+
38+
# Install required system libraries (GEOS + GDAL)
39+
RUN apt-get clean && apt-get update -y && apt-get install -y libgeos-dev libgdal-dev
40+
41+
RUN pip install starplot
42+
```
43+
3144
!!! star "What about Windows?"
3245

3346
I haven't tried installing Starplot on Windows, but if you have and would like to share instructions, please feel free to [open a pull request on GitHub](https://github.com/steveberardi/starplot) with an update to this file (`docs/installation.md`). Thanks! :)

docs/reference-styling.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ from starplot import PlotStyle
8383
style = PlotStyle().extend(
8484
{
8585
"bayer_labels": {
86-
"font_name": "GFS Didot",
86+
"font_name": "Literata",
8787
"font_size": 10
8888
}
8989
}
@@ -92,7 +92,7 @@ style = PlotStyle().extend(
9292
Alternatively, you can do this:
9393
```python
9494
style = PlotStyle()
95-
style.bayer_labels.font_name = "GFS Didot"
95+
style.bayer_labels.font_name = "Literata"
9696
style.bayer_labels.font_size = 10
9797

9898
```
@@ -152,8 +152,8 @@ Starplot has a bunch of built-in style extensions (all imported from `starplot.s
152152
- `GRAYSCALE` - Optimized for printing in grayscale ([details](#extensions-grayscale))
153153
- `GRAYSCALE_DARK` - Like `GRAYSCALE`, but inverted (white stars, black background) ([details](#extensions-grayscale-dark))
154154
- `BLUE_LIGHT` - Light and bright colors ([details](#extensions-blue-light))
155-
- `BLUE_MEDIUM` - Medium brightness bluish gray colors ([details](#extensions-blue-medium))
156-
- `BLUE_DARK` - Dark "Starplot blue" colors ([details](#extensions-blue-dark))
155+
- `BLUE_MEDIUM` - Medium brightness blue colors ([details](#extensions-blue-medium))
156+
- `BLUE_DARK` - Dark blue and contrasting colors ([details](#extensions-blue-dark))
157157
- `ANTIQUE` - Antique map inspired colors ([details](#extensions-antique))
158158
- `NORD` - Nord-inspired colors ([details](#extensions-nord))
159159
- **Plot types**

docs/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Here's an overview of what the tutorial covers:
1515
8. [Using callables](tutorial/08.md)
1616
9. [Where to go from here](tutorial/09.md)
1717

18-
Estimated time to complete: 1 hour
18+
Estimated time to complete: 30 minutes
1919

2020
<br/>
2121

docs/tutorial/02.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ On line 8, we create a [`MapPlot`][starplot.MapPlot] instance that specifies a f
3737
- `lat`/`lon`: Observing location
3838
- `dt`: Observing date/time
3939
- `resolution`: Resolution (in pixels) of the widest dimension of the plot
40+
- `scale`: This controls the sizing of all text and markers. At scale `1.0` everything is optimized for a basic map of 1-3 constellations, so if you're plotting a larger area (or just want everything smaller), then it's a good idea to decrease the scale so the plot isn't too crowded.
4041

41-
When you create a plot instance, initially it'll be empty (i.e. it won't have any stars). In Starplot, you have to explicitly plot all objects. So, on line 15 we plot the constellations, which includes lines and labels. Then, we plot stars with a limiting magnitude of 4.6.
42+
When you create a plot instance, initially it'll be empty (i.e. it won't have any stars). In Starplot, you have to explicitly plot all objects. So, on line 16 we plot the constellations, which includes lines and labels. Then, we plot stars with a limiting magnitude of 4.6.
4243

4344
Finally, we export the plot to a PNG file.
4445

docs/tutorial/05.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ For example, here's how you'd create an optic plot of the Beehive Star Cluster (
2222

2323
The first 13 lines should look familiar from the other plots we've created in this tutorial.
2424

25-
Line 15 is where we create the instance of an `OpticPlot`. Most of the kwargs are the same as the map plot's kwargs, except for the following:
25+
Line 14 is where we create the instance of an `OpticPlot`. Most of the kwargs are the same as the map plot's kwargs, except for the following:
2626

2727
- `ra`: Right ascension of the target
2828
- `dec`: Declination of the target
2929
- `optic`: An instance of an [optic](/reference-opticplot/#starplot.optics.Optic). This example uses binoculars, but Starplot also supports refractor/reflector telescopes, generic scopes, and cameras.
3030

3131
The `ra`/`dec` you specify for the target will be the center of the plot.
3232

33-
On line 31, we plot stars down to magnitude 14, but we also specify the [star catalog](/reference-data/#starplot.data.stars.StarCatalog) to use. By default, Starplot uses the Hipparcos catalog, but it also has the [Big Sky Catalog](https://github.com/steveberardi/bigsky) built-in which has many more stars.
33+
On line 31, we plot stars down to magnitude 12, but we also specify the [star catalog](/reference-data/#starplot.data.stars.StarCatalog) to use. By default, Starplot uses the Hipparcos catalog, but it also has the [Big Sky Catalog](https://github.com/steveberardi/bigsky) built-in which has many more stars.
3434

3535
*In the [next section](06.md), we'll learn how to be more selective of objects to plot...*
3636

docs/tutorial/06.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ p.stars(
2020
],
2121
)
2222
```
23-
When passing the `where` kwarg, the `mag` kwarg will be ignored, and only the stars/DSOs that satisfy ALL the `where` conditions will be plotted. You can reference any field on the model in expressions, and there are also a few functions available for determining if a field is null or is in a list of values. For complete details about selecting objects, see the [reference page](/reference-selecting-objects/).
23+
When passing the `where` kwarg, the `mag` kwarg will be ignored, and only the stars/DSOs that satisfy ALL the `where` conditions will be plotted. You can reference any field on the [model](/reference-models/) in expressions, and there are also a few functions available for determining if a field is null or is in a list of values. For complete details about selecting objects, see the [reference page](/reference-selecting-objects/).
2424

2525
Here's some code that uses the `where` kwarg extensively to produce the image above:
2626
<div class="tutorial" markdown>

docs/tutorial/08.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: 8 - Using Callables
1111

1212
[Callables](/reference-callables/) allow you to define your own functions for calculating a few of the style properties for stars: size, alpha (opacity), color, and their labels. DSOs support callables for alpha and labels only. Starplot has a few basic callables built-in, but you can also create your own.
1313

14-
Here's an example that uses the built-in callable `color_by_bv` to create an optic plot of [Antares](https://en.wikipedia.org/wiki/Antares) that colorizes the stars based on their B-V index (Antares B-V is 1.83 so it appears red/orange in the sky):
14+
Here's an example that uses the built-in callable `color_by_bv` to create an optic plot of [Antares](https://en.wikipedia.org/wiki/Antares) that colorizes the stars based on their B-V index (Antares' B-V is 1.83 so it appears red/orange in the sky):
1515
<div class="tutorial" markdown>
1616
```python linenums="1"
1717
--8<-- "tutorial/tutorial_08.py"

examples/examples.py

+10-14
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
import time
66

77
from PIL import Image
8-
from multiprocessing import Pool, Process
8+
from multiprocessing import Pool
99

1010
start = time.time()
1111

12+
skip = [
13+
# "map_milky_way_stars.py",
14+
# "stuff.py",
15+
]
16+
1217

1318
def thumbnail(filename, max_dimension=900):
1419
print(filename)
@@ -23,16 +28,17 @@ def get_example_names():
2328
for filename in glob.iglob("*.py"):
2429
if filename.endswith("examples.py"):
2530
continue
31+
32+
if filename in skip:
33+
continue
34+
2635
filenames.append(filename)
2736

2837
return filenames
2938

3039

3140
def run_example(filename):
32-
import subprocess
33-
3441
print(f"Running {filename}")
35-
3642
subprocess.call(["python", filename])
3743

3844

@@ -42,16 +48,6 @@ def run_example(filename):
4248
with Pool(5) as pool:
4349
pool.map(run_example, example_files)
4450

45-
# Run all examples
46-
# for filename in glob.iglob("*.py"):
47-
# if filename.endswith("examples.py"):
48-
# continue
49-
50-
# # if filename != "map_lyra.py":
51-
# # continue
52-
# print(f"Running {filename}")
53-
# subprocess.call(f"python {filename}", shell=True)
54-
5551
# Create thumbnail images for the examples list page
5652
image_files = glob.glob("*.png")
5753
pool = Pool(5)

0 commit comments

Comments
 (0)