-
Notifications
You must be signed in to change notification settings - Fork 18
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
Patch utils: tentative v0.3. #11
Conversation
This looks very good. A few comments based on my process going through what you suggested:
Apart from these comments, feel free to go ahead and merge at any time :) |
…tests, lint, typeannot and coverage options
Thanks @mrava87, I added the requirements and improved the Makefile to go along with it. Regarding your other comments, I think it would be a good idea to host it in github pages, what do you think? And I agree with the sphinx-gallery, as right now the examples are just a collection of notebooks. I will try to figure out the sphinx-gallery in the coming days (new issue #12). Could you investigate how the github pages would work within the PyLops namespace and add any recommentations here: #13? Feel free to merge this if you are happy with it. |
Perfect, let me reply here then I merge: For GitHub pages this is how I set it up for PyMarchneko: https://github.com/DIG-Kaust/pymarchenko/blob/main/Makefile (see the last two commands and this https://github.com/DIG-Kaust/pymarchenko/blob/main/docssrc/Makefile The assumption here is that you cannot build the doc anywhere but locally (so not even with a GitHub action, which I think is the case for curvelops since we can’t really download the Curvelets code in CI). Also this isn’t really my own solution, I found it somewhere online but it has worked well for me :) The other step is to go to Settings -> Pages of this repo and select Deploy from a branch and choose the gh-pages |
Of course I am happy to help setting it up :) |
Description
This PR adds several features and minor improvements. Three new modules are created:
plot
,utils
,typing
.plot
: Contains functions for plotting curvelet coefficients in different forms, includingcurveshow
which shows all curvelet coefficients in space of frequency domain, andoverlay_disks
, which visualizes the energy of curvelet coefficients in different pars of the image in a similar way to the Kymatio scattering disk example. These plotting functions require the creation of specializes axes and grids, so convenience functions have been added, see new functionscreate_colorbar
,create_axes_grid
andcreate_inset_axes_grid
, for example. Finally, another useful function to overlay a vector field in a similar manner tooverlay_disks
is included:overlay_arrows
. All of the plotting functions are thoroughly documented with self-contained examples.utils
: Contains functions which are helpful when dealing with curvelet structures.apply_along_wedges
, for example, maps a lambda function to each curvelet coefficient organized in a curvelet structure.energy
is an utility function for computing the energy of a single wedge. Putting these two together can create a structure of curvelet energies. Another useful utility functionarray_split_nd
, splits an N-dimensional array in chunks for each dimension. For example, if you want to split a 2D array into 4 quadrants, you can doarray_split_nd(two_d_array, 2, 2)
. This function also handles uneven splits. It is essentially the N-dimensional version of NumPy'sarray_split
. A similar function that only supports even splits is also included,split_nd
.typing
: Contains some useful classes for type annotation:FDCTStructLike
, a list of list of nd-arrays andRecursiveListNDArray
, a recursive list of nd-arrays.Suggestion for review
Clone,
pip install -e .
, runpytest
andmake doc; make servedoc
. From the docs, run the examples in the documentation in an IPython/Jupyter session. Ignore the changes to the cpp files: it is just a reformatting. Runflake8 curvelops/
andmypy curvelops/
.