Skip to content

Releases: rethinkpriorities/squigglepy

v0.28

20 Aug 00:08
Compare
Choose a tag to compare

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

22 Oct 19:22
Compare
Choose a tag to compare

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

06 Jun 20:35
Compare
Choose a tag to compare

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

24 May 12:23
Compare
Choose a tag to compare

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

06 Mar 23:56
Compare
Choose a tag to compare

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

27 Feb 22:02
Compare
Choose a tag to compare

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

01 Feb 00:08
Compare
Choose a tag to compare

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

11 Jan 00:57
Compare
Choose a tag to compare

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.

v0.20

04 Jan 23:34
Compare
Choose a tag to compare

v0.20

  • Fixes how package dependencies are handled in setup.py an specifies Python >= 3.7 must be used. This should fix install errors.

v0.19

04 Jan 19:19
Compare
Choose a tag to compare

v0.19

Bugfixes

  • Fixes a bug where lclip and/or rclip on mixture distribution were not working correctly.
  • Fixes a bug where dist_fn did not work with np.vectorize functions.
  • Fixes a bug where in-memory caching was invoked for bayesnet when not desired.

Caching and Multicore

  • [Breaking change] bayesnet caching is now based on binary files instead of pickle files (uses msgspec as the underlying library).
  • [Breaking change] sample caching is now based on numpy files instead of pickle files.
  • A cache can now be loaded via sample(load_cache=cachefile) or bayesnet(load_cache=cachefile), without needing to pass the distribution / function.
  • bayesnet and sample now take an argument cores (default 1). If greater than 1, will run the calculations on multiple cores using the pathos package.

Other

  • Functions that take weights now can instead take a parameter relative_weights where waits are automatically normalized to sum to 1 (instead of erroring, which is still the behavior if using weights).
  • Verbose output for bayesnet and sample is now clearer (and slightly more verbose).