madscatt / zazmol

Library for defining molecular objects to create simulation and analysis programs To install: python setup.py install dependencies: numpy, mocker
GNU General Public License v3.0
0 stars 2 forks source link

need standard way to return from library functions if input is incorrect #11

Closed madscatt closed 7 years ago

madscatt commented 7 years ago

also consider adding exception handling in some cases.

madscatt commented 7 years ago

Perhaps add decorators for exception / logging handling.

madscatt commented 7 years ago

There are many ways to do this using decorators and assertions but it is considered not-Pythonic to do so. Python 3.5 has bear types and there is a nice argument to use this module. That said, since we are striving for python 2.7 and 3.X co-compatiblity bear types aren't an option.

http://stackoverflow.com/questions/19684434/best-way-to-check-function-arguments-in-python

Therefore, I will not put in argument checking and take care of this in the doc strings.