YihangLyu
- Messages
- 1
- Reaction score
- 1
- TL;DR
- LLM scripts often run cleanly while getting the physics wrong (examples attached from a quick ERA5 check). What simple sanity checks do you use?
Hi everyone,
I'm a first-year grad student in atmospheric science (mostly extreme precipitation and satellite data). When I use LLMs to help write Python analysis scripts, the annoying part isn't syntax errors. The code usually runs fine and gives numbers that look normal, until you notice the physics or geometry is wrong.
I plotted two quick examples using an ERA5 precip file I had on hand (attached). In (a), the script forgot cos(lat) when taking the global mean, so it gave 2.39 mm/day instead of 2.91 mm/day (about 18% off). In (b), it used tp > 0 for wet days and flagged 89% of the globe as rainy, instead of a standard 1.0 mm/day threshold (42%), and ignored tiny negative values in the dataset.
I want to put a few simple checks in my workflow before trusting any script output (units, area weights, non-negative bounds, etc.). If you write scientific code regularly, what basic sanity checks do you usually include to catch silent errors like this?
I'm a first-year grad student in atmospheric science (mostly extreme precipitation and satellite data). When I use LLMs to help write Python analysis scripts, the annoying part isn't syntax errors. The code usually runs fine and gives numbers that look normal, until you notice the physics or geometry is wrong.
I plotted two quick examples using an ERA5 precip file I had on hand (attached). In (a), the script forgot cos(lat) when taking the global mean, so it gave 2.39 mm/day instead of 2.91 mm/day (about 18% off). In (b), it used tp > 0 for wet days and flagged 89% of the globe as rainy, instead of a standard 1.0 mm/day threshold (42%), and ignored tiny negative values in the dataset.
I want to put a few simple checks in my workflow before trusting any script output (units, area weights, non-negative bounds, etc.). If you write scientific code regularly, what basic sanity checks do you usually include to catch silent errors like this?
Attachments