Kalepy

Latest version: v1.4.3

Safety actively analyzes 627119 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.3.2

- `reflect` arguments: `True` can now be given (single value, or for a particular parameter/dimension), in which case the KDE will guess the reflection points based on the data extrema (in all dimensions, or only the target ones). This happens in `kernels._check_reflect`.
- General bug fixes.
- Improve kwarg handling in plotting.

- API
- `kalepy.density()`
- BUG: fixed issue in 'grid' mode where output points didn't match values in shape.
- Add `grid` kwarg.

- `kalepy/`
- `kernels.py`
- `_check_reflect()`
- Added boolean functionality for `reflect` arguments, which are then replaced with data extrema as needed.
- `plot.py`
- General bug fixes, improvements in kwarg handling.
- Return `handles` from plotting functions to allow for legends.
- `utils.py`
- New methods for checking / handling jagged arrays (`flatten()`, `flatlen()`, `isjagged()` and `jshape`)

- `notebooks/`
- `api.ipynb` [NEW-FILE]
- New notebook for running API tests.

- `gen_readme.py` [NEW-FILE]
- Script to automatically assemble the `README.md` file based on an input template `_README.md` and the jupyter notebook `demo.ipynb`. Automatically takes care of image files, and updating them with git.
- `README.md`
- Updated (using `gen_readme.py`) to include new, cleaner examples (primarily using top-level API).

0.3.1

- Improved how 'edges' (both for bins and PDF evaluation) are constructed, especially in multiple dimensions. `KDE` constructs extrema from the given data and then calls `utils.parse_edges`.

- `kalepy/`
- `__init__.py`
- `corner()` [NEW-METHOD]
- New top-level API method for constructing corner plots using either a dataset or KDE instance.
- `density()` [NEW-METHOD]
- Interface to `KDE.density()`
- `resample()` [NEW-METHOD]
- Interface to `KDE.resample()`
- `kde.py` <== `kde_base.py` [RENAME]
- Improved how 'edges' are constructed. Constructs `extrema` based on input data, and uses `utils.parse_edges` to construct edges.
- `_guess_edges()` [REMOVED]
- `KDE`
- `density()` [NEW-METHOD]
- Calculate density using KDE, where 'density' can either be number density or probability density (i.e. 'pdf').
- `pdf()`
- Now calls `density()` using `probability=True`.
- `kernels.py`
- `plot.py`
- Methods for constructing "corner" plots (based strongly on Dan Foreman-Mackey's `corner` package).
- `Corner`
- Class for managing corner plots and plotting scatter data or KDE PDFs.

- `corner_data()`
- Higher-level function for constructing a full corner plot given scatter-data.
- `draw_carpet()` <== `draw_carpet_fuzz()` [RENAME]
- Add `rotate` argument to plot vertically instead of horizontally.
- `hist()` [NEW-METHOD]
- Calculate histogram using `utils.histogram()`, then draw it using `_draw_hist1d()`.
- `utils()`
- Add `positive` argument to filter by positive definite values.
- `_get_smap()` <== `smap()` [RENAME]
- Add `log` argument to specify log-scaling.
- `utils.py`
- `histogram()` [NEW-METHOD]
- Calculate histograms with both `density` and `probability` parameters (instead of combined like in numpy).
- `parse_edges()`
- Allow `weights` to be passed for calculating effective number of data points and inter-quartile ranges
- `quantiles()` <== `percentiles()`
- `stats()` [NEW-METHOD]
- Combines `array_str()` and `stats_str()` output.
- `_get_edges_1d()`
- BUG: avoid negative bin-width for very small number of data points.

- `notebooks/`
- `plotting.ipynb` [NEW-FILE]
- For testing and demonstration of plotting methods, especially corner plots.
- `kde.ipynb`
- Add corner plots using the `corner.py` submodule.

- `convert_notebook_tests.py` <== `build_notebook_tests.py` [RENAME]

0.3.0

- Started working on cleaning up the API (i.e. outward visible functions and structures).
- New API Functions: `kalepy.pdf()`, `kalepy.cdf()`
- Cleanup variable naming conventions in KDE and Kernels.

- BUG: calculating PDF with `params` given would often result in an error from bad checking of edges/grid shapes.

- `kalepy/`
- `__init__.py`
- `pdf()` [NEW-METHOD]
- Convenience / API Method for constructing a quick PDF based on the given data.
- `cdf()` [NEW-METHOD]
- Convenience / API Method for constructing a quick CDF based on the given data.
- `kde_base.py`
- `KDE`
- BUG: when providing a scalar value for bandwidth, it was still being multiplied by the data covariance (as is needed for Scott and Silverman rules). If scalar value(s) are provided do not rescale by covariance.
- `cdf()` [NEW-METHOD]
- Calculate the CDF by integrating the KDE-derived CDF. This could be done much better.
- Seems to be working based on simple tests in 1D and 2D.
- `plot.py` [NEW-FILE]
- Plotting related functionality; not imported by default - primarily for internal usage.
- `align_axes_loc()` [NEW-METHOD]
- Align a twin axes to a particular location of the base axes.
- `draw_carpet_fuzz()` [NEW-METHOD]
- Draw a fuzz-style carpet plot
- `nbshow()` [moved from `utils.py`]
- `save_fig()` [moved from `utils.py`]
- `smap()` [NEW-METHOD]
- Construct a ScalarMappable object (with colormap and normalization) for plotting.
- `Plot_Control` [moved from `utils.py`]
- `utils.py`
- Moved plotted related methods to `plot.py`
- `assert_true()` [NEW-METHOD]
- Internal testing method.
- `bins()`
- Added some docstrings
- `cumsum()` [NEW-METHOD]
- Calculate cumulative sums along either a single axis, or all axes (unlike `numpy.cumsum`)
- `cumtrapz()`
- Added docstrings
- `really1d()` [NEW-METHOD]
- Check if the given array is really one-dimensional (as opposed to a jagged array)
- `run_if()`
- Add `otherwise` argument for functions to run when negation
- Applies to all `run_if_*` methods.
- `spacing()`
- BUG: convert `num` to integer before usage.
- `tests/`
- `test_utils.py`
- Added tests for `cumsum()`
- `notebooks/`
- Update and use the `init.ipy` for the initialization cell of each notebook. Default save plots/files to notebooks/output

0.2.4

- `Triweight` kernel temporarily disabled as it's having normalization problems in ND > 1.

- `kalepy/`
- `kde_base.py`
- `class KDE`
- Addition (uncaught) keyword-arguments are passed from `KDE` initialization to `Kernel` initialization, so that additional arguments (e.g. `chunk`) can be passed along.
- `kernels.py`
- BUG: `Triweight` kernel is not working --> disabled kernel.
- `class Kernel`
- Implemented 'chunking' for resampling calculation. Currently only reflection.
- This produces an *extreme* memory and time performance increase. For certain parameters, empirically a chunk size of ~ 1e5 seems to work best.
- `resample()`
- BUG: non-integer values of `size` would result in an error.
- `class Distribution`
- Significant improvements to the way CDFs are handled.
- `ppf()` [new-function]
- "Percent point function" the inverse of the CDF (returns quantiles given cumulative-probabilities).
- `utils.py`
- `bound_indices()`
- BUG: error in boolean logic.
- `check_path()` [new-function]
- Create the given path if it does not already exist.
- `cumtrapz()` [new-function]
- Cumulative summation using the trapezoid-rule. Light wrapper around the `trapz_dens_to_mass()` function.
- `modify_exists()` [new-function]
- Modify the given filename if it already exists.
- `run_if()` [new-function]
- New functions for running passed methods if the current environment is the target environment.
- `save_fig()` [new-function]
- Save a `matplotlib` figure adding convenience features.
- `docs/`
- `logo/`
- Logo associated data files.
- `notebooks/`
- `performance.ipynb` [new-file]
- New notebook for performance checks, comparisons and diagnostics.

0.2.3

- Added code producing a `kalepy` logo, which is added to the attached media and README file.
- Updated notebooks to fix a few minor errors.

0.2.2

- Significant improvement in memory and speed while resampling with reflecting boundaries by implementing chunking.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.