-
Peter authored
These changes elaborate the PR #700. 1. Python objects change list: * `Individual` and `ParentOperator` classes are now frozen data classes; * Every uid now normally exists in a single Individual object. This is a soft restriction, though, and any violation will be noticed with warning; * `fitness` and `graph` of `Individual` now can be updated only once - during its evaluation; * `Individual` has a new attribute called `native_generation`. It points to the number of generation in which the individual is obtained; * `parent_operators` of individuals are not cleaned in every generation any more; * `Individual.parent_operators` and `ParentOperator.parent_individuals` are now tuples; * Side change: Moved `SingletonMeta` from `fedot.core.log` to `fedot.core.utilities.singleton_meta` * Bug fix: `OptNode` now accepts `content` with `params`, not replacing parameters with default stub. * Minor: `ind` argument of `mutate()` now has explicit name `individual`; * Minor: many typing fixes. 2. `OptHitsory` serialization change list: * Serialized `OptHistory` now has an attribute called `individuals_pool`. It contains all unique individuals from the history; * In history JSON, `individuals` and `archive_history` now contain only uids that point to the elements of `individuals_pool`; * Any intermediate parent, that is not represented in any generation, is placed to `individuals_pool`. Its children point to it via its uid; * As a bonus, newly-saved history JSONs now take much less size (about 10+ times lesser); * All individuals not found in loaded histories now are re-created with the same uid. Their metadata contains an explicit message explaining that they are missing; * Added support for relatively recent histories; * Improved `OptHistory` tests to guarantee stability and backward compatibility; * Updated the histories stored in Git repo.
751bf701