PyLAP changes to work with sigmond.#16
Open
mijahauan wants to merge 9 commits into
Open
Conversation
setup.py: - Cross-platform build: Darwin (maca/maci) + Linux support - Detect gfortran runtime dir via 'gfortran -print-file-name' - Link libgfortran + libgomp on macOS (required by maca/maci .a libs) - Remove Intel Fortran runtime deps on macOS (ifcore/imf/irc/svml/iomp5) - iri2016 -> iri2020 library name (PHaRLAP 4.7.4 consolidation) - Skip modules whose required legacy libs are absent (iri2007/iri2012) - Use setuptools instead of deprecated distutils - Print BUILD/SKIP per module for diagnostics modules/pylap/__init__.py: - Soft imports for all modules; missing ones silently skipped modules/source/igrf2016.c: - igrf2016_calc_ -> igrf2020_calc_ (renamed in PHaRLAP 4.7.4) modules/source/raytrace_2d.c: - verifyIonoGrid: void -> int, ASSERT -> ASSERT_INT, add return 1 - buidlIonoStruct: void -> int, ASSERT -> ASSERT_INT, add return 1 - Call sites wrapped in checked-return pattern - Fixes -Wreturn-mismatch errors under clang modules/source/raytrace_3d.c: - verifyIono: void -> int, ASSERT -> ASSERT_INT, add return 1 - buildIonoStruct: void -> int, ASSERT -> ASSERT_INT, add return 1 - clear_ionosphere: remove spurious return 1 (legitimately void) - Call sites wrapped in checked-return pattern
modules/source/iri2016.c:
- iri2016_calc_ -> iri2020_calc_ (renamed Fortran symbol in PHaRLAP 4.7.4)
- check_ref_data("iri2016") -> check_ref_data("iri2020") (dat subdir renamed)
modules/source/common/check_ref_data.c:
- Add check_iri2020() function verifying dat/iri2020/ file layout:
igrf2025.dat/s, dgrf1945-2010, apf107.dat, ig_rz.dat,
mcsat11-22.dat, ccir11-22.asc, ursi11-22.asc
- Add "iri2020" dispatch case in check_ref_data()
…ays*9 The ray_data array is allocated as 19*nhops*num_rays doubles, so the hop-to-hop stride must be num_rays*19. The previous stride of num_rays*9 caused ground_range to be read from wrong offsets for hops > 1.
PHaRLAP 4.7.4 outputs 24 doubles per hop in ray_data (up from 19).
The undersized allocation caused heap corruption ('double free or
corruption') and the wrong stride (num_rays*19 instead of num_rays*24)
produced garbled output fields.
…where PHaRLAP 4.7.4 ships GCC-compiled static libs on all platforms (Linux, macOS arm64, macOS x86_64). The previous setup.py required Intel Fortran (ifcore/imf/irc/svml/iomp5) and a LD_LIBRARY env var on Linux. Now both platforms use the same gfortran/gomp linking path: - Auto-detect gfortran via 'which gfortran' - Locate libgfortran.so/.dylib via 'gfortran -print-file-name' - Fallback to /opt/homebrew/lib/gcc/current on macOS only - No LD_LIBRARY env var needed on any platform
GCC 14 (Debian 13/trixie) promotes -Wincompatible-pointer-types to error. pylap C extensions return PyArrayObject* as PyObject* (safe upcast via numpy API). This flag suppresses the false positive.
Add "About this fork" section to README listing the patches that distinguish this fork from HamSCI/PyLap (PHaRLAP 4.7.4 support, unified gfortran build, multi-hop stride fix, GCC 14+ compat, IRI-2020 wrapper, Fortran SAVE/Ne-units caller notes). Drop Intel Fortran redistributable from install flow — commit d5d4e6e unified Linux/macOS on gfortran, but README and setup.sh still required the Intel libs. Remove Intel lib detection, LD_LIBRARY export, and compilervars.sh sourcing from setup.sh; remove corresponding sections from README. Add IRI build-verification smoke test to README so a collaborator can confirm linkage before running the raytracing examples. Ignore venv/ and the test-output PNG. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add 'iri2020' profile type to gen_iono_grid_2d and gen_iono_grid_3d, backed by the space-physics/iri2020 package. Works without PHaRLAP, which lets collaborators verify the Python-side install before PHaRLAP access lands. Replace the string-of-ORs profile-type validation with a list membership check. Along the way fix a latent bug: two branches tested `profile_type.lower` (method reference — always truthy) instead of `profile_type.lower()`. iri2007 and iri2012 branches were therefore unreachable in the 2d path, and firi was unreachable in the 3d path. Add Examples/test_iri2020.py — smoke-test entry point referenced by the README for pre-PHaRLAP verification. Remove leftover `import ipdb` debug statements from five files (broke imports for anyone without ipdb installed). Fix requirements.txt: remove apt packages that never belonged in a pip file, fix typos (pthon3-phil, python3-phil.imagetk), add numpy and xarray (needed by iri2020), and add inline comments pointing at the apt/gfortran prerequisites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detailed in README.md