Releases: rethinkpriorities/squigglepy
Releases · rethinkpriorities/squigglepy
v0.28
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 passerror=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
, andget_median_and_ci
now can all take an optionalweights
parameter to do a weighted version.
v0.27
v0.27
- [Breaking change] This package now only supports Python 3.9 and higher.
- [Breaking change]
get_percentiles
andget_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 witht
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), orpip 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
toruff
.
v0.26
v0.26
lognorm
can now be defined either referencing the mean and sd of the underlying normal distribution vianorm_mean
/norm_sd
or via the mean and sd of the lognormal distribution itself vialognorm_mean
/lognorm_sd
. To further disambiguate,mean
andsd
are no longer variables that can be passed tolognorm
.
v0.25
v0.25
- Added
plot
as a method to more easily plot distributions. - Added
dist_log
anddist_exp
operators on distributions. - Added
growth_rate_to_doubling_time
anddoubling_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 formemcache_load
andmemcache_save
to better customize how memcache behavior works.memcache
remains a parameter that sets bothmemcache_load
andmemcache_save
to True.
v0.24
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
v0.23
- Added
pareto
distribution. - Added
get_median_and_ci
to return the median and a given confidence interval for data. discrete
andmixture
distributions now give more detail when printed.- Fixed some typos in the documentation.
v0.22
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 usingsample
. - 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
, andrclip
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
anddist_min
now support pipes (>>
)get_percentiles
now coerces output to integer ifdigits
is less than or equal to 0, instead of just exactly 0.
v0.21
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
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
v0.19
Bugfixes
- Fixes a bug where
lclip
and/orrclip
onmixture
distribution were not working correctly. - Fixes a bug where
dist_fn
did not work withnp.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 (usesmsgspec
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)
orbayesnet(load_cache=cachefile)
, without needing to pass the distribution / function. bayesnet
andsample
now take an argumentcores
(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 parameterrelative_weights
where waits are automatically normalized to sum to 1 (instead of erroring, which is still the behavior if usingweights
). - Verbose output for
bayesnet
andsample
is now clearer (and slightly more verbose).