Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d7ffc8b
Define InvalidConstraintError for unallowed constraint expressions
jsiirola Sep 17, 2025
6dde46f
Remove check_duplicates from linear template compiler
jsiirola Sep 17, 2025
fd28560
When compiling templates, call to_string in everything that is not a …
jsiirola Sep 17, 2025
5b55d91
Catch (and test) bug where TemplateVarRecorder ignored the sorter
jsiirola Sep 17, 2025
1c55286
Avoid awkward call to base class by just reimplementing the method
jsiirola Sep 17, 2025
db497ef
Use attempt_import to break circular dependencies
jsiirola Sep 19, 2025
2b5669c
Start tests for repn/linear_template
jsiirola Sep 19, 2025
2c7d772
bugfix: converting LinearTemplateRepn to str
jsiirola Sep 19, 2025
90a0d22
Improve specificity of raised exceptions
jsiirola Sep 19, 2025
9f65886
Fix filter for 0 multipliers/coefs
jsiirola Sep 21, 2025
52a78ac
Correctly handle empty subexpressions (e.g., from 0 multipliers)
jsiirola Sep 21, 2025
bb4dd68
Explicitly disallow nonlinear expressions in the LinearTemplateRepn
jsiirola Sep 22, 2025
e343628
Use SetOf when iterating over non-Set indexing sets
jsiirola Nov 7, 2025
21a07cf
Rework extract_values to use defaultdict for Params with default values
jsiirola Nov 7, 2025
cdeaa7c
SetOf.dimen updates:
jsiirola Nov 7, 2025
fad7cb7
Ensure we only attempt to templatize generators
jsiirola Nov 7, 2025
e2d6081
Expand summations that do not involve IndexTemplates
jsiirola Nov 7, 2025
55b1252
Improve error reporting
jsiirola Nov 7, 2025
585a7b4
Rework linear_template to enable better unit testing
jsiirola Nov 7, 2025
b6bf6b4
Resolve handling of fixed variables in bounds and skipped constraints
jsiirola Nov 7, 2025
72b4eea
Don't unnecessarily expand sparse Params
jsiirola Nov 8, 2025
d3a3a24
Improve error
jsiirola Nov 8, 2025
6353b49
Verify absence of bounds for objectives; update comment
jsiirola Nov 8, 2025
3b2da5d
Add interface to get var_list for TemplateVarRecorder
jsiirola Nov 8, 2025
edbc4e1
Expand linear_template testing
jsiirola Nov 8, 2025
f95ff38
Merge branch 'main' into linear-template-testing
jsiirola Nov 10, 2025
c7c5d6f
SetOf: revert change to the dimen of empty iterables
jsiirola Nov 10, 2025
ff1f45c
Update tests to reflect use of SetOf; remove deprecation warnings
jsiirola Nov 10, 2025
7e6fb2b
Revert "SetOf: revert change to the dimen of empty iterables"
jsiirola Nov 10, 2025
c2b2b92
Track change that SetOf([]).dimen is now None
jsiirola Nov 10, 2025
1a55b4c
SetOf({}).dimen should return UnknownSetDimen
jsiirola Nov 10, 2025
f214fec
Merge branch 'main' into linear-template-testing
jsiirola Nov 10, 2025
7641291
Avoid slicing over UnknownSetDimen referenecs
jsiirola Nov 11, 2025
ed79074
Explicit sum() should not prevent templatizing constraint
jsiirola Nov 11, 2025
f2290a1
Additional validation before creating TemplateSumExpression objects
jsiirola Nov 11, 2025
19f0fe3
Remove (unused) 'remove_fixed_vars' option
jsiirola Nov 11, 2025
1dcf6ff
Remove duplicated code
jsiirola Nov 11, 2025
3d8e302
NFC: fix typo
jsiirola Nov 11, 2025
17d0fcf
Merge branch 'main' into linear-template-testing
jsiirola Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SetOf: revert change to the dimen of empty iterables
  • Loading branch information
jsiirola committed Nov 10, 2025
commit c7c5d6f63313f23bb17473832f2bc5c2c2b5d19f
4 changes: 2 additions & 2 deletions pyomo/core/base/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -2634,8 +2634,8 @@ def dimen(self):
ans = len(x)
else:
ans = 1
except:
return None
except StopIteration:
return 0
for x in _iter:
_this = len(x) if type(x) is tuple else 1
if _this != ans:
Expand Down
2 changes: 1 addition & 1 deletion pyomo/core/expr/template_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def __next__(self):
else:
d = _set.dimen
grp = context.next_group()
if d is None or type(d) is not int:
if not d or type(d) is not int:
idx = (IndexTemplate(_set, None, context.next_id(), grp),)
else:
idx = tuple(
Expand Down