Skip to content

Releases: peterhurford/squigglepy

0.30

Choose a tag to compare

@peterhurford peterhurford released this 08 Jun 14:18
  • [Breaking change] Adds support for Python 3.13 and 3.14, drops support for Python 3.9 and 3.10.
  • [Breaking change] Removed roll_die and flip_coin functions. Use sq.die(sides) @ n or ~sq.coin() instead.
  • Integration test timing checks no longer warn when a test runs faster than its baseline — only slower-than-baseline deviations are flagged.
  • Added die(sides, explode_on=None) and coin() as distribution objects for dice and coins. These support all distribution operations like ~, @, +, -, etc. The die distribution also supports "exploding dice" mechanics via the explode_on parameter.
  • Added dirichlet(alpha) distribution, a multivariate generalization of the beta distribution that samples a probability vector summing to 1.
  • Added documentation for model functions and sq.sample in README.
  • Uses prettier tqdm output that is now aware of Jupyter notebooks.
  • bayes.update now supports lognorm and gamma distributions in addition to norm and beta.
  • Allow zero_inflated to accept 0 or 1 as probabilities.

v0.29

Choose a tag to compare

@peterhurford peterhurford released this 21 Apr 11:07
  • Fixes a bug where max_gain and modeled_gain were incorrect in kelly output.
  • Fixes a bug where error was not correctly passed from half_kelly, third_kelly, and quarter_kelly.
  • Added invlognorm as a new distribution.
  • Added bucket_percentages to more easily get the percentage of values within a bucket.
  • Added third_kelly as an alias for kelly with deference = 0.66. (TODO: Fix tests)
  • Allows Bernoulli distributions to be defined with p=0 or p=1
  • Added a Makefile to help simplify testing and linting workflows

v0.28

Choose a tag to compare

@peterhurford peterhurford released this 20 Aug 00:08

v0.28

  • [Breaking change] sq.pareto previously sampled from a Lomax distribution due to a complication with numpy. Now it properly samples from a Pareto distribution.
  • [Breaking change] lclip / rclip have been removed from triangular distribution because that doesn't make sense.
  • [Breaking change] You now can nest mixture and discrete distributions within mixture distributions.
  • [Breaking change] sq.kelly now raises an error if you put in a price below the market price. You can pass error=False to disable this and return to the old behavior.
  • Added pert distribution.
  • Added sharpe_ratio to utilities.
  • get_percentiles, get_log_percentiles, get_mean_and_ci, and get_median_and_ci now can all take an optional weights parameter to do a weighted version.

v0.27

Choose a tag to compare

@peterhurford peterhurford released this 22 Oct 19:22

v0.27

  • [Breaking change] This package now only supports Python 3.9 and higher.
  • [Breaking change] get_percentiles and get_log_percentiles now always return a dictionary, even if there's only one element.
  • [Breaking change] .type is now removed from distribution objects.
  • [Breaking change] You now can nest mixture distributions within mixture distributoins.
  • You can now create correlated variables using sq.correlate.
  • Added geometric distribution.
  • Distribution objects now have the version of squigglepy they were created with, which can be accessed via obj._version. This should be helpful for debugging and noticing stale objects, especially when squigglepy distributions are stored in caches.
  • Distributions can now be hashed with hash.
  • Fixed a bug where tdist would not return multiple samples if defined with t alone.
  • Package load time is now ~2x faster.
  • Mixture sampling is now ~2x faster.
  • Pandas and matplotlib as removed as required dependencies, but their related features are lazily enabled when the modules are available. These packages are still available for install as extras, installable with pip install squigglepy[plots] (for plotting-related functionality, matplotlib for now), pip install squigglepy[ecosystem] (for pandas, and in the future other related packages), or pip install squigglepy[all] (for all extras).
  • Multicore distribution now does extra checks to avoid crashing from race conditions.
  • Using black now for formatting.
  • Switched from flake8 to ruff.

v0.26

Choose a tag to compare

@peterhurford peterhurford released this 06 Jun 20:35

v0.26

  • lognorm can now be defined either referencing the mean and sd of the underlying normal distribution via norm_mean / norm_sd or via the mean and sd of the lognormal distribution itself via lognorm_mean / lognorm_sd. To further disambiguate, mean and sd are no longer variables that can be passed to lognorm.

v0.25

Choose a tag to compare

@peterhurford peterhurford released this 24 May 12:23

v0.25

  • Added plot as a method to more easily plot distributions.
  • Added dist_log and dist_exp operators on distributions.
  • Added growth_rate_to_doubling_time and doubling_time_to_growth_rate convenience functions. These take numbers, numpy arrays or distributions.
  • Mixture distributions now print with weights in addition to distributions.
  • Changes get_log_percentiles to report in scientific notation.
  • bayes now supports separate arguments for memcache_load and memcache_save to better customize how memcache behavior works. memcache remains a parameter that sets both memcache_load and memcache_save to True.

v0.24

Choose a tag to compare

@peterhurford peterhurford released this 06 Mar 23:56

v0.24

  • Distributions can now be negated with - (e.g., -lognorm(0.1, 1)).
  • Numpy ints and floats can now be used for determining the number of samples.
  • Fixed some typos in the documentation.

v0.23

Choose a tag to compare

@peterhurford peterhurford released this 27 Feb 22:02

v0.23

  • Added pareto distribution.
  • Added get_median_and_ci to return the median and a given confidence interval for data.
  • discrete and mixture distributions now give more detail when printed.
  • Fixed some typos in the documentation.

v0.22

Choose a tag to compare

@peterhurford peterhurford released this 01 Feb 00:08

v0.22

  • Added extremize to extremize predictions.
  • Added normalize to normalize a list of numbers to sum to 1.
  • Added get_mean_and_ci to return the mean and a given confidence interval for data.
  • Added is_dist to determine if an object is a Squigglepy distribution.
  • Added is_sampleable to determine if an object can be sampled using sample.
  • Support for working within Pandas is now explicitly added. pandas has been added as a requirement.
  • discrete sampling now will compress a large array if possible for more efficient sampling.
  • clip, lclip, and rclip can now be used without needing distributions.
  • Some functions (e.g, geomean) previously only supported lists, dictionaries, and numpy arrays. They have been expanded to support all iterables.
  • dist_max and dist_min now support pipes (>>)
  • get_percentiles now coerces output to integer if digits is less than or equal to 0, instead of just exactly 0.

v0.21

Choose a tag to compare

@peterhurford peterhurford released this 11 Jan 00:57

v0.21

  • Mixture sampling is now 4-23x faster.
  • You can now get the version of squigglepy via sq.__version__.
  • Fixes a bug where the tqdm was displayed with the incorrect count when collecting cores during a multicore sample.