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

Let variables take sets as well as vectors as input #12

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

stelmo
Copy link
Member

@stelmo stelmo commented Dec 16, 2023

Mostly to avoid re-allocating memory in other packages

@stelmo stelmo requested a review from exaexa December 16, 2023 13:49
Copy link

codecov bot commented Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5c7496e) 100.00% compared to head (8ffe64d) 100.00%.
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #12   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          184       184           
=========================================
  Hits           184       184           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stelmo
Copy link
Member Author

stelmo commented Dec 16, 2023

/format

triggered by @stelmo on PR #12
Copy link

✔️ Auto-formatting triggered by this comment succeeded, commited as 7259a63

@@ -191,7 +191,7 @@ interval bound for all variables, it is impossible to use a tuple (since its
length is 2); in such case use `bound = Ref((minimum, maximum))`, which has the
correct length.
"""
function variables(; keys::Vector{Symbol}, bounds = nothing)
function variables(; keys::Union{Vector{Symbol},Set{Symbol}}, bounds = nothing)
Copy link
Member

@exaexa exaexa Dec 16, 2023

Choose a reason for hiding this comment

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

Do we really want a Set here? (it makes the order of variables in the created ConstraintTree basically unpredictable, which might be a tripwire in case people rely on the numbering and reproducibility e.g. in Distributed cluster, like we do every here and there for simplicity....)

Might be useful to just have AbstractVector here or so

@stelmo
Copy link
Member Author

stelmo commented Dec 16, 2023

For reproducibility I am closing this PR. (slack convo)

@stelmo stelmo closed this Dec 16, 2023
@exaexa
Copy link
Member

exaexa commented Dec 16, 2023

actually we can extend a tiny bit

@exaexa exaexa reopened this Dec 16, 2023
Copy link
Member

@exaexa exaexa left a comment

Choose a reason for hiding this comment

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

a small extension to abstract vectors is OK. No idea why I had a fixed vector there before.

@exaexa exaexa merged commit 358e3e9 into master Dec 16, 2023
8 checks passed
@stelmo stelmo deleted the sew-extend-variables-input-types branch December 29, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants