Skip to content

Conversation

@yunjunz
Copy link
Member

@yunjunz yunjunz commented Jan 21, 2026

This PR turns OFF the mild warning msg of time cross leap second table hardcored in solid.for because 1) no leap second has been introduced since Jan 2017 (https://data.iana.org/time-zones/tzdb/leap-seconds.list), and 2) the error introduced for missing a few leap second is small, and the accuracy would still be enough for many applications (https://geodesyworld.github.io/SOFTS/solid.htm)

If there is new leap second announced by IERS, we will update the code accordingly.

Summary by Sourcery

Disable leap-second boundary warning messages in the solid Earth tide Fortran routine and update CI Miniforge installation along with minor test output tweaks.

Bug Fixes:

  • Suppress spurious leap-second boundary warnings by hard-disabling the associated Fortran flag in the solid tide computations.

Enhancements:

  • Adjust CircleCI Miniforge installation to use platform-dynamic download URL and environment initialization scripts.
  • Add simple success printouts to grid and point test scripts for clearer test feedback when run manually.

CI:

  • Update CircleCI config to install Miniforge using an architecture-aware URL and conda/mamba initialization scripts.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Disables leap-second boundary warning messages in the Fortran solid Earth tide code, modernizes the CI Miniforge installer to be platform-dynamic, and adds simple success prints to two test modules.

Sequence diagram for updated dynamic Miniforge installer in CI

sequenceDiagram
  participant CI as CircleCI_job_build
  participant EX as Linux_executor
  participant SH as Shell
  participant WG as wget
  participant MF as Miniforge3.sh
  participant ME as Miniforge_env

  CI->>EX: start job
  EX->>SH: run setup script
  SH->>WG: download Miniforge3-$(uname)-$(uname -m)
  WG-->>SH: Miniforge3.sh saved
  SH->>MF: bash Miniforge3.sh -b -p ${HOME}/tools/miniforge
  MF-->>ME: create Miniforge installation
  SH->>ME: source conda.sh
  SH->>ME: source mamba.sh
  ME-->>SH: define CONDA_PREFIX and PATH
  SH-->>CI: environment ready for subsequent steps
Loading

File-Level Changes

Change Details Files
Disable leap-second boundary warnings in the solid Earth tide Fortran routine.
  • Replace conditional check on leap-second flag with a constant false condition for one leap-second boundary block.
  • Repeat the conditional replacement for a second leap-second boundary block to fully suppress the mild warning messages while keeping leap-second logic intact.
src/pysolid/solid.for
Update CircleCI Miniforge installation to a platform-dynamic, documented approach.
  • Change Miniforge installer download to use a generic script name with uname-based OS and architecture detection.
  • Replace mamba init with sourcing conda and mamba profile scripts to initialize the environment for subsequent steps.
  • Clarify comment describing Miniforge installation and reference upstream documentation.
.circleci/config.yml
Add explicit pass indicators to grid and point tests.
  • Print a pass message after grid test numerical assertions succeed.
  • Print a pass message after point test numerical assertions succeed.
tests/grid.py
tests/point.py

Possibly linked issues

  • #(not specified): The PR disables the leap second boundary warning in solid.for, directly addressing the post-2025 warning issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yunjunz yunjunz requested a review from EJFielding January 21, 2026 04:06
@yunjunz yunjunz linked an issue Jan 21, 2026 that may be closed by this pull request
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The new Miniforge wget command appears truncated (...Miniforge3-$(uname)-$(uname -m).s), which will fail to download the installer; make sure the full .sh filename is used.
  • By hardcoding if(.false.) in solid.for you completely disable the leap-second boundary warning; consider keeping this behavior behind a flag or configuration option so users who rely on the warning can still enable it.
  • The print('Pass.') additions in the tests add unnecessary noise to test output; it would be cleaner to rely on assertions only and drop these prints.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new Miniforge wget command appears truncated (`...Miniforge3-$(uname)-$(uname -m).s`), which will fail to download the installer; make sure the full `.sh` filename is used.
- By hardcoding `if(.false.)` in `solid.for` you completely disable the leap-second boundary warning; consider keeping this behavior behind a flag or configuration option so users who rely on the warning can still enable it.
- The `print('Pass.')` additions in the tests add unnecessary noise to test output; it would be cleaner to rely on assertions only and drop these prints.

## Individual Comments

### Comment 1
<location> `.circleci/config.yml:49` </location>
<code_context>
+            source "${HOME}/tools/miniforge/etc/profile.d/conda.sh"
+            source "${HOME}/tools/miniforge/etc/profile.d/mamba.sh"
             # modify/export env var PATH to BASH_ENV to be shared across run steps
             echo 'export PATH=${CONDA_PREFIX}/bin:${PATH}' >> ${BASH_ENV}

</code_context>

<issue_to_address>
**issue (bug_risk):** Relying on CONDA_PREFIX here may result in an empty or incorrect PATH if no environment is activated.

Because `CONDA_PREFIX` is only set after `conda activate`, and there’s no activation here, it may be unset and yield a bad PATH (e.g. `PATH=/bin:$PATH`). If you just need `miniforge/bin`, consider exporting a fixed install path like `${HOME}/tools/miniforge/bin` instead of relying on `CONDA_PREFIX`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

+ `.circleci/config.yml`: replace `mamba init bash` with `source conda/mamba.sh`, as suggested by its GitHub repo readme at https://github.com/conda-forge/miniforge?tab=readme-ov-file#as-part-of-a-ci-pipeline, to fix the current circle CI environment setup error.
because 1) no leap second has been introduced since Jan 2017 (https://data.iana.org/time-zones/tzdb/leap-seconds.list), and 2) the error introduced for missing a few  leap second is small, and the accuracy would still be enough for many applications (https://geodesyworld.github.io/SOFTS/solid.htm)

If there is new leap second announced by IERS, we will update the code accordingly.
@yunjunz yunjunz merged commit c42bac1 into insarlab:main Jan 21, 2026
6 of 7 checks passed
@yunjunz yunjunz deleted the leap_sec_msg branch January 21, 2026 07:35
Copy link

@EJFielding EJFielding left a comment

Choose a reason for hiding this comment

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

Good solution, thanks!

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.

Leap second table in solid.for expired on 28 December 2025

2 participants