Individuals inheritance fix
Created by: MorrisNein
These changes elaborate the PR #700.
- Python objects change list:
-
Individual
andParentOperator
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
andgraph
ofIndividual
now can be updated only once - during its evaluation; -
Individual
has a new attribute callednative_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
andParentOperator.parent_individuals
are now tuples; - Side change: Moved
SingletonMeta
fromfedot.core.log
tofedot.core.utilities.singleton_meta
- Bug fix:
OptNode
now acceptscontent
withparams
, not replacing parameters with default stub. - Minor:
ind
argument ofmutate()
now has explicit nameindividual
; - Minor: many typing fixes.
-
OptHitsory
serialization change list:
- Serialized
OptHistory
now has an attribute calledindividuals_pool
. It contains all unique individuals from the history; - In history JSON,
individuals
andarchive_history
now contain only uids that point to the elements ofindividuals_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.