Merge pull request #3419 from RosettaCommons/jadolfbr/simple_metric_cache
Ok, as per request, this PR addresses #3378 - caching SimpleMetrics.
Major
====
SimpleMetrics are now stored in a new `CacheableData` object: the `SimpleMetricData` object. Thanks to @lyskov 's help, the only classes that can store the data are the SimpleMetrics themselves. Anything is able to 'get' the data.
Data is stored during the `apply()` method that all SimpleMetric bases have defined. In addition, the PerResidueReal/String Metrics also create one of @vmullig 's wonderful reference poses during the apply. By default, when we grab the data, we use the reference pose to make sure the residue numbers we are dealing with match the data.
New functions are given during ScoreFile output to output all this data. This also sets up for a future data file for only Per-Residue metrics, which will be easier to make sense of as it stands now.
A new function has been added into each of the base classes where we can use the cache or calculate the data. This is used by `SimpleMetricFilter` and `SimpleMetricFeatures`. The `RunSimpleMetrics` mover will cache this data.
The function is as follows:
```
core::Real
cached_calculate(
pose::Pose const & pose,
bool use_cache,
std::string prefix="",
std::string suffix="",
bool fail_on_missing_cache=true) const;
```
Minor
====
All SimpleMetrics now have serialization methods associated with them. We can now consider using them in GUIs! Code templates have been updated to reflect this.
`DensityFitResidueSelector` now takes an optional pre-configured `PerResidueDensityFitMetric` and the ability to grab the cached version. This speeds up glycan-benchmarking runtimes by about 4 fold as this is a very expensive calculation.
Tests
====
Unit tests have been updated to reflect the major change to the way `SimpleMetrics` are stored. A suite of unit tests have been added to test fetching from this cache, in addition to tests for EVERY base type of Simple Metrics and their cached-use in the Filter system.
A new integration test for caching Simple Metrics has been added.
The Per Residue integration test has been updated to test and confirm caching of Density fit stuff.
Integration test changes are expected for SimpleMetrics as the final output for composite metrics and per-residue metrics is now different with the new cache system. I think this is better organized anyway, with the composite name being added to the end of the 'score' type.