Skip to content

Commit 7d42cdb

Browse files
v0.10.0 (#71)
* colorblind scheme * poc * optic hashes * moved to hash checker * fix * format * phash * split p hash too * multi channel is flaky * dso label size * style * label colors * linespacing * no font size * title style * dso visible callable * visible fn for stars * objects list poc * transform many has bug * star list * hashes * dso object list * planet objects * add moon * add sun plotting (#62) * save * save * save * added styling for sun * added hashes that inlude sun (optic, map) + base label zorder * fix * filters poc * tests * lint * tests * doc it up * docs * fix * docs * alpha callable * typo * remove * where labels for dsos * docstrings * where labels * text function * itertuples faster * dso refactor * fixes * 34 style kwargs (#63) * save * created hashes for styling checks * improve Exception * improved dict comprehension * fix * fix * iterator * dso getter * optic * star manager * placeholder * fix style bug * forbid extra kwargs * exception * optic helper * dynamic manager * refactor * tests * format * clean up * not helpful * format * deprecated * zorder * fix inner border * docs * remove cropped labels * clip labels that are cropped by edge * lint * less flaky target * make less flaky * try this * mypy target * stub for markers * add sun * moon manager * sun manager * oops * planet manager * map optic helpers * tests * util tests * null case * default to utc now * upgrade adjustText version 0.8->1.0 (#64) * markerss * normalize sizes * use plot instead * hash check * remove markers func * fix clipping issues * docs * fixing old typo (#68) * docs * text refactor with offsets * label anchor point * better ticks * docs etc * docs * refactor examples * examples * styling * antique * improve examples * new kwargs * improve * og tags * gridline fixes * docs * docs * add pluto * object times * make easier to hash * dso id fields * examples styling * docstrings * docs * docs * tutorial * tutorial * tutorial * tutorial styling * format * docs * cleanup * tutorial * 50 moon phases (#70) * save * save * added moon phase as percent and phase description to Moon model * seperate phse from illumination * correct phase/illumination/desc attributes, working on circle + ellipses drawing * save * save * save * save * changes --------- Co-authored-by: Steve Berardi <[email protected]> * format lint * docstring * docstring * clean up * reorder * docs * cleanup * cleanup * format * fix start end angles * easier hashing * try this * map check * clean up * remove --------- Co-authored-by: Graham Schmidt <[email protected]>
1 parent 5d4440a commit 7d42cdb

File tree

130 files changed

+5029
-1618
lines changed

Some content is hidden

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

130 files changed

+5029
-1618
lines changed

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Build Examples
2121
run: make examples
2222

23-
- name: Build Gallery
24-
run: make gallery
23+
- name: Build Tutorial
24+
run: make tutorial
2525

2626
- name: Build OpenNGC Data Reference
2727
run: make scripts SCRIPT=ongc_docdata

.github/workflows/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
run: make format CI=true ARGS=--check
1919
- name: Run Tests
2020
run: make test CI=true
21+
- name: Check Image Hashes
22+
run: make check-hashes CI=true
2123
- name: Build
2224
run: make flit-build
2325
- name: Publish

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
run: make format CI=true ARGS=--check
2121
- name: Run Tests
2222
run: make test CI=true
23+
- name: Check Image Hashes
24+
run: make check-hashes CI=true
2325
- name: Build PIP Package
2426
run: make flit-build
2527
test-python-3-9:

.gitignore

+25-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# ruff
7-
.ruff_cache
8-
9-
# C extensions
10-
*.so
11-
12-
# macOS
13-
.DS_Store
14-
1+
# scratchpad for local development
152
scripts/scratchpad.py
163

174
# astronomy data
@@ -21,18 +8,40 @@ hip_main.dat
218
hip8.dat
229
CometEls.txt
2310

24-
temp*
11+
hash_checks/data/*.png
12+
hash_checks/results.html
13+
14+
temp.py
15+
temp/
2516
raw/
17+
18+
# Documentation Generated Files
2619
examples/*.png
2720
docs/images/examples/*.png
28-
docs/images/gallery/*.png
21+
tutorial/*.png
22+
docs/images/tutorial/*.png
2923
docs/data/*.json
3024

25+
# Profiling files
3126
*.prof
3227

3328
# test-generated data
3429
tests/data/*.png
3530

31+
# Byte-compiled / optimized / DLL files
32+
__pycache__/
33+
*.py[cod]
34+
*$py.class
35+
36+
# ruff
37+
.ruff_cache
38+
39+
# C extensions
40+
*.so
41+
42+
# macOS
43+
.DS_Store
44+
3645
# Distribution / packaging
3746
.Python
3847
build/

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ ENV PYTHONPATH=/starplot/src/
2626

2727
RUN git config --global --add safe.directory /starplot
2828

29-
CMD ["bash", "-c", "python -m pytest ."]
29+
CMD ["bash", "-c", "python -m pytest . && python hash_checks/hashio.py check"]

Makefile

+14-5
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,23 @@ docker-multi-arch:
3232
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag sberardi/starplot-base:latest --target base .
3333

3434
lint:
35-
$(DOCKER_RUN) "ruff check src/ tests/ $(ARGS)"
35+
$(DOCKER_RUN) "ruff check src/ tests/ hash_checks/ $(ARGS)"
3636

3737
format:
38-
$(DOCKER_RUN) "python -m black src/ tests/ scripts/ examples/ $(ARGS)"
38+
$(DOCKER_RUN) "python -m black src/ tests/ scripts/ examples/ hash_checks/ tutorial/ $(ARGS)"
3939

4040
test:
4141
$(DOCKER_RUN) "python -m pytest --cov=src/ --cov-report=term --cov-report=html ."
4242

43+
check-hashes:
44+
$(DOCKER_RUN) "python hash_checks/hashio.py check"
45+
46+
lock-hashes:
47+
$(DOCKER_RUN) "python hash_checks/hashio.py lock"
48+
49+
mypy:
50+
$(DOCKER_RUN) "mypy --ignore-missing-imports src/starplot/"
51+
4352
bash:
4453
$(DOCKER_RUN) bash
4554

@@ -52,8 +61,8 @@ scratchpad:
5261
examples:
5362
$(DOCKER_RUN) "cd examples && python examples.py"
5463

55-
gallery:
56-
$(DOCKER_RUN) "python scripts/gallery.py"
64+
tutorial:
65+
$(DOCKER_RUN) "cd tutorial && python build.py"
5766

5867
profile: DR_ARGS=-it -p 8080:8080
5968
profile:
@@ -126,4 +135,4 @@ clean:
126135
rm -rf htmlcov
127136
rm -f tests/data/*.png
128137

129-
.PHONY: build test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts
138+
.PHONY: build test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts tutorial

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
## Examples
1818
*Zenith plot of the stars from a specific time/location:*
19-
![starchart-blue](https://starplot.dev/images/examples/example_01.png)
19+
![starchart-blue](https://starplot.dev/images/examples/star_chart_basic.png)
2020

2121
*Map around the constellation Orion:*
22-
![map-orion](https://starplot.dev/images/gallery/orion.png)
22+
![map-orion](https://starplot.dev/images/examples/map_orion.png)
2323

2424
*Optic plot of The Pleiades through a refractor as seen from a specific time/location:*
25-
![optic-pleiades](https://starplot.dev/images/gallery/optic_02.png)
25+
![optic-pleiades](https://starplot.dev/images/examples/optic_m45.png)
2626

2727
## Basic Usage
2828

@@ -47,7 +47,7 @@ p = sp.MapPlot(
4747
resolution=2000,
4848
)
4949
p.constellations()
50-
p.stars(mag=4.6, mag_labels=2.1)
50+
p.stars(mag=4.6)
5151
p.export("starchart.png")
5252
```
5353

@@ -79,11 +79,11 @@ https://discord.gg/bwazdyD7
7979
- adjustText
8080

8181
## Coming Soon
82+
- 🌑 Planet moons
8283
- ✴️ Custom markers
83-
- 📋 List of objects plotted
84+
- 🚀 Plotting Optimizations
8485
- 📐 More Nebula outline levels
8586
- ⚖️ Better auto font-size adjustment
86-
- ☄️ Better label collision detection and handling
8787

8888
See more details on the [Public Roadmap](https://starplot.notion.site/aaa0dd71c17943f89850c9a8c43ade50)
8989

docs/about.md

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

33
**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).
44

docs/changelog.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
## v0.10.x
3+
- Adds function for plotting text
4+
- Adds `where` kwarg to star/DSO plotting functions to selectively plot stars
5+
- Adds easier way to override style properties on plotting functions - thanks to Graham Schmidt
6+
- Adds function to plot the Sun - thanks to Graham Schmidt
7+
- Adds option to illustrate the Moon's phase - thanks to Graham Schmidt
8+
- Adds `objects` property to plots that stores lists of objects that have been plotted
9+
- Adds object finder helpers
10+
- Adds customizable anchor points for text labels
11+
- Adds Pluto as a planet :)
12+
- Fixes clipping issues with polygons
13+
14+
## v0.9.x
15+
[Documentation](https://archives.starplot.dev/0.9.1/)
16+
17+
- Added perspective projections (Orthographic, Stereographic) to map plots - many thanks to @bathoorn
18+
- Zenith plots are now a type of projection for map plots, to support plotting the Milky Way, constellation borders and more - many thanks to @bathoorn
19+
- Removed the visible style property and instead now you control what is plotted by calling functions on the plot (e.g. p.stars(mag=8)) to be more consistent with other plotting frameworks and allow more control over what's plotted and how. For example, now you can do things like plotting very bright stars with a different marker (and sizes, etc) than dimmer stars.
20+
- Optional callables for calculating star size/alpha/color when plotting stars
21+
- Nebula outlines! via OpenNGC
22+
- Stars are now plotted in order of their calculated size, which prevents "bigger" stars from hiding "smaller" stars
23+
- Added more marker symbols and style extensions
24+
- [**v0.9.1**] Fixes bug with plotting moon and planets as their true size
25+
26+
## v0.8.x
27+
[Documentation](https://archives.starplot.dev/0.8.4/)
28+
29+
- Adds new Milky Way outline created from a NASA image, and broken into sections to speed up plotting/exporting
30+
- Adds styling support for more DSO types
31+
- Adds support for Mollweide projection
32+
- Fixes map and optic plots to handle wrapping of RA (e.g. plotting RA extent from 2h -> 18h)
33+
- Fixes a bug in all plots that prevented some star styles to not get applied
34+
- [**v0.8.1**] Fixes a small bug in adjusting RA extent on map plots
35+
- [**v0.8.2**] Fixes a small bug in determining if a RA/DEC is in bounds of a plot
36+
- [**v0.8.3**] More consistent polygon/circle sizing across projections
37+
- [**v0.8.4**] Fixes a small bug in plotting text labels of DSOs, which prevented some styles from getting applied

docs/coming-soon.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
- 🌑 Planet moons
3+
- ✴️ Custom markers
4+
- 🚀 Plotting Optimizations
5+
- 📐 More Nebula outline levels
6+
- ⚖️ Better auto font-size adjustment
7+
- 😄 🔭 Clear skies
8+
9+
<br/>
10+
_See more details on the [Public Roadmap :arrow_upper_right:](https://starplot.notion.site/aaa0dd71c17943f89850c9a8c43ade50)_{.text-subtitle}
11+

docs/css/extra.css

+100-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
--md-primary-fg-color--light: hsl(209, 53%, 70%);
44
--md-primary-bg-color--light: hsl(209, 78%, 90%);
55
--md-primary-fg-color--dark: hsl(209, 53%, 27%);
6+
7+
/* --md-accent-fg-color: hsl(209, 73%, 47%); */
68
}
79

810
.md-typeset h1,
@@ -30,6 +32,10 @@
3032
color: var(--md-primary-fg-color);
3133
}
3234

35+
.mt-none {
36+
margin-top: 0 !important;
37+
}
38+
3339
/* Object Class Headings */
3440
.doc-object.doc-class {
3541
border-top: 2px solid rgba(200, 200, 200, 0.6);
@@ -130,12 +136,12 @@
130136
padding-left: 1rem;
131137
border-left: 1px solid rgb(201, 201, 201);
132138
}
133-
139+
/*
134140
.doc-object .doc-attribute {
135141
margin-left: 1rem;
136142
padding-left: 1rem;
137143
border-left: 1px solid rgb(201, 201, 201);
138-
}
144+
} */
139145
.doc-object .doc-attribute .doc-label {
140146
display: none;
141147
}
@@ -162,6 +168,7 @@ code.raw {
162168
.cards ul li {
163169
display: flex !important;
164170
align-items: center;
171+
flex-direction: column;
165172
}
166173
.cards ul li img {
167174
align-self: center;
@@ -175,7 +182,7 @@ code.raw {
175182
display: flex !important;
176183
justify-content:space-between;
177184
flex-grow: 1;
178-
flex-direction: column;
185+
flex-direction: row;
179186
align-items: center;
180187
border: 1px solid #c6c6c6;
181188
margin-right: 1em;
@@ -221,6 +228,10 @@ code.raw {
221228
}
222229
}
223230

231+
.md-nav__icon {
232+
display: none;
233+
}
234+
224235
/* hide inactive nav items */
225236
.md-nav--secondary li:not(:has( a.md-nav__link--active)) {
226237
nav {
@@ -260,7 +271,7 @@ code.raw {
260271
.md-typeset .starplot > .admonition-title,
261272
.md-typeset .starplot > summary {
262273
color: var(--md-primary-fg-color);
263-
background-color: hsl(209, 58%, 87%);
274+
background-color: hsl(209, 58%, 90%);
264275
}
265276
.md-typeset .starplot > .admonition-title::before,
266277
.md-typeset .starplot > summary::before {
@@ -284,3 +295,88 @@ code.raw {
284295
-webkit-mask-image: var(--md-admonition-icon--star);
285296
mask-image: var(--md-admonition-icon--star);
286297
}
298+
299+
.example-header {
300+
padding-top: 0.5em !important;
301+
margin-bottom: 0.25em !important;
302+
border-top: 1px solid #c6c6c6;
303+
text-align: center;
304+
}
305+
306+
.text-center {
307+
text-align: center;
308+
}
309+
310+
.text-right {
311+
text-align: end;
312+
}
313+
314+
.text-subtitle {
315+
font-size: 1.25em;
316+
font-style: italic;
317+
color: #3f3f3f;
318+
}
319+
320+
.example-card-title {
321+
font-size: 1.4em;
322+
font-weight: 600;
323+
text-align: center;
324+
}
325+
326+
.grid.cards.examples>ul>li {
327+
border: 1px solid #c6c6c6 !important;
328+
margin: 8px !important;
329+
justify-content: center;
330+
padding: 0;
331+
332+
a {
333+
color: var(--md-typeset-color);
334+
padding: 1em;
335+
}
336+
}
337+
338+
.grid.cards.examples>ul>li:hover {
339+
background-color: var(--doc-symbol-class-bg-color);
340+
border: 1px solid var(--doc-symbol-class-bg-color) !important;
341+
}
342+
343+
.flex-space-between {
344+
display: flex;
345+
justify-content: space-between;
346+
align-items: center;
347+
}
348+
349+
.tutorial-top-nav {
350+
border-top: 1px solid #c6c6c6;
351+
border-bottom: 1px solid #c6c6c6;
352+
padding: 8px 10px;
353+
margin-bottom: 12px;
354+
355+
background-color: var(--doc-symbol-class-bg-color);
356+
p {
357+
margin: 0;
358+
}
359+
}
360+
361+
/* Code Styling for Tutorial */
362+
.tutorial {
363+
--md-code-hl-comment-color: hsl(209, 78%, 35%);
364+
365+
pre {
366+
line-height: 1.8;
367+
}
368+
.c1 {
369+
background-color: hsl(197, 56%, 94%);
370+
padding: 2px 5px;
371+
/* border: 1px solid hsl(207, 46%, 86%); */
372+
/* border-radius: 8px; */
373+
}
374+
}
375+
376+
[data-md-color-scheme=slate] {
377+
.tutorial .c1 {
378+
color: hsl(207, 46%, 86%);
379+
background-color: hsl(197, 36%, 30%);
380+
/* border: 1px solid hsl(207, 46%, 56%); */
381+
}
382+
}

0 commit comments

Comments
 (0)