# Changelog¶

Major changes are listed below. Each release likely contains fiddling with back-end code, updates to latest fwdpp version, etc.

## 0.9.0¶

This release enables custom genetic value models to be implemented in Python. To do so, the back-end for C++ genetic values was changed in a way that (hopefully!) future-proofs the API against future changes. The approach taken to allowing Python genetic value types evolved quite a bit during development, so we won’t refer to individual pull requests here. Anyone interested can look at the 0.9.0 milestone on GitHub.

See here for the documentation on Python genetic values.

## 0.8.0¶

Stable release. In addition to what is in the previous alpha releases:

This release includes some minor API changes. See the upgrade guide for details.

### 0.8.0a1¶

Second alpha release of 0.8.0:

• Update the fwdpp submodule. #529

• Update documentation related to genetic maps. #530

### 0.8.0a0¶

This is the first alpha release of 0.8.0.

In addition to what is below, this release contains a smattering of build system changes, documentation changes, etc., that are collected under the 0.8.0 milestone on Github.

API/UI changes:

This release brings Python classes that have been reimplemented using attrs. These changes have a lot of benefits:

• A lot of C++ code got removed (yay!) because we can use attrs for the pickling machinery, __repr__, etc..

• We now get much nicer __repr__ for all of the types that get sent into instances of fwdpy11.ModelParams.

However, these changes required some simplification to the __init__ methods, which meant some API breakage. See the upgrade guide for details.

This release also removes features deprecated in previous releases. #482

Performance improvements:

• Sorting edge tables prior to tree sequence simplification has been replaced by an efficient buffering algorithm. #526.

New demographic models:

Improved behavior:

Changes to implementation of Python classes

• fwdpy11.ModelParams has been reimplemented using attrs. #484, #486, #487.

• Demographic model types are now implemented using attrs and inherit from the C++ back-end class. #492

• Region types are now implemented using attrs and inherit from the C++ back-end class. #497

• Genetic value types are now implemented using attrs and inherit from the C++ back-end class. #504

• Genetic map unit types are now implemented using attrs and inherit from the C++ back-end class. #506

C++ back end changes:

• The default C++ language standard is now C++14. #517.

• Custom exceptions now have default symbol visibility. #519.

• The back-end code for discrete demography got cleaned up. #521.

• The fwdpp submodule was updated a few times. #489 #523 #525

### 0.7.1¶

Maintenance release and one new feature:

This release include several other improvements to documentation and user interface. All changes are backwards-compatible, and deprecation warnings are issued when necessary. See the 0.7.1 milestone on GitHub for details.

### 0.7.0¶

Major feature release allowing mutations to have different effect sizes in different demes.

Bugs fixed:

• Temporal samplers now get the correct offspring metadata in simulations with tree sequence recording. #444

New features:

Other changes (see the 0.7.0 milestone on GitHub)

• This release deprecates several features that are no longer sensible given that most simulations will use tree sequence recording. You will see warnings pop up if you use these features (or run the unit tests). These features will be removed in 0.8.0.

• Many back-end changes to the C++ code simplify things in various places.

### 0.6.4¶

Fixes a bug where the timing of updates to stateful genetic values was off by one generation:

### 0.6.3¶

Maintenance release.

This release fixes three bugs. The first two are related to internal details of book-keeping various data structures:

Other changes:

• sparse is added to install_requires in setup.py. #421

• fwdpy11.TableCollection’s validation of genome lengths is improved. PR #428

• The C++ base class for a population is now a concrete class rather than a template alias. This change enables forward declarations in header files. PR #427

### 0.6.2¶

This release changes the migration code to model juvenile migration. These changes simplify the back end and give the same results (in distribution). The relevant PRs are:

### 0.6.1¶

This is a maintenance release that clears up a few issues:

### 0.6.0¶

This is a major feature release. The changes include all those listed for the various release candidates (see below) plus the following:

Note

This is the first stable release with support for flexible demographic modeling. See Soft selection with discrete demes for details as well as Isolation-with-migration (IM). Currently, support for different fitness effects in different demes is limited, which will be addressed in 0.7.0. However, this version does support adaptation of quantitative traits to different optima. See Local adaptation of a quantitative trait.

### 0.6.0rc2¶

Third release candidate of version 0.6.0!

Kind of a big release:

• Fixes a bug in the mechanics of generating offspring metadata. The bug doesn’t affect anyone not using custom “genetic value” calculations. #371

• Big reductions in memory requirements for simulations with tree sequence recording. PR #383

• Better defaults for models with migration. PR #376 PR #375 PR #370

• Improvements to the C++ back-end of demographic models PR #379 PR #368 PR #367 PR #366

• Add some pre-computed demographic models, see The demography debugger.

• New examples added: Isolation-with-migration (IM)

• Many improvements/additions to the test suite and the manual.

### 0.6.0rc1¶

This is the same as 0.6.0rc0 except that it is based on a master branch that’s been rebased to have the bug fixes from 0.5.5 included.

### 0.6.0rc0¶

Support for demographic events involving discrete demes. This is a release candidate with minimal documentation beyond the examples (see below).

API changes:

This API change won’t affect anyone because previous versions didn’t support individuals in different demes.

New features:

Miscellaneous changes:

• Improve how tree sequence nodes are retrieved for “alive” individuals during simulation. PR #344

New documentation

Changes to the build system and dependencies:

• Minimum pybind11 version is 2.4.3

• The -Weffc++ flag is now optional during compilation.

### 0.5.5¶

This release fixes a rather serious bug.

The latter is the bad one. For workflows involving simulate, write to file, read in and add neutral mutations, that results may now differ. In practice, we’ve seen few cases where that has happened (1 in about 10,0000 simulations), but the bug was due to not properly populating a lookup table of mutation positions after reading the simulation back in from disk. Thus, there is the chance that the procedure of putting down neutral mutations now differs.

Bug fix release.

### 0.5.3¶

New features:

• Allow neutral mutations during simulations with tree sequences. PR #328

• Add C++ back end and Python classes for discrete demographic events. PR #237

Miscellaneous changes:

• Links in the manual are now validated via CI. PR #331

### 0.5.2¶

The following bugs are fixed:

The following new features are added:

• Allow for preserved samples to be “forgotten” during tree sequence simulations. PR #306. See tstimeseries

Several performance fixes:

• Extinct genomes are purged at the end of simulations with tree sequences. PR #319.

• Improve algorithm to purge extinct variants at the end of a simulation with tree sequences. PR #318.

• fwdpy11.infinite_sites() now returns earlier if possible #293.

• Improve performance of mutation counting with ancient samples PR #289.

### 0.5.1¶

This release fixes three bugs:

• fwdpy11.IndexedEdge is now exposed to Python. Previously, attempting to access fwdpy11.TableCollection.input_left or fwdpy11.TableCollection.output_right would give an error because the class contained in these lists wasn’t visible. PR #266

• fwdpy11.TreeIterator.roots() now returns the array of roots on the current tree. Previously, empty arrays were returned. PR #267

• Corruption of the samples list using the standalone simplify function. PR #270

The following features are new:

### 0.5.0¶

This is an intermediate release as we are still working towards supporting more general demographic models.

Major changes include:

Even though this release changes some of the tree sequence data structures, we are still able to read in files generated by version 0.4.5! (This is actually unit tested.)

Minor changes include:

• fwdpy11.Mutation.g is converted to the mutation’s age when dumping table collections to tskit’s format. PR #257

• New exception types from fwdpp registered as Python exceptions. PR #260

• Several updates to documentation and to continuous integration testing.

### 0.4.4¶

• Reduce time needed to execute unit tests of tree sequence functions.

### 0.4.3¶

• Minor fixes to packaging of source distrubition.

• Add a YCM config file to source repo

• Allow mutation and recombination regions to be empty. PR #239.

### 0.4.2¶

Minor release:

• fwdpy11.VariantIterator may now skip neutral or selected sites during iteration. The behavior is specified by parameters passed to the class upon construction.

### 0.4.1¶

Minor release:

• Added position ranges to tree traversal. PR #232.

• Changed default type for range arguments for VariantIterator and data matrix generation. PR #233.

• Skipping fixations is now optional in fwdpy11.data_matrix_from_tables().

• The C++ back-end for population classes was changed to avoid deleting move constructors. PR #231.

### 0.4.0¶

This is a major refactoring:

• The package is now contained in a single namespace, fwdpy11.

• The MlocusPop concept from previous versions is removed, and fwdpy11.DiploidPopulation is the only population class now.

• Many Python class names are changed to reflect that there is only one population type now.

• The manual has been rewritten.

The details for this release are best tracked via the cards in Project 9 on GitHub.

### 0.3.1¶

Minor bugfix release:

• Preserved nodes are now recorded as samples when table collections are saved to tskit

• The fwdpp submodule is updated to include fixes to some debugging code

• Minor updates to the C++ backend of VariantIterator

### 0.3.0¶

#### Bug fixes¶

• A bug in handling fixations during simulations with tree sequence recording is fixed. This bug is GitHub #200 and the fix is PR #201.

• Updates to the fwdpp submodule fix a bug in fwdpy11.ts.infinite_sites(). Previously, if the genome size was not 1.0, then the number of mutations would be off by a factor of the genome size divided by 1.0. The error was due to a bug upstream in fwdpp.

• A bug in how diploid metadata were updated by genetic value types has been fixed. It is unlikely that this bug affected anyone unless they had written custom genetic value calculations where the offspring’s genetic value depended on the parental metadata. PR #173.

#### Support for multivariate mutational effects¶

PR #164 introduced support for multidimensional mutational effects. This pull request introduced several changes:

The following new types are added:

• fwdpy11.MultivariateGaussianEffects, which is a new “region” type

• fwdpy11.genetic_values.SlocusPopMultivariateGeneticValueWithMapping, which is a new ABC for multivariate genetic values

• fwdpy11.genetic_values.MultivariateGeneticValueToFitnessMap, which is a new ABC mapping multivariate trait values down to a (single) fitness value.

• fwdpy11.genetic_values.MultivariateGSS, which is GSS based on the Euclidean distance from multiple optima

• fwdpy11.genetic_values.MultivariateGSSmo, which is the multi-dimensional analog to the existing GSSmo

• fwdpy11.genetic_values.SlocusMultivariateEffectsStrictAdditive, which is a new genetic value class for pleiotropic traits.

PR #175 adds tracking of genetic values during simulation as numpy arrays via fwdpy11.Population.genetic_values and fwdpy11.Population.ancient_sample_genetic_values. Currently, filling these arrays is only supported for simulations with tree sequence recording.

Changes to the C++ back end:

• The API for the C++ class fwdpy11::SlocusPopGeneticValue was slightly changed in order to accommodate the new types. The old operator() is renamed calculate_gvalue().

• Analogous changes were made to fwdpy11::MlocusPopGeneticValue.

#### Dependency changes¶

• Change minimum GSL version required to 2.3

#### Other changes in this release include¶

It may be helpful to look at the following documentation pages:

Detailed changes:

• Add new function to pickle populations while using less memory. PR #195, PR #201

• Improved performance of simulations tracking lots of ancient samples. PR #194

• Generalized genetic maps for single-locus simulations. You can now do much of the “multi-locus” stuff with SlocusPop now. PR #189

• Tree sequence recording now possible for mulit-locus simulations. PR #185

• fwdpy11.ts.count_mutations() added. PR #183, PR #196, PR #199

• Position and key properties added to fwdpy11.ts.VariantIterator. PR #180 PR #181

• fwdpy11.ts.TreeIterator is added, which provides much faster tree traversal. PR #176, PR #177

• fwdpy11.ts.simplify() no longer retains ancient samples present in the input by default. To do so, explicitly label any ancient samples to retain as part of the the samples list passed to the function. PR #169

• The types fwdpy11.Region and fwdpy11.Sregion have be re-implemented as C++-based classes, replacing the previous pure Python classes. PR #163, PR #174

• fwdpy11.model_params.ModelParams.nregions now defaults to an empty list, which simplifies setup for simulations with tree sequences. b557c41.

• When simulating with tree sequences, it is no longer an error to attempt to record ancient samples from the last generation of a simulation. PR #162

Changes to the C++ back-end include:

• The genetic value types now store a vector of genetic values. The idea is to generalize the type to handle both uni- and multi- variate genetic values. PR #172

### Version 0.2.1¶

This is a point release fixing some minor packaging problems in 0.2.0.

### Version 0.2.0¶

This release represents major changes to the calclations of genetic values and to how simulations are parameterized. Please see Upgrade path, genetic_values_types, and Setting up the parameters for a simulation for details.

The major feature addition is support for tree sequence recording. See Data structures related to tree sequences and ts for details.

#### Warning:¶

This version breaks pickle format compatibility with files generated with version 0.1.4 and earlier. Sorry, but we had to do it.

#### Dependency changes:¶

• GSL >= 2.2 is now required.

• cmake is now required to build the package.

#### Bug fixes:¶

• Fixed bug in fwdpy11.util.sort_gamete_keys(). The function was working on a copy, meaning data were not being modified. PR #93

• Fix a bug in updating a population’s mutation lookup table. This bug was upstream in fwdpp (fwdpp issue 130). While definitely a bug, I could never find a case where simulation outputs were adversely affected. In other words, simulation output remained the same after the fix, due to the rarity of the bug. PR #98

#### API changes/new features:¶

• Added support for tree sequence recording. PR #142

• Populations may now be dumped/loaded to/from files. See fwdpy11.SlocusPop.dump_to_file() and fwdpy11.SlocusPop.load_from_file(). Analagous functions exist for MlocusPop. PR #148

• fwdpy11.SlocusPop.sample() and fwdpy11.MlocusPop.sample() now return a fwdpy11.sampling.DataMatrix. PR #118

• fwdpy11.sampling.DataMatrix is refactored to match updates to fwdpp. PR #139

• fwdpy11.sampling.matrix_to_sample() now return a tuple with the neutral and selected data, respectively, as the two elements. PR #128

• Diploids have been refactored into two separate classes, fwdpy11.DiploidGenotype and fwdpy11.DiploidMetadata. Both classes are valid NumPy dtypes. See processingpopsNP. PR #108

• fwdpy11.model_params.ModelParams is massively simpilfied. There is now only one class! See Setting up the parameters for a simulation. PR #108

• The design of objects related to calculating genetic values is vastly simplified. See genetic_values_types. PR #108

• Populations now contain functions to add mutations, replacing previous functions in fwdpy11.util. PR #94

• fwdpy11.MlocusPop now requires that fwdpy11.MlocusPop.locus_boundaries be initialized upon construction. PR #96

• The mutation position lookup table of a population is now a read-only property. See mpos. PR #103

• The mutation position lookup table is now represented as a dict of lists. PR #121

• A mutation or fixation can now be rapidy found by its “key”. See fwdpy11.Population.find_mutation_by_key() and fwdpy11.Population.find_fixation_by_key(). PR #106

#### Back-end changes¶

• The build system now uses cmake. PR #151 and #152

• Most uses of C’s assert macro are replaced with c++ exceptions. PR #141

• The C++ back-end of classes no longer contain any Python objects. PR #114

• PR #108 changes the back-end for representing diploids and for calculating genetic values.

• PR #98 changes the definition of the populaton lookup table, using the same model as fwdpp PR #132

• Refactored class hierarchy for populations. :pr85

• Updated to the fwdpp 0.6.x API and cleanup various messes that resulted. PR #76, PR #84, PR #90, PR #109, PR #110

• The position of extinct variants is set to the max value of a C++ double. PR #105

• An entirely new mutation type was introduced on the C++ side. It is API compatible with the previous type (fwdpp’s “popgenmut”), but has extra fields for extra flexibility. PR #77, PR #88

• Replaced std::bind with lambda closures for callbacks. PR #80

• Fast exposure to raw C++ buffers improved for population objects. PR #89

• Refactored long unit tests. PR #91

• The GSL error handler is now turned off when fwdpy11 is imported and replaced with a custom handler to propagate GSL errors to C++ exceptions. PR #140

• Population mutation position lookup table changed to an unordered multimap. PR #102

• When a mutation is fixed or lost, its position is now set to the max value of a C++ double. This change gets rid of some UI oddities when tracking mutations over time. PR #106 and this 96e8b6e.

### Version 0.1.4¶

#### Bug fixes:¶

• A bug affecting retrieval of multi-locus diploid key data as a buffer for numpy arrays is now fixed. PR #72

• fwdpy11.SingleLocusDiploid.label is now pickled. PR #34

#### API changes/new features:¶

• Population objects have new member functions sample and sample_ind. These replace fwdpy11.sampling.sample_separate(), which is now deprecated. For example, see sample() for more info. (The same member functions exist for all population objects.) PR #62

• Improved support for pickling lower-level types. See the unit test file tests/test_pickling.py for examples of directly pickling things like mutations and containers of mutations. PR #55

• __main__.py added. The main use is to help writing python modules based on fwdpy11. See developers for details. PR #54

• Attributes popdata and popdata_user added to all population objects. PR #52

• fwdpy11.SingleLocusDiploid.parental_data added as read-only field. PR #51

• fwdpy11.MlocusPop.locus_boundaries is now writeable.

• fwdpy11.sampling.DataMatrix.neutral and fwdpy11.sampling.DataMatrix.selected are now writeable buffers. fwdpy11.sampling.DataMatrix.ndim_neutral and fwdpy11.sampling.DataMatrix.ndim_selected have been changed from functions to read-only properties. PR #45

• The ‘label’ field of fwdpy11.Region (and fwdpy11.Sregion) now populate the label field of a mutation. PR #32 See tests/test_mutation_labels.py for an example.

• Population objects may now be constructed programatically. See popobjects. PR #36

#### Back-end changes¶

• The numpy dtype for fwdpy11.Mutation has been refactored so that it generates tuples useable to construct object instances. This PR also removes some helper functions in favor of C++11 uniform initialization for these dtypes. PR #72

• The documentation building process is greatly streamlined. PR #60

• Object namespaces have been refactored. The big effect is to streamline the manual. PR #59

• Travis CI now tests several Python versions using GCC 6 on Linux. PR #44

• fwdpy11.wright_fisher_qtrait.evolve() has been updated to allow “standard popgen” models of multi-locus evolution. This change is a stepping stone to a future global simplification of the API. PR #42

• The fwdpy11.Sregion now store their callback data differently. The result is a type that can be pickled in Python 3.6. PR #39

• Travis builds are now Linux only and test many Python/GCC combos. PR #38

• Update to fwdpp_ 0.5.7 PR #35

• The method to keep fixations sorted has been updated so that the sorting is by position and fixation time. PR #33

• The doctests are now run on Travis. PR #30

• Removed all uses of placement new in favor of pybind11::pickle. PR #26.

• fwdpy11 are now based on the @property/@foo.setter idiom for safety and code reuse. PR #21

### Version 0.1.3¶

#### API changes/new features:¶

• fwdpy11.Sregion may now model distrubitions of effect sizes on scales other than the effect size itself. A scaling parameter allows the DFE to be functions of N, 2N, 4N, etc. [PR #16] * Github issues 7, 8, and 9 resolved. All are relatively minor usability tweaks.

• fwdpy11.util.change_effect_size() added, allowing the “s” and “h” fields of fwdpy11.Mutation to be changed. ba4841e.

• The attributes of fwdpy11.Mutation are now read-only, addressing #5 on GitHub. f376d40

• Trait-to-fitness mapping functions for quantitative trait simulations now take the entire population, rather than just the generation. This allows us to model things like truncation selection, etc. fa37cb8

#### Back-end changes¶

• Code base updated to work with pybind11 2.2.0. [PR #19]

• fwdpy11.model_params has been refactored, addressing #4. The new code base is more idiomatic w.r.to Python’s OO methods. 1b811c3

• Many of the C++-based types can now be pickled, making model parameter objects easier to serialize. Most of the changes are in d0a3602. This mostly addresses #3

• Added magic numbers to keep track of compatibility changes to serialization formats.

• __str__ changed to __repr__ for region types 2df859d

• fwdpy11.model_params now uses try/except rather than isinstance to check that rates are float-like types. 37112a6

### Version 0.1.2¶

#### Bug fixes:¶

• Fixed bug in setting the number of loci after deserializing a multi-locus population object. 4e4a547

#### API and back-end changes:¶

• The C++ data structures are connected to NumPy via Python buffer protocol. See processingpopsNP. 48e3925

• fwdpy11.sampling.separate_samples_by_loci() changed to take a list of positions as first argument, and not a population object.

### Version 0.1.1¶

#### Bug fixes:¶

• Fixed bug in fwdpy11.sampling.DataMatrix.selected() that returned wrong data in best case scenario and could have caused crash in worst case. e715fb7.

• Fix bug recording fixation times. If a population was evolved multiple times, fixation times from the later rounds of evolution were incorrect. 9db14d8

• Fix #1, related to fixations in quantitative trait sims. 6a27386

• The “label” field of a diploid is now initialized upon constructing a population.

#### API and back-end changes:¶

• Added fwdpy11.sampling.matrix_to_sample() and fwdpy11.sampling.separate_samples_by_loci(). 639c8de

• Custom stateless fitness/genetic value calculations may now be implemented with a minimal amount of C++ code. See customgvalues. a75166d

• Custom fitness/genetic value calculations now allowed in pure Python, but they are quite slow (for now). See customgvalues. 5549286

• Stateful trait value models enabled for qtrait sims. 161dfce

• Refactor evolution functions so that stateful fitness models behave as expected. Enable compiling in a debug mode. Fix bug in operator== for diploid type. a726c05

• fwdpy11.util added, providing fwdpy11.util.add_mutation(). 17b92db

• Simulations now parameterized using classes in fwdpy11.model_params. 18e261c and eda7390

• Refactoring of type names. 632477c

• Refactoring internals of single-region fitness/trait value types. d55d636

• Allow selected mutations to be retained in fwdpy11.wright_fisher.evolve_regions_sampler_fitness. dcc1f2f

Note: the refactoring of type names will break scripts based on earlier versions. Sorry, but things are rapidly changing here. Please note that you can reassign class and function names in Python, allowing quick hacks to preserve compatibility:

import fwdpy11

Spop = fwdpy11.SlocusPop


Alternately:

from fwdpy11 import SlocusPop as Spop