From 069244876def6f8c3331e24feff3ccedd209ff65 Mon Sep 17 00:00:00 2001 From: Stefan de Lange Date: Sat, 29 Nov 2025 17:24:51 +0100 Subject: [PATCH 1/4] Align markdown tables --- README.md | 22 +++++++++++----------- docs/src/guides/new-algorithm.md | 26 +++++++++++++------------- docs/src/guides/parallel.md | 12 ++++++------ docs/src/index.md | 30 +++++++++++++++--------------- docs/src/positioning.md | 14 +++++++------- docs/src/refraction.md | 16 ++++++++-------- 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 07de3da..50a7a07 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,11 @@ accuracy and implementation status. | Algorithm | Reference | Accuracy | Default Refraction | Status | | --------- | ----------------------------------------------------------------------------------------------- | -------- | ------------------ | ------ | -| PSA | [Blanco-Muriel et al.](https://www.sciencedirect.com/science/article/abs/pii/S0038092X00001560) | ±0.0083° | None | ✅ | -| NOAA | [Global Monitoring Laboratory](https://gml.noaa.gov/grad/solcalc/calcdetails.html) | ±0.0167° | HUGHES | ✅ | -| Walraven | [Walraven, 1978]() | ±0.0100° | None | ✅ | -| USNO | [U.S. Naval Observatory](https://aa.usno.navy.mil/faq/sun_approx) | ±0.0500° | None | ✅ | -| SPA | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | ±0.0003° | Built-in | ✅ | +| PSA | [Blanco-Muriel et al.](https://www.sciencedirect.com/science/article/abs/pii/S0038092X00001560) | ±0.0083° | None | ✅ | +| NOAA | [Global Monitoring Laboratory](https://gml.noaa.gov/grad/solcalc/calcdetails.html) | ±0.0167° | HUGHES | ✅ | +| Walraven | [Walraven, 1978]() | ±0.0100° | None | ✅ | +| USNO | [U.S. Naval Observatory](https://aa.usno.navy.mil/faq/sun_approx) | ±0.0500° | None | ✅ | +| SPA | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | ±0.0003° | Built-in | ✅ | ## Refraction correction algorithms @@ -73,12 +73,12 @@ Atmospheric refraction correction algorithms available in SolarPosition.jl. | Algorithm | Reference | Atmospheric Parameters | Status | | --------- | ------------------------------------------------------------------------------------------------ | ---------------------- | ------ | -| HUGHES | [Hughes, 1985](https://pvpmc.sandia.gov/app/uploads/sites/243/2022/10/Engineering-Astronomy.pdf) | Pressure, Temperature | ✅ | -| ARCHER | Archer et al., 1980 | None | ✅ | -| BENNETT | [Bennett, 1982](https://doi.org/10.1017/S0373463300022037) | Pressure, Temperature | ✅ | -| MICHALSKY | [Michalsky, 1988]() | None | ✅ | -| SG2 | [Blanc & Wald, 2012](https://doi.org/10.1016/j.solener.2012.07.018) | Pressure, Temperature | ✅ | -| SPA | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | Pressure, Temperature | ✅ | +| HUGHES | [Hughes, 1985](https://pvpmc.sandia.gov/app/uploads/sites/243/2022/10/Engineering-Astronomy.pdf) | Pressure, Temperature | ✅ | +| ARCHER | Archer et al., 1980 | None | ✅ | +| BENNETT | [Bennett, 1982](https://doi.org/10.1017/S0373463300022037) | Pressure, Temperature | ✅ | +| MICHALSKY | [Michalsky, 1988]() | None | ✅ | +| SG2 | [Blanc & Wald, 2012](https://doi.org/10.1016/j.solener.2012.07.018) | Pressure, Temperature | ✅ | +| SPA | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | Pressure, Temperature | ✅ | ## How to Cite diff --git a/docs/src/guides/new-algorithm.md b/docs/src/guides/new-algorithm.md index b72cb5a..a538b3e 100644 --- a/docs/src/guides/new-algorithm.md +++ b/docs/src/guides/new-algorithm.md @@ -290,19 +290,19 @@ If any checks fail, fix the issues and run pre-commit again until all checks pas Before submitting your algorithm for review, ensure you've completed the following: -| Task | Description | -| ---- | ----------- | -| Algorithm struct | Subtypes [`SolarAlgorithm`](@ref SolarPosition.Positioning.SolarAlgorithm) | -| Docstring | Includes `TYPEDEF`, `TYPEDFIELDS`, accuracy, and references | -| `_solar_position` | Function implemented with correct signature | -| Default refraction | Handling defined for [`DefaultRefraction`](@ref SolarPosition.Refraction.DefaultRefraction) | -| `result_type` | Function defined for [`DefaultRefraction`](@ref SolarPosition.Refraction.DefaultRefraction) | -| Export | Algorithm exported from both modules | -| Tests | Cover basic functionality, refraction, vectors, and edge cases | -| Test coverage | Ensure tests cover all new code paths | -| Pre-commit | Checks pass (recommended locally, required in CI) | -| Documentation | Add your algorithm to the list of available algorithms and update the tables in `positioning.md`, `README.md` and `refraction.md` if needed | -| Literature | References added to `refs.bib` and cited in docstrings | +| Task | Description | +| ------------------ | ------------------------------------------------------------------------------------------- | +| Algorithm struct | Subtypes [`SolarAlgorithm`](@ref SolarPosition.Positioning.SolarAlgorithm) | +| Docstring | Includes `TYPEDEF`, `TYPEDFIELDS`, accuracy, and references | +| `_solar_position` | Function implemented with correct signature | +| Default refraction | Handling defined for [`DefaultRefraction`](@ref SolarPosition.Refraction.DefaultRefraction) | +| `result_type` | Function defined for [`DefaultRefraction`](@ref SolarPosition.Refraction.DefaultRefraction) | +| Export | Algorithm exported from both modules | +| Tests | Cover basic functionality, refraction, vectors, and edge cases | +| Test coverage | Ensure tests cover all new code paths | +| Pre-commit | Checks pass (recommended locally, required in CI) | +| Documentation | Update algorithm lists in `positioning.md`, `README.md`, and `refraction.md` | +| Literature | References added to `refs.bib` and cited in docstrings | ## Additional Resources diff --git a/docs/src/guides/parallel.md b/docs/src/guides/parallel.md index d3a47e3..963a507 100644 --- a/docs/src/guides/parallel.md +++ b/docs/src/guides/parallel.md @@ -186,12 +186,12 @@ pos = StructVector{SolPos{Float64}}(undef, length(times)) On a system with 32 threads processing 527,041 timestamps (one year, minutely): -| Method | Time | Speedup | Allocations | -|--------|------|---------|-------------| -| Serial | 87.9 ms | 1.0× | 12.06 MiB | -| Parallel (DynamicScheduler) | 14.7 ms | **6.0×** | 66.59 MiB | -| In-place (DynamicScheduler) | 5.53 ms | **15.9×** | 20.47 KiB | -| In-place (StaticScheduler) | 5.84 ms | **15.0×** | 15.97 KiB | +| Method | Time | Speedup | Allocations | +| --------------------------- | ------- | ---------- | ----------- | +| Serial | 87.9 ms | 1.0× | 12.06 MiB | +| Parallel (DynamicScheduler) | 14.7 ms | **6.0×** | 66.59 MiB | +| In-place (DynamicScheduler) | 5.53 ms | **15.9×** | 20.47 KiB | +| In-place (StaticScheduler) | 5.84 ms | **15.0×** | 15.97 KiB | !!! tip "Performance Tips" For the best performance: diff --git a/docs/src/index.md b/docs/src/index.md index 8526ed3..2314527 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -62,26 +62,26 @@ Here we provide an overview of the solar positioning algorithms currently implem in SolarPosition.jl. Each algorithm is described with its reference paper, claimed accuracy and implementation status. -| Algorithm | Reference | Accuracy | Default Refraction | Status | -| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------- | ------------------ | ------ | -| [`PSA`](@ref SolarPosition.Positioning.PSA) | [Blanco-Muriel et al.](https://www.sciencedirect.com/science/article/abs/pii/S0038092X00001560) | ±0.0083° | None | ✅ | -| [`NOAA`](@ref SolarPosition.Positioning.NOAA) | [Global Monitoring Laboratory](https://gml.noaa.gov/grad/solcalc/calcdetails.html) | ±0.0167° | [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | ✅ | -| [`Walraven`](@ref SolarPosition.Positioning.Walraven) | [Walraven, 1978](https://doi.org/10.1016/0038-092X(78)90155-X) | ±0.0100° | None | ✅ | -| [`USNO`](@ref SolarPosition.Positioning.USNO) | [U.S. Naval Observatory](https://aa.usno.navy.mil/faq/sun_approx) | ±0.0500° | None | ✅ | -| [`SPA`](@ref SolarPosition.Positioning.SPA) | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | ±0.0003° | Built-in | ✅ | +| Algorithm | Reference | Accuracy | Default Refraction | Status | +| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------ | ------ | +| [`PSA`](@ref SolarPosition.Positioning.PSA) | [Blanco-Muriel et al.](https://www.sciencedirect.com/science/article/abs/pii/S0038092X00001560) | ±0.0083° | None | ✅ | +| [`NOAA`](@ref SolarPosition.Positioning.NOAA) | [Global Monitoring Laboratory](https://gml.noaa.gov/grad/solcalc/calcdetails.html) | ±0.0167° | [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | ✅ | +| [`Walraven`](@ref SolarPosition.Positioning.Walraven) | [Walraven, 1978](https://doi.org/10.1016/0038-092X(78)90155-X) | ±0.0100° | None | ✅ | +| [`USNO`](@ref SolarPosition.Positioning.USNO) | [U.S. Naval Observatory](https://aa.usno.navy.mil/faq/sun_approx) | ±0.0500° | None | ✅ | +| [`SPA`](@ref SolarPosition.Positioning.SPA) | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | ±0.0003° | Built-in | ✅ | ## Refraction correction algorithms Atmospheric refraction correction algorithms available in SolarPosition.jl. -| Algorithm | Reference | Atmospheric Parameters | Status | -| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ---------------------- | ------ | -| [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | [Hughes, 1985](https://pvpmc.sandia.gov/app/uploads/sites/243/2022/10/Engineering-Astronomy.pdf) | Pressure, Temperature | ✅ | -| [`ARCHER`](@ref SolarPosition.Refraction.ARCHER) | Archer et al., 1980 | None | ✅ | -| [`BENNETT`](@ref SolarPosition.Refraction.BENNETT) | [Bennett, 1982](https://doi.org/10.1017/S0373463300022037) | Pressure, Temperature | ✅ | -| [`MICHALSKY`](@ref SolarPosition.Refraction.MICHALSKY) | [Michalsky, 1988](https://doi.org/10.1016/0038-092X(88)90045-X) | None | ✅ | -| [`SG2`](@ref SolarPosition.Refraction.SG2) | [Blanc & Wald, 2012](https://doi.org/10.1016/j.solener.2012.07.018) | Pressure, Temperature | ✅ | -| [`SPARefraction`](@ref SolarPosition.Refraction.SPARefraction) | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | Pressure, Temperature | ✅ | +| Algorithm | Reference | Atmospheric Parameters | Status | +| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ---------------------- | ------ | +| [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | [Hughes, 1985](https://pvpmc.sandia.gov/app/uploads/sites/243/2022/10/Engineering-Astronomy.pdf) | Pressure, Temperature | ✅ | +| [`ARCHER`](@ref SolarPosition.Refraction.ARCHER) | Archer et al., 1980 | None | ✅ | +| [`BENNETT`](@ref SolarPosition.Refraction.BENNETT) | [Bennett, 1982](https://doi.org/10.1017/S0373463300022037) | Pressure, Temperature | ✅ | +| [`MICHALSKY`](@ref SolarPosition.Refraction.MICHALSKY) | [Michalsky, 1988](https://doi.org/10.1016/0038-092X(88)90045-X) | None | ✅ | +| [`SG2`](@ref SolarPosition.Refraction.SG2) | [Blanc & Wald, 2012](https://doi.org/10.1016/j.solener.2012.07.018) | Pressure, Temperature | ✅ | +| [`SPARefraction`](@ref SolarPosition.Refraction.SPARefraction) | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | Pressure, Temperature | ✅ | ## How to Cite diff --git a/docs/src/positioning.md b/docs/src/positioning.md index 107cd2d..c7c2b2f 100644 --- a/docs/src/positioning.md +++ b/docs/src/positioning.md @@ -56,13 +56,13 @@ fig The following solar position algorithms are currently implemented in SolarPosition.jl: -| Algorithm | Reference | Accuracy | Default Refraction | Status | -| ----------------------------------------------------- | --------------- | ------------- | ------------------ | ------ | -| [`PSA`](@ref SolarPosition.Positioning.PSA) | [BALL01](@cite) | ±0.0083° | None | ✅ | -| [`NOAA`](@ref SolarPosition.Positioning.NOAA) | [NOAA](@cite) | ±0.0167° | [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | ✅ | -| [`Walraven`](@ref SolarPosition.Positioning.Walraven) | [Wal78](@cite) | ±0.0100° | None | ✅ | -| [`USNO`](@ref SolarPosition.Positioning.USNO) | [USNO](@cite) | ±0.0500° | None | ✅ | -| [`SPA`](@ref SolarPosition.Positioning.SPA) | [RA04](@cite) | ±0.0003° | Built-in | ✅ | +| Algorithm | Reference | Accuracy | Default Refraction | Status | +| ----------------------------------------------------- | --------------- | -------- | ------------------------------------------------ | ------ | +| [`PSA`](@ref SolarPosition.Positioning.PSA) | [BALL01](@cite) | ±0.0083° | None | ✅ | +| [`NOAA`](@ref SolarPosition.Positioning.NOAA) | [NOAA](@cite) | ±0.0167° | [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | ✅ | +| [`Walraven`](@ref SolarPosition.Positioning.Walraven) | [Wal78](@cite) | ±0.0100° | None | ✅ | +| [`USNO`](@ref SolarPosition.Positioning.USNO) | [USNO](@cite) | ±0.0500° | None | ✅ | +| [`SPA`](@ref SolarPosition.Positioning.SPA) | [RA04](@cite) | ±0.0003° | Built-in | ✅ | ## [PSA](@id psa-algorithm) diff --git a/docs/src/refraction.md b/docs/src/refraction.md index 921a062..db43e74 100644 --- a/docs/src/refraction.md +++ b/docs/src/refraction.md @@ -23,14 +23,14 @@ true position, especially near the horizon. Image source: [Wikimedia Commons](@c `SolarPosition.jl` includes several refraction correction algorithms. Below is a summary of the available algorithms: -| Algorithm | Reference | Atmospheric Parameters | Status | -| ------------------------------------------------------ | -------------- | ---------------------- | ------ | -| [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | [Hug85](@cite) | Pressure, Temperature | ✅ | -| [`ARCHER`](@ref SolarPosition.Refraction.ARCHER) | [Arc80](@cite) | None | ✅ | -| [`BENNETT`](@ref SolarPosition.Refraction.BENNETT) | [Ben82](@cite) | Pressure, Temperature | ✅ | -| [`MICHALSKY`](@ref SolarPosition.Refraction.MICHALSKY) | [Mic88](@cite) | None | ✅ | -| [`SG2`](@ref SolarPosition.Refraction.SG2) | [BW12](@cite) | Pressure, Temperature | ✅ | -| [`SPARefraction`](@ref SolarPosition.Refraction.SPARefraction) | [RA04](@cite) | Pressure, Temperature | ✅ | +| Algorithm | Reference | Atmospheric Parameters | Status | +| -------------------------------------------------------------- | -------------- | ---------------------- | ------ | +| [`HUGHES`](@ref SolarPosition.Refraction.HUGHES) | [Hug85](@cite) | Pressure, Temperature | ✅ | +| [`ARCHER`](@ref SolarPosition.Refraction.ARCHER) | [Arc80](@cite) | None | ✅ | +| [`BENNETT`](@ref SolarPosition.Refraction.BENNETT) | [Ben82](@cite) | Pressure, Temperature | ✅ | +| [`MICHALSKY`](@ref SolarPosition.Refraction.MICHALSKY) | [Mic88](@cite) | None | ✅ | +| [`SG2`](@ref SolarPosition.Refraction.SG2) | [BW12](@cite) | Pressure, Temperature | ✅ | +| [`SPARefraction`](@ref SolarPosition.Refraction.SPARefraction) | [RA04](@cite) | Pressure, Temperature | ✅ | To calculate refraction, we can use the [`refraction`](@ref SolarPosition.Refraction.refraction) function: From 190f74bcc71e2d53addb23a71e0d97255c2306f7 Mon Sep 17 00:00:00 2001 From: Stefan de Lange Date: Sat, 29 Nov 2025 17:28:27 +0100 Subject: [PATCH 2/4] Fix rev field warning in pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71a883a..4ce85b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,6 +52,6 @@ repos: hooks: - id: julia-formatter - repo: https://github.com/crate-ci/typos - rev: v1 + rev: v1.40.0 hooks: - id: typos From d43848cee7ad571b928d203f3b65c94b36aa6343 Mon Sep 17 00:00:00 2001 From: Stefan de Lange Date: Sat, 29 Nov 2025 17:28:35 +0100 Subject: [PATCH 3/4] Add extensions table to readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 50a7a07..dcda969 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,17 @@ Atmospheric refraction correction algorithms available in SolarPosition.jl. | SG2 | [Blanc & Wald, 2012](https://doi.org/10.1016/j.solener.2012.07.018) | Pressure, Temperature | ✅ | | SPA | [Reda & Andreas, 2004](https://doi.org/10.1016/j.solener.2003.12.003) | Pressure, Temperature | ✅ | +## Extensions + +SolarPosition.jl provides optional extensions that are automatically loaded when you +import the corresponding packages: + +| Extension | Trigger Package | Features | +| --------------- | -------------------- | ------------------------------------------------- | +| Makie | `Makie.jl` | Plotting recipes for solar position visualization | +| OhMyThreads | `OhMyThreads.jl` | Parallel computation of solar positions | +| ModelingToolkit | `ModelingToolkit.jl` | Symbolic solar position models for simulations | + ## How to Cite If you use SolarPosition.jl in your work, please cite using the reference given in [CITATION.cff](https://github.com/JuliaAstro/SolarPosition.jl/blob/main/CITATION.cff). From d9aa294ad8a0bf0b34bae4e410f7671330dab269 Mon Sep 17 00:00:00 2001 From: Stefan de Lange Date: Sat, 29 Nov 2025 17:31:45 +0100 Subject: [PATCH 4/4] Add hyperlinks to package extensions --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dcda969..9a1bb70 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,11 @@ Atmospheric refraction correction algorithms available in SolarPosition.jl. SolarPosition.jl provides optional extensions that are automatically loaded when you import the corresponding packages: -| Extension | Trigger Package | Features | -| --------------- | -------------------- | ------------------------------------------------- | -| Makie | `Makie.jl` | Plotting recipes for solar position visualization | -| OhMyThreads | `OhMyThreads.jl` | Parallel computation of solar positions | -| ModelingToolkit | `ModelingToolkit.jl` | Symbolic solar position models for simulations | +| Extension | Trigger Package | Features | +| --------------- | --------------------------------------------------------------------- | ------------------------------------------------- | +| Makie | [`Makie.jl`](https://github.com/MakieOrg/Makie.jl) | Plotting recipes for solar position visualization | +| OhMyThreads | [`OhMyThreads.jl`](https://github.com/JuliaFolds2/OhMyThreads.jl) | Parallel computation of solar positions | +| ModelingToolkit | [`ModelingToolkit.jl`](https://github.com/SciML/ModelingToolkit.jl) | Symbolic solar position models for simulations | ## How to Cite