Mercurial > pylearn
comparison doc/v2_planning/API_coding_style.txt @ 1305:b60a9b6eee68
API_coding_style: Added point mentioned during meeting
author | Olivier Delalleau <delallea@iro> |
---|---|
date | Fri, 01 Oct 2010 15:27:03 -0400 |
parents | b5673b32e8ec |
children | 565e4ef0bfbd |
comparison
equal
deleted
inserted
replaced
1304:ca7e4829f6a0 | 1305:b60a9b6eee68 |
---|---|
315 ``float('inf')`` / ``float('nan')`` (should be slightly more efficient even | 315 ``float('inf')`` / ``float('nan')`` (should be slightly more efficient even |
316 if efficiency is typically not an issue here, the main goal being code | 316 if efficiency is typically not an issue here, the main goal being code |
317 consistency). Also, always use ``numpy.isinf`` / ``numpy.isnan`` to | 317 consistency). Also, always use ``numpy.isinf`` / ``numpy.isnan`` to |
318 test infinite / NaN values. This is important because ``numpy.nan != | 318 test infinite / NaN values. This is important because ``numpy.nan != |
319 float('nan')``. | 319 float('nan')``. |
320 | |
321 * Whenever possible, mimic the numpy / scipy interfaces when writing code | |
322 similar to what can be found in these packages. | |
320 | 323 |
321 * Avoid backslashes whenever possible. They make it more | 324 * Avoid backslashes whenever possible. They make it more |
322 difficult to edit code, and they are ugly (as well as potentially | 325 difficult to edit code, and they are ugly (as well as potentially |
323 dangerous if there are trailing white spaces). | 326 dangerous if there are trailing white spaces). |
324 | 327 |