Closed SajidAlamQB closed 3 weeks ago
Hey @SajidAlamQB , thanks for the PR and for taking the time to walk me through your changes earlier. The new structure looks great and is quite easy to follow. I do have a few observations that took me a bit to fully understand. It seems there are foundational classes, or base classes, that other node classes (like TaskNode) inherit from, such as
GraphNodeMetadata
andNodeGraph
. I was thinking it might make sense to introduce abase.py
file to separate these foundational classes from their derived ones.This approach could bring a few benefits:
- Separation of Concerns: Clearly distinguishing base classes from the other classes that inherit improves clarity around what’s foundational versus specialized.
- Readability and Maintainability: It would make it easier to locate and understand the main functionality provided by the base classes.
@rashidakanchwala Do you think this structure would work with our codebase? My knowledge with the back-end is somewhat limited, so please let me know if this approach wouldn’t be a good fit for our application.
Hey @Huong, thanks for sharing your thoughts! I agree that separating foundational classes can sometimes enhance readability, but for now, I think our current setup works well.
Since GraphNodes is in nodes.py along with its children classes and GraphNodeMetadata is in nodes_metadata.py with all NodeMetadata subclasses, this structure already keeps related classes together, which feels cohesive and reduces extra navigation.
Description
Related to: https://github.com/kedro-org/kedro-viz/issues/1909
This PR refactors the
flowchart.py
module by breaking down its contents into separate, more maintainable files within the kedro_viz.models.What was done:
Development notes
nodes.py
: Contains node related classes such asGraphNode
,TaskNode
,DataNode
,TranscodedDataNode
,ParametersNode
, andModularPipelineNode
.node_metadata.py
: Contains metadata classes for nodes, includingGraphNodeMetadata
,TaskNodeMetadata
,DataNodeMetadata
,TranscodedDataNodeMetadata
, andParametersNodeMetadata
.edges.py
: Contains theGraphEdge
class.pipelines.py
: Contains pipeline-related classes such asRegisteredPipeline
andModularPipelineNode
.tag.py
: Contains theTag
class.model_utils.py
: Contains shared utilities and base classes likeNamedEntity
,GraphNodeType
,ModularPipelineChild
, and utility functions (_parse_filepath
,_extract_wrapped_func
).QA notes
Checklist
RELEASE.md
file