POSYDON-code/POSYDON

Better handle of None objects

開放

#236 建立於 2024年1月9日

 (2 則留言) (0 個反應) (1 位負責人)Python (35 個分叉)auto 404
P3 - low priorityenhancementhelp wanted

倉庫指標

星標
 (42 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

In the code an object is set to None, if not defined. This requires careful usage.

  1. Trying to access a sub-object/function, e.g. None.dtype will always fail. -> We always need to check for None before performing a sub-function or requesting a sub-object.
  2. Any mathematical operator will fail, if one of the variables is of NoneType. -> We shouldn't use None for any float or integer variables, but np.nan instead.

I'm not sure, whether there are other things, so feel free to add possible issues occurring from None objects! Maybe there are some functions, which don't work with None objects, but most should. Thus, whenever you add a new function (including ones imported from modules) check that they can handle Nones or make sure, that there is a check before in the code!

貢獻者指南