Style guide for numpy code?

Hey all, Do any of you know of a style guide for computational / numpy code? I don't mean code that will go into numpy itself, but rather, users code that uses numpy (and scipy, and...) I know about (am a proponent -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

Oops, Somehow that got sent before I was done. (Like my use of the passive voice there?) Here is a complete message: Do any of you know of a style guide for computational / numpy code? I don't mean code that will go into numpy itself, but rather, users code that uses numpy (and scipy, and...) I know about (am a proponent of) PEP8, but it doesn’t address the unique needs of scientific programming. This is mostly about variable names. In scientific code, we often want: - variable names that match the math notation- so single character names, maybe upper or lower case to mean different things ( in ocean wave mechanics, often “h” is the water depth, and “H” is the wave height) -to distinguish between scalar, vector, and matrix values — often UpperCase means an array or matrix, for instance. But despite (or because of) these unique needs, a style guide would be really helpful. Anyone have one? Or even any notes on what you do yourself? Thanks, -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

Oops, Somehow that got sent before I was done. (Like my use of the passive voice there?) Here is a complete message: Do any of you know of a style guide for computational / numpy code? I don't mean code that will go into numpy itself, but rather, users code that uses numpy (and scipy, and...) I know about (am a proponent of) PEP8, but it doesn’t address the unique needs of scientific programming. This is mostly about variable names. In scientific code, we often want: - variable names that match the math notation- so single character names, maybe upper or lower case to mean different things ( in ocean wave mechanics, often “h” is the water depth, and “H” is the wave height) -to distinguish between scalar, vector, and matrix values — often UpperCase means an array or matrix, for instance. But despite (or because of) these unique needs, a style guide would be really helpful. Anyone have one? Or even any notes on what you do yourself? Thanks, -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
participants (2)
-
Chris Barker
-
Chris Barker - NOAA Federal