ICRAR / daliuge

The DALiuGE Execution Engine
GNU Lesser General Public License v2.1
24 stars 7 forks source link

LIU-404: Remove "keys" and "groups" from LG/LGNode classes #280

Open myxie opened 2 weeks ago

myxie commented 2 weeks ago

Issue

This address LIU-404, which is triggered by EAGLE-1269 and removes the "keys" and "groups" from the translator.

Solution

Rather than fixing a specific problem, I have just changed the references from "key" to "id" and "group" to "parentId".

The other main changes have been updating all of the dropmake test files, and also modifying the test_pg_gen.py tests to more effectively test the graph structure, which should improve our regression testing capabilities moving forward.

Summary by Sourcery

Standardize node identification by replacing 'key' with 'id' and 'group' with 'parentId' across the translator. Update test files and modify tests to improve regression testing capabilities and ensure consistency in graph structures. Enhance the PGT class to track links and verify the correct number of nodes and edges in logical graphs and PGT DAGs.

Enhancements:

Tests:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request implements changes to the DALiuGE translator, primarily focusing on updating the graph structure representation. The main change is replacing the use of 'key' with 'id' for node identification, and 'group' with 'parentId' for hierarchical relationships. This change affects multiple files across the project, including core functionality, tests, and JSON representations of graphs.

File-Level Changes

Change Details Files
Replace 'key' with 'id' for node identification
  • Update node creation and access to use 'id' instead of 'key'
  • Modify JSON representations to use 'id' field
  • Update test cases to reflect the new 'id' usage
daliuge-translator/dlg/dropmake/dm_utils.py
daliuge-translator/test/dropmake/test_pg_gen.py
daliuge-translator/dlg/dropmake/lg_node.py
Replace 'group' with 'parentId' for hierarchical relationships
  • Update node hierarchy checks to use 'parentId'
  • Modify JSON representations to use 'parentId' field
  • Update test cases to reflect the new 'parentId' usage
daliuge-translator/dlg/dropmake/dm_utils.py
daliuge-translator/test/dropmake/test_pg_gen.py
daliuge-translator/dlg/dropmake/lg_node.py
Update JSON representations of graphs
  • Modify existing JSON files to use new 'id' and 'parentId' fields
  • Update the structure of JSON files for better readability
daliuge-translator/test/dropmake/pg_spec/cont_img_mvp.json
daliuge-translator/test/dropmake/pg_spec/eagle_gather_simple_update.json
daliuge-translator/test/dropmake/pg_spec/eagle_gather_update.json
daliuge-translator/test/dropmake/pg_spec/eagle_gather_empty_update.json
daliuge-translator/test/dropmake/pg_spec/chiles_simple.json
daliuge-translator/test/dropmake/pg_spec/test_grpby_gather.json
daliuge-translator/test/dropmake/pg_spec/testLoop.json
daliuge-translator/test/dropmake/pg_spec/SharedMemoryTest_update.json
daliuge-translator/test/dropmake/pg_spec/Plasma_test.json
daliuge-translator/test/dropmake/pg_spec/HelloWorld_simple.json
Refactor test cases to accommodate new graph structure
  • Update expected values in tests to use new 'id' and 'parentId' fields
  • Modify test logic to work with the updated graph structure
  • Add new tests to verify the correct implementation of 'id' and 'parentId'
daliuge-translator/test/dropmake/test_pg_gen.py
daliuge-translator/test/dropmake/test_dm_utils.py
daliuge-translator/test/reproducibility/test_scatter_blockdag.py
Update graph manipulation and traversal logic
  • Modify functions that build or traverse the graph to use 'id' and 'parentId'
  • Update graph-related utility functions to work with the new structure
daliuge-translator/dlg/dropmake/dm_utils.py
daliuge-translator/dlg/dropmake/pgt.py
daliuge-common/dlg/common/reproducibility/reproducibility.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.