Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging #16

Merged
merged 11 commits into from
Jan 4, 2022
Merged

Packaging #16

merged 11 commits into from
Jan 4, 2022

Conversation

pravirkr
Copy link
Collaborator

Refactoring of the whole package.

io module

  • sigproc related functions are in the io module now. Removing the back_compatible option and using sigproc_keys (defined in sigproc docs) as the definition of a sigproc header.

Header

  • Using attrs for the new Header structure. The aim is to have a common header class read from different formats sigproc/psrfits/inf and write back. The header class is now more rigid compared to the earlier version, with property attributes handled accordingly.
  • One issue is that the output sigproc header size will be larger than the input, as we are using most of the sigproc keywords while writing to filterbanks.

C++

  • Removing dependency on fftw3. Using numpy fft now (or pyfftw if available on the system).
  • Moving all backend C++ code inside as libcpp module.

other

  • module, class, and function names are now as per PEP 8. This will break the existing API.
  • Moving FilterbankBlock to a separate module. FoldedData is now foldedcube. Renaming the Filterbank module to base (all readers should inherit from this base class).
  • Support for command-line utilities (spp_header and spp_decimate for now).
  • Added more data files and tests.

@pravirkr pravirkr requested a review from telegraphic May 16, 2021 05:23
@pravirkr pravirkr self-assigned this May 16, 2021
@pravirkr pravirkr added the enhancement New feature or request label May 16, 2021
@telegraphic
Copy link
Contributor

Holy cow that is quite the refactor! 🕳️ 🐮 🕳️

@pravirkr pravirkr mentioned this pull request May 17, 2021
@pravirkr
Copy link
Collaborator Author

Hi @telegraphic, the major change is in the Header class. The rest of them are just moving files and PEP 8 changes. There is no rush to merge this. I should also add the psrfits io to have a better idea about a common Header class design.

@pravirkr
Copy link
Collaborator Author

pravirkr commented Jan 4, 2022

Hi @telegraphic, I am going ahead with the refactoring. The plan is to make this package an entirely python-based replacement of sigproc. Also, moving the core kernels from pybind11 to numba (easy to add new functions and no significant performance loss). Dependency on fftw3 and omp is now external; easy to pip install.

This will break the existing API. So, moving the current code to a legacy branch.

@pravirkr pravirkr merged commit 646113e into main Jan 4, 2022
@telegraphic
Copy link
Contributor

Glorious work! Python only seems reasonable, but bit unpacking might be difficult?

BTW, I suggest tagging a release & updating the README.md

🚀

@pravirkr
Copy link
Collaborator Author

bit unpacking powered by numpy/numba. 1 bit (numpy.unpackbits) is faster than numbits, whereas 2 and 4 bits (numba) are comparatively slower but acceptable.

Yes, need to update README.

@pravirkr pravirkr deleted the packaging branch January 22, 2022 07:17
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants