Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sa_ct_interp and tracer_ct_interp functions to GSW-Python #185

Merged
merged 20 commits into from
Nov 11, 2024

Conversation

mauzey1
Copy link
Contributor

@mauzey1 mauzey1 commented Oct 8, 2024

This will add the MRST-PCHIP interpolation functions added to GSW-C in TEOS-10/GSW-C#73 to the Python library. This will also add the MRST interpolation method option from TEOS-10/GSW-C#74 to geo_strf_dyn_height.

@efiring efiring self-requested a review November 6, 2024 00:19
Copy link
Member

@efiring efiring left a comment

Choose a reason for hiding this comment

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

Thank you for the great work! This is almost ready to merge. The pre-commit checker (ruff) has 3 complaints that will be trivial to fix:

gsw/interpolation.py:61:16: C419 Unnecessary list comprehension
gsw/interpolation.py:145:16: C419 Unnecessary list comprehension
gsw/tests/test_geostrophy.py:1:1: I001 [*] Import block is un-sorted or un-formatted

If you don't mind, I would like to see this merged as a single squashed commit. Let me know if that is OK, and if you would prefer to squash/rebase it yourself, or have me use one of the github merge options to do it.

@efiring
Copy link
Member

efiring commented Nov 6, 2024

@ocefpaf There are now several different modes of test failure, only one of which (the pre-commit ruff check) looks related to the content of the PR. Do you know what is going on? For example, I see micromamba.exe failing, a twine argument error, and perfectly good URLs being rejected by the link checker.

@ocefpaf ocefpaf mentioned this pull request Nov 6, 2024
@ocefpaf
Copy link
Member

ocefpaf commented Nov 6, 2024

. Do you know what is going on? For example, I see micromamba.exe failing, a twine argument error, and perfectly good URLs being rejected by the link checker.

  • Micromamba 2.0.3 has a bug on Windows and they are looking into it. Ignore that one for now.
  • I believe that the failing URLs may be a problem with latest curl 8.11 and redirects, not sure. Investigating in Fix URLs redirects #187 (It is not! The failures are due to another oddity in micromamba's solve for our development env.)
  • Why we are getting twine 1.11.0 there is beyond my comprehension. Something is amiss latest micromamba.

TL;DR this PR is good to go with just the pre-commit fixes. I'm working on the rest a bit today and should finish tomorrow morning.

@ocefpaf ocefpaf mentioned this pull request Nov 6, 2024
@efiring
Copy link
Member

efiring commented Nov 6, 2024

@mauzey1, looking at the output from a slow test (ubuntu-22.04 (aarch64) wheels), I noticed the following compiler warnings:

 gcc -pthread -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/tmp/build-env-10xopuvh/lib/python3.13/site-packages/numpy/_core/include -I/project/src/c_gsw -I/tmp/build-env-10xopuvh/include -I/opt/_internal/cpython-3.13.0/include/python3.13 -c src/c_gsw/gsw_oceanographic_toolbox.c -o build/temp.linux-aarch64-cpython-313/src/c_gsw/gsw_oceanographic_toolbox.o
  src/c_gsw/gsw_oceanographic_toolbox.c: In function ‘gsw_sa_ct_interp’:
  src/c_gsw/gsw_oceanographic_toolbox.c:8642:16: warning: unused variable ‘j’ [-Wunused-variable]
   8642 |         int i, j, k, prof_len,
        |                ^
  src/c_gsw/gsw_oceanographic_toolbox.c: In function ‘gsw_tracer_ct_interp’:
  src/c_gsw/gsw_oceanographic_toolbox.c:11378:19: warning: unused variable ‘ct_f’ [-Wunused-variable]
  11378 |         double d, ct_f, unique_p, ct_sum, tracer_sum, min_p_obs, max_p_obs;
        |                   ^~~~
  src/c_gsw/gsw_oceanographic_toolbox.c:11375:24: warning: variable ‘i_2_len’ set but not used [-Wunused-but-set-variable]
  11375 |             i_out_len, i_2_len;
        |                        ^~~~~~~
  src/c_gsw/gsw_oceanographic_toolbox.c:11372:16: warning: unused variable ‘j’ [-Wunused-variable]
  11372 |         int i, j, k, prof_len,
        |                ^
  src/c_gsw/gsw_oceanographic_toolbox.c: In function ‘gsw_sa_ct_interp’:
  src/c_gsw/gsw_oceanographic_toolbox.c:8645:43: warning: ‘i_shallower’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   8645 |             i_out_len, i_2_len, i_frozen, i_shallower, i_above, i_above_i, i_below_i;
        |                                           ^~~~~~~~~~~

I would appreciate it if you would provide a PR to GSW-C and a commit to the current PR to clean up those warnings. Given that GSW-C now tests with several compilers, it is possible that additional warnings will turn up, but I don't expect that.

@ocefpaf
Copy link
Member

ocefpaf commented Nov 7, 2024

Eric, @SylvainCorlay's team removed/yanked micromamba 2.0.3 and the CIs should work again as expected. I restart the jobs.

@efiring efiring merged commit 243a30d into TEOS-10:main Nov 11, 2024
32 checks passed
@mauzey1 mauzey1 deleted the gsw_sa_ct_interp branch November 11, 2024 18:52
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.

3 participants