Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect unused parameters #43

Open
SimonHeybrock opened this issue Aug 31, 2023 · 3 comments
Open

Detect unused parameters #43

SimonHeybrock opened this issue Aug 31, 2023 · 3 comments

Comments

@SimonHeybrock
Copy link
Member

Having the ability to detect parameters that are set but unused would greatly simplify debugging, but also allow for doing "validated" computation, which could raises if a parameter is not used.

As we may want to compute only an intermediate result (which would typically not depend on all parameters) this should not be enforced or enabled by default. That is, provide another helper, or argument.

@SimonHeybrock
Copy link
Member Author

Might also want to check for unused providers. This should probably be an independent flag.

@jokasimr jokasimr self-assigned this Dec 14, 2023
@jokasimr jokasimr moved this from Selected to In progress in Development Board Dec 14, 2023
@jokasimr jokasimr moved this from In progress to Blocked in Development Board Dec 19, 2023
@YooSunYoung
Copy link
Member

Maybe we could just extract a graph from the pipeline
and use other packages to detect missing parameters or providers,
instead of checking them manually (with if or for statement).

Something like

import networkx as nx
G = nx.Graph()
G.add_nodes_from([1, 2, 3, 4, 5])
G.add_edge(1, 2)
G.add_edge(1, 3)
list(nx.connected_components(G))

# [{1, 2, 3}, {4}, {5}]

And then we can easily find all of the disconnected components and do something about them, finding unused params or providers or missing providers etc....

Is there an easy way to retrieve edges and nodes from graphviz.Digraph.....?

@jl-wynen
Copy link
Member

jl-wynen commented Jan 4, 2024

Is there an easy way to retrieve edges and nodes from graphviz.Digraph.....?

If we implement several diagnostic tools, we should have a way of directly constructing a graph (networkx directly or a custom representation). Going for networkx directly might be the best choice because it gives us access to a lot of tools like @YooSunYoung showed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging a pull request may close this issue.

4 participants