Skip to content

solvableFilter on listVariables and getVariables for GraphsDFG#1097

Merged
Affie merged 1 commit intomasterfrom
enh/solvableFilter
Oct 22, 2024
Merged

solvableFilter on listVariables and getVariables for GraphsDFG#1097
Affie merged 1 commit intomasterfrom
enh/solvableFilter

Conversation

@Affie
Copy link
Copy Markdown
Member

@Affie Affie commented Oct 22, 2024

TODO: still need to be added to all relevant functions and tests.

close #222
close #331

@Affie Affie self-assigned this Oct 22, 2024
@Affie Affie added the enhancement New feature or request label Oct 22, 2024
@Affie Affie added this to the v0.25.0 milestone Oct 22, 2024
Comment on lines +208 to +213

solvable != 0 &&
filter!(v -> _isSolvable(dfg, v.label, solvable), variables)

!isempty(tags) &&
filter!(v -> !isempty(intersect(v.tags, tags)), variables)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
solvable != 0 &&
filter!(v -> _isSolvable(dfg, v.label, solvable), variables)
!isempty(tags) &&
filter!(v -> !isempty(intersect(v.tags, tags)), variables)

Comment on lines +215 to +216
!isnothing(solvableFilter) &&
filter!(v -> solvableFilter(getSolvable(v)), variables)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
!isnothing(solvableFilter) &&
filter!(v -> solvableFilter(getSolvable(v)), variables)
solvable != 0 && filter!(v -> _isSolvable(dfg, v.label, solvable), variables)
!isempty(tags) && filter!(v -> !isempty(intersect(v.tags, tags)), variables)
!isnothing(solvableFilter) && filter!(v -> solvableFilter(getSolvable(v)), variables)

Comment on lines +237 to +240
!isnothing(regexFilter) &&
filter!(v -> occursin(regexFilter, String(v)), variables)
solvable != 0 &&
(variables = filter(vId -> _isSolvable(dfg, vId, solvable), variables))
filter!(vId -> _isSolvable(dfg, vId, solvable), variables)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
!isnothing(regexFilter) &&
filter!(v -> occursin(regexFilter, String(v)), variables)
solvable != 0 &&
(variables = filter(vId -> _isSolvable(dfg, vId, solvable), variables))
filter!(vId -> _isSolvable(dfg, vId, solvable), variables)
!isnothing(regexFilter) && filter!(v -> occursin(regexFilter, String(v)), variables)
solvable != 0 && filter!(vId -> _isSolvable(dfg, vId, solvable), variables)

@Affie Affie merged commit 1af130d into master Oct 22, 2024
@Affie Affie deleted the enh/solvableFilter branch October 22, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: More flexibility with solvable How do you filter to only return solvable == x

1 participant