Skip to content

[MAJOR VERSION BUMP] Support GeoParams v0.8, drop Julia 1.9, coverage improvements, performance updates - #224

Merged
aelligp merged 10 commits into
mainfrom
aelligp-patch-4
Oct 6, 2026
Merged

aelligp merged 10 commits into
mainfrom
aelligp-patch-4

Conversation

@aelligp

@aelligp aelligp commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Whats the purpose of this PR?

  • Bug fix
  • New feature
  • Documentation update
  • Other, please explain

Describe it in more detail below:

  • Add support for GP v0.8
  • BREAKING CHANGE: Drop support for Julia version 1.9 and bump it to the lts version 1.10 --> requires a major release to v0.8.0 (already in this PR)

Performance

The fields of the data structures (GeoData, UTMData, …) and of the thermal-structure parameter types (HalfspaceCoolingTemp, SpreadingRateTemp) are not concretely typed, so loops that index them dynamically dispatched on every grid point. The per-point loops of the UTM ↔ lon/lat conversions and of the halfspace-cooling and spreading-rate thermal structures now run in separate functions that are called with the unpacked arrays and parameters, so they compile for the concrete types. The structs themselves are unchanged and results are numerically identical.

Median of 5 runs, Julia 1.13, Apple Silicon; model-setup cases on a 128³ grid:

Workflow Before After Speedup
add_box! + SpreadingRateTemp 224 ms 38 ms 5.9×
add_layer! + HalfspaceCoolingTemp 67 ms 12 ms 5.5×
add_box! + HalfspaceCoolingTemp, dipping 159 ms 30 ms 5.2×
add_plate! with ridge segments 111 ms 52 ms 2.1×
convert(UTMData, ::GeoData), 600k points 445 ms 125 ms 3.6×
convert2CartData(::GeoData, proj), 600k points 393 ms 130 ms 3.0×
convert(GeoData, ::UTMData), 1M points 760 ms 261 ms 2.9×
project_CartData (GeoData volume → 1M-point CartData) 872 ms 390 ms 2.2×

Memory allocated by these calls drops by 15–55%.

Bug fixes

Each fix has a test that fails without it.

  • voxel_grav threw an error when called with the default refMod = "AVG"; the reference model is now the mean density of each depth slice, as documented.
  • voxel_grav rejected regular grids in metres as "non-regular", because the spacing check used an absolute tolerance of 1e-12. It now uses a relative tolerance.
  • project_CartData(::CartData, ::CartData) referenced an undefined variable; it now interpolates the fields of the second dataset onto the first.
  • interpolate_datafields(::UTMData, …) and +/- on UTMData surfaces did not pass the UTM zone to the constructor and always threw (this also affected the 3D case of project_CartData(::CartData, ::UTMData, ::ProjectionPoint)).
  • fit_surface_to_points(::GeoData, …) threw, used surface indices on the point vector, and would have modified its input.
  • interpolate_data_surface for ParaviewData and CartData tried to modify an immutable GeoUnit.
  • coordinate_grids(::ParaviewData) passed 3D arrays to xyz_grid.
  • interpolate_datafields_2D threw for datasets that contain vector (tuple) fields.
  • GMG_Dataset threw a BoundsError for directory names shorter than 5 characters.
  • ReadCSV_LatLon no longer prints a debug line.

Removed dead code

  • src/sea_level.jl (an outdated copy of src/sea_lvl.jl) and src/IO_ASAGI.jl (now in the NCDatasets extension) were not included by the package.
  • cell_tags_from_gmsh in src/pTatin_IO.jl duplicated the one in the Gmsh extension, which is the one in use.

Tests and coverage

Line coverage of src/ and ext/ goes from 63.9% to 83.5%. New tests cover printing of all data types, write_paraview for Q1Data/FEData/UTMData and movies, coordinate transformations, surface operations, voxel_grav (input checks, units, orientation, reference models; the test file is now organized in testsets), CSV import, the LaMEM partitioning helpers, and the 2D interpolation and lithostatic-pressure utilities.

Checklist

  • The PR title is descriptive and starts with the appropriate tag: [BUGFIX], [ADDITION], [DOC], etc.
  • New tests (either assessing the correct behaviour of new internal functions or the correctness of a tutorial) were added, or old tests were updated
  • Affected tutorials have also been updated
  • The new feature was added in a way that does not break public API
  • New documentation related to the new feature was added
  • The new code follows the contributor guidelines, in particular the Runic Style

@aelligp aelligp changed the title [VERSION BUMP] Support GeoParams v0.8 [VERSION BUMP] Support GeoParams v0.8, drop Julia 1.9 Oct 5, 2026
@aelligp
aelligp requested review from boriskaus and mthielma October 5, 2026 10:35
@aelligp aelligp changed the title [VERSION BUMP] Support GeoParams v0.8, drop Julia 1.9 [MAJOR VERSION BUMP] Support GeoParams v0.8, drop Julia 1.9, coverage improvements, performance updates Oct 5, 2026

@mthielma mthielma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping julia 1.9 is fine with me, along with the other changes. Fell free to merge once the tests all pass.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Your PR no longer requires formatting changes. Thank you for your contribution!

@aelligp
aelligp merged commit dd1e899 into main Oct 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants