Closed piyanatk closed 4 years ago
New commits:
ctypes
library wrapping from corrcal.py
to a separate wrapper.py
module.corrcal_c_funcs.c
and corrcal_c_funcs.h
, and the output library was renamed to c_corrcal*.so
to make them more clear.
This PR contains significant reformatting of the Python codes to compile with PEP8, improvement on the packaging, and the use of
setuptools-scm
to automate versioning.Code Styling
sparse_2level
was renamed toSparse2Level
to compile with PEP8 (i.e., class must use CamelCase).np
namespace is used instead ofnumpy
.Packaging
ctypes
wrapped functions were migrated from the main Python code,corrcal.py
, towrapper.py
. This separate the low-level,ctypes
wrapped, functions from the high-level Python interface and should make them easier to maintain in a long run.Versioning
setuptools-scm
was implemented, as suggested by @steven-murray, to automate code versioning based on thegit
hash. See https://pypi.org/project/setuptools-scm/#description.Other
do_timing
code blocks incorrcal.py
seem to be a hack to time the codes. They are probably not being used, and there are better way to do profiling. Therefore, we commented out these lines for now and will removed them in the future.One thing that has not been fixed is duplicated code fragmentation. There are many duplicated blocks of codes in
corrcal.py
. These lines are redundant and prone to bugs. Fixing them will require thorough understanding of how the codes work, so it will take some time.