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

[13-1, 14] Change definition of scaling factor alpha , add center and approximations for Hermite functions, add Fourier transform utility functions #15

Merged
merged 65 commits into from
Jul 30, 2024

Conversation

MothNik
Copy link
Owner

@MothNik MothNik commented Jul 30, 2024

This pull request

💥 Breaking changes

  • transitions the definition of the scaling parameter alpha of the dilated Hermite functions from x / alpha to x * alpha which is not backwards-compatible
  • updates all documentation and test files for the new definition of alpha
  • renames hermite_functions._interface to hermite_functions._func_interface

🦾 Features/Enhancements

  • adds the module fourier_transform._fft_utils (with test suite) for an object-oriented interface to Fourier transforms as well as easy conversions between discrete and continuous Fourier transforms

  • implements support for all kinds of x, n, alpha, and x_center for the Hermite functions by making the type checking less rigid (especially worth to mention are Pandas Series and Python Array support for x)

  • makes tests for type handling of input validation for Hermite functions more dynamic and safer

  • adds an x_center to the Hermite functions to shift them in x-direction and adds it to documentation and tests

  • adds hermite_functions._approximations (with test suite) that offers 3 functions to easily approximate the positions of

    • the largest zero
    • the largest extremum
    • the numerical fadeout point

    of the first 100 000 Hermite functions together with scripts (developer-only (see ✍️ Documentation)) to generate the reference data

✍️ Documentation

  • adds a custom Matplotlib style to make the plots look more consistent
  • updates the content of the example plots to be more informative
  • puts proper titles on the example plots and aligns their visual appearance
  • gives example plots better names that include the index of the example they are from
  • adds a section to the README that explains the new _approximations module
  • made all plot saves in example scripts developer-only and added a note to the README that they need to be enabled by setting an environment variable

🪛 Internal changes

  • removed redundant Numba-jitted code for Hermite functions and made Numba jit-compile the existing NumPy-function instead
  • moves input validation of Hermite functions to hermite_functions._validate
  • makes input validation of Hermite functions smarter in terms of type handling

04-HermiteFunctions_SpecialPoints

- first test of a GitHub CI for testing
- fixed wrong pip install and python versions in CI ?
- fixed loading of test files that do not contain test but dependencies that cannot be loaded ?
- escaped imports of unaccessible dependencies for test-file generation in GitHub CI tests by making the `if __name__ == "__main__"` include these imports and function definitions
- test whether Cython build can be removed from GitHub actions for testing ?
- reverted removal of Cython for testing
- moved the full package back into an `src`-folder

BLD:
- updated `pyproject.toml` and `setup.py` to account for the movement to the `src`-folder
- removed dedicated Cython build from CI test pipeline
- changed CI pipeline target branches
- augmented CI checks with format, type, and lint checks
- fixed CI pipeline wrong folder include ?

BLD:
- added isort check
- fixed broken `isort` usage in CI?
- fixed missing `isort` dependency in CI?
- fixed wrong import sort order in Cython Hermite functions
- fixed missing `colorama` dependency for `isort` in CI ?
- type-ignored Cython import that was not properly resolved by `pyright` ?
- fixed missing import of Cython module for `pyright`  in CI ?
- again trying to resolve the wrong import error of Cython module by `pyright` in CI ?
- fixed wrong `pyright` Cython import error of Cython import in CI
- removed pushes to `develop` from the GitHub CI actions
- added missing comma to the name of the GitHub CI action
* DOC:
- added Python versions and `black` code style to `README`

* DOC:
- added `isort` badge to `README`

* TST:
- added `--no-jit`-flag to `pytest` to enable proper coverage of Numba functions

* tmp:
- first test of CI with coverage report ?

* BUG:
- fixed failure of `pytest-xdist` and `pytest-cov` in GitHub CI (works locally) ?

* BUG:
- fixed accidentally placed `\` for `./tests` in coverage CI action ?

* BUG:
- added codecov to CI pipeline ?

* TST:
- tried to readd `pytest-xdist` for coverage reports ?

* wip:
- reset example Jupyter notebook number 3

* MAINT:
- made `_get_num_workers` a function of the `_utils`-model

TST:
- increased coverage to 100% by testing `np.float32` x-values for the Hermite functions was well as super negative numbers of requested workers

* DOC:
- added setup, installation, and development instructions to `README`

* DOC:
- switched back from `README.rst` to `README.md`

BLD:
- made CI pipeline push actions apply to the main branch only
- added `mypy` to CI pipeline

BUG:
- fixed type error that `mypy` uncovered for the `filename_parameters_mapping` for the Hermite function reference generation
- test if CI can still pass ?
- CI apparently still runs; removed check
- added `pycodestyle` as a part of the CI checks

BUG:
- fixed a line too long error revealed by `pycodestyle`
- added CI test status to `README` ?
- added functions that help for computing discrete/continuous Fourier transforms (`fourier_transform._fft_utils`)

TST:
- implemented a test suite for `fourier_transform._fft_utils`
DOC:
- updated equations with new definitions of $\alpha$
- updated `README` with new equations and added respective reference that these definitions are based on
- added additional scripts checks to GitHub CI
- made all tools cause actual failures rather than just printing test output ?
- broke CI on purpose, by badly formatting `auxiliary_scripts\02_hermite_functions_largest_extremum.py` and `src\robust_hermite_ft\hermite_functions\_c_hermite.pyx`
- CI tests fixed `black` formatting after confirming that it works
- `isort` is the next to check
- fixed `isort` CI failure after confirming that it works
- `pyright` is the next to check
- temporarily broke `isort` CI check again to check its output
- fixed `isort` problem again
- checking for reasons why `pyright`-check fails by running it separately without output ?
- fixed `pyright` error handling in CI
- `mypy` is the next one to check, but for now it's checked whether it just runs through even though there is an error
- pushing updated CI workflow file for properly testing that `mypy` just runs through
- added `matplotlib` to CI requirements to avoid `pyright` from throwing an error ?
- going back to the start for tests after `mypy` also stopped CI correctly
- starting with `black` test
- `black` successfully stopped the CI without customised handling
- `isort` is the next to check without customised handling
- also `isort` stops the CI on failure
- next to check is `pyright`
- reverted GitHub CI to its original working state
@MothNik MothNik added ✍️ documentation Improvements or additions to documentation 💪 enhancement New feature or request ✅❌ tests Everything related to maintaining or improving tests and coverage 💥 breaks old funcionality Changes that break old functionality labels Jul 30, 2024
@MothNik MothNik self-assigned this Jul 30, 2024
Copy link

codecov bot commented Jul 30, 2024

- updated `README` with new CI commands
- Hermite functions now support all kinds of real numeric scalars/Arrays as `x`-values, integer scalars as `n`-values, and real numeric scalars for `alpha` and `x_center` after making the input validation way more relaxed and smarter

TST:
- test for Hermite function input validation now covers Python and Numpy scalars individually and on top of that also includes Pandas series and Python Arrays
- test for data link to original `x` in Hermite functions now evaluates dynamically whether memory is shared by checking if changes in the copy/view are reflected in the original
- added a completely new test set whether the Hermite functions yield the same results for all different kinds of `x`-values, `n`-values, `alpha`- and `x-center` values
- fixed missing `pandas` dependency for GitHub CI
- fixed type incompatibility that caused `mypy` to crash the GitHub CI
- fixed missing coverage for default and error handling of FFT utility functions
- arranged legend of plot for special points of Hermite functions in a better position
Copy link
Owner Author

@MothNik MothNik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on top of CI checks

- removed unnecessary list parametrization for orthonormality test of Hermite functions
@MothNik MothNik changed the title [13-1, 14] Change definition of scaling factor alpha and add center and approximations for Hermite functions [13-1, 14] Change definition of scaling factor alpha , add center and approximations for Hermite functions, add Fourier transform utility functions Jul 30, 2024
@MothNik MothNik merged commit 3c663ba into main Jul 30, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 breaks old funcionality Changes that break old functionality ✍️ documentation Improvements or additions to documentation 💪 enhancement New feature or request ✅❌ tests Everything related to maintaining or improving tests and coverage
Projects
None yet
1 participant