Merge pull request #3709 from RosettaCommons/jadolfbr/jd3_updates
JD3 Simplification/Refactor
Code Changes:
=====
- Code templates have been added for common JD3 classes.
- Transferred `StandardInnerLarvalJob`s use of `prelim_job_node` as` job_node` into the `InnerLarvalJob`. Since the ILJ is passed with the LarvalJob, this makes every function in the SJQ easier to use as you know which job_node you have - and this is not limited to `PreliminaryLarvalJobs`.
- - This makes the StandardInnerLarvalJob obsolete as that was the only extra thing about it. It has been removed and classes refactored to call the InnerLarvalJob.
- Moved `PreliminaryLarvalJob` to its own file in `jd3/standard`, changed it to a struct as per conventions, as everything was public.
- Added the `PreliminaryLarvalJobTracker`, which the SJQ now uses to track the progress of the PJNs. This is a full class, with private data and initialization methods and is in `jd3/standard`
- Added the `JobTracker` class. This class tracks completed and assigned jobs in the SJQ. This JobTracker is now updated by the JQ base class - through a wrapper/decorator function that is called by the JD. This means that SJQ developers can be ensured that the `JobTracker` is up to date and they are not responsible for updating it. Protected accessor methods have been added.
- The JQ now holds an OP to the `JobDigraph`. This OP is stored during the JQs version of `initial_job_digraph`, which is a wrapper/decorator to derived class functions - ensuring that the SJQ developer is not responsible for setting it, and protected accessor methods have been added.
- `JobNode `now has an optional variable, job_label - this is to better delineate how jobs are constructed. We can now ask the `JobDigraph` which job_label a particular job_node is for - IE this is useful for multiple stages, such as if all Prelim jobs undergo some stage 1, and all jobs from global index i -> j undergo job_type "2". This reduces the amount of logging needed so we do not have to track all the global index ranges to simply start a job of some type.
- `EnergyJobSummary` is now in its own file, and the **4?** places where it was copied have been removed!
- Add a new `StandardPoseJobSummary`, which is a JobSummary that extracts the Energy and SimpleMetricData from a pose. This should cover Most data needed for a summary ;)
- `MoverAndPoseJob` has now been changed to `MoverJob`. The `pose` part of the job is inferred - no need to add that to the name. The `MoverJob` has been expanded to use the `StandardPoseJobSummary` and run a set of optional simple metrics on the final pose before returning the `PoseJobResult` and `StandardPoseJobSummary` pair. MoverJob is now aware of a SequenceMover to make it easier to either set a mover or add movers (which is extremely common).
- `InputSource` pose_id variable and function are now source_id to go with the more generalized interface.
General SJQ Edits
=============
- The SJQ header interface is completely re-organized to have typical derived functions at the top, and mainly unused/specialized functions at the bottom.
- Move some SJQ function bulk out of the SJQ and into JD3 util files.
- **The number of SJQ private variables has been reduced from 50 members to 32 members** !!
- All function briefs in the SJQ have been updated to separate briefs from details (almost all of it was details before). The descriptions have been updated/simplified where possible, and instructions for override behavior or gotchas have been added.
Tests
====
A full suite of unit tests have been added for the new main classes, the SJQ tests have been updated to fully test the `JobTracker` and the `PreliminaryLarvalJobTracker`.