Skip to content

Round 3dp#48

Merged
joelridden merged 1 commit intomainfrom
limit_z
Jan 13, 2026
Merged

Round 3dp#48
joelridden merged 1 commit intomainfrom
limit_z

Conversation

@joelridden
Copy link
Contributor

Removes some of these weird artifacts that happen during the NZCVM calculation in the function so we don't need to do it in many other places such as NZGMDB etc.

image

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joelridden, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to eliminate numerical artifacts that can occur during NZCVM calculations by standardizing the precision of the output depth. By rounding the result directly within the compute_z_threshold function, it removes the need for downstream consumers of this function, such as NZGMDB, to perform their own rounding, leading to more consistent and reliable data.

Highlights

  • Output Precision: The compute_z_threshold function now rounds the calculated depth (z_km) to 3 decimal places before returning it, ensuring consistent output precision.
  • Documentation Update: The docstring for compute_z_threshold has been updated to explicitly state that the output depth is rounded to 3 decimal places.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces rounding to 3 decimal places for the depth calculation in compute_z_threshold. This is a good change to ensure consistent output and prevent floating-point artifacts in downstream processing. The docstring has also been updated accordingly. I've added one suggestion to make the implementation more concise.

Copy link
Member

@sungeunbae sungeunbae left a comment

Choose a reason for hiding this comment

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

I'm ok with this change, just in case double check if you need to update the benchmark data
(The tolerence is 1e-5 in the test

Threshold for comparison, by default 1e-5

)

root@mantle:/mnt/mantle_data/jenkins/nzvm/benchmarks/zvalues_test# cat zvalues_test.z 
Station_Name,Z1.0(km),Z2.5(km),sigma
HNPS,0.195,5.675,0.300
TRMS,0.055,0.575,0.500
NSPS,0.105,6.675,0.300
MWZ,0.045,0.275,0.500
NCDS,0.305,6.525,0.300
MTHZ,0.055,2.275,0.500
WDPS,0.085,0.275,0.300
TSZ,0.045,0.275,0.500
NCHS,0.145,6.525,0.300
NAAS,0.255,6.475,0.300
WFSS,0.095,8.825,0.300
NGHS,0.115,6.675,0.300
OPSS,0.075,1.825,0.500
URZ,0.045,0.275,0.500
HAVS,0.055,0.275,0.500
DAVS,0.065,0.325,0.300
PWES,0.045,0.275,0.500
MOLS,0.065,0.375,0.500
WANS,0.035,0.275,0.500
INSS,0.055,0.325,0.500
NELS,0.395,0.425,0.300
NBSS,0.065,0.325,0.300
WDFS,0.305,4.475,0.300
NEWS,0.045,1.225,0.500
SOMS,0.095,0.325,0.300
VUWS,0.085,0.325,0.300
TEPS,0.125,0.375,0.300
LIRS,0.065,0.325,0.300
WTYS,0.085,0.375,0.300
FAIS,0.065,0.325,0.500
PGMS,0.275,0.325,0.300
KHLS,0.065,1.825,0.500
NNZ,0.045,0.325,0.500
UHSS,0.115,0.325,0.300
LRSS,0.205,0.325,0.300
MKBS,0.045,0.275,0.500
SEDS,0.695,2.125,0.300
PHHS,0.045,0.075,0.500
TRTS,0.055,0.325,0.300
KIKS,0.325,4.325,0.300
WEL,0.045,0.325,0.500
WDAS,0.075,0.275,0.300
MISS,0.065,0.325,0.300
UHCS,0.385,0.425,0.300
MKVS,0.055,0.275,0.500
MATS,0.055,2.125,0.500
TAIS,0.095,0.325,0.300
WEMS,0.155,0.325,0.300
BOWS,0.065,0.325,0.300
BWRS,0.065,0.275,0.500

@joelridden
Copy link
Contributor Author

I'm ok with this change, just in case double check if you need to update the benchmark data (The tolerence is 1e-5 in the test

Threshold for comparison, by default 1e-5

)

root@mantle:/mnt/mantle_data/jenkins/nzvm/benchmarks/zvalues_test# cat zvalues_test.z 
Station_Name,Z1.0(km),Z2.5(km),sigma
HNPS,0.195,5.675,0.300
TRMS,0.055,0.575,0.500
NSPS,0.105,6.675,0.300
MWZ,0.045,0.275,0.500
NCDS,0.305,6.525,0.300
MTHZ,0.055,2.275,0.500
WDPS,0.085,0.275,0.300
TSZ,0.045,0.275,0.500
NCHS,0.145,6.525,0.300
NAAS,0.255,6.475,0.300
WFSS,0.095,8.825,0.300
NGHS,0.115,6.675,0.300
OPSS,0.075,1.825,0.500
URZ,0.045,0.275,0.500
HAVS,0.055,0.275,0.500
DAVS,0.065,0.325,0.300
PWES,0.045,0.275,0.500
MOLS,0.065,0.375,0.500
WANS,0.035,0.275,0.500
INSS,0.055,0.325,0.500
NELS,0.395,0.425,0.300
NBSS,0.065,0.325,0.300
WDFS,0.305,4.475,0.300
NEWS,0.045,1.225,0.500
SOMS,0.095,0.325,0.300
VUWS,0.085,0.325,0.300
TEPS,0.125,0.375,0.300
LIRS,0.065,0.325,0.300
WTYS,0.085,0.375,0.300
FAIS,0.065,0.325,0.500
PGMS,0.275,0.325,0.300
KHLS,0.065,1.825,0.500
NNZ,0.045,0.325,0.500
UHSS,0.115,0.325,0.300
LRSS,0.205,0.325,0.300
MKBS,0.045,0.275,0.500
SEDS,0.695,2.125,0.300
PHHS,0.045,0.075,0.500
TRTS,0.055,0.325,0.300
KIKS,0.325,4.325,0.300
WEL,0.045,0.325,0.500
WDAS,0.075,0.275,0.300
MISS,0.065,0.325,0.300
UHCS,0.385,0.425,0.300
MKVS,0.055,0.275,0.500
MATS,0.055,2.125,0.500
TAIS,0.095,0.325,0.300
WEMS,0.155,0.325,0.300
BOWS,0.065,0.325,0.300
BWRS,0.065,0.275,0.500

Rounding had no effect on these, they are already different due to other testing issues.

@joelridden joelridden requested a review from sungeunbae January 13, 2026 02:31
@joelridden joelridden merged commit 1ed0eed into main Jan 13, 2026
4 checks passed
@joelridden joelridden deleted the limit_z branch January 13, 2026 23:03
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.

4 participants