-
Notifications
You must be signed in to change notification settings - Fork 38
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
unlock pyomo version #124
unlock pyomo version #124
Conversation
The test didn't install a newer version of pyomo, and that bothers me a bit. Any thoughts? EDIT: I actually see it pinned 5.7.0 still. I wonder if there's another plugin forcing that. EDIT 2: it appears LOGOS is still pinning version, so this PR doesn't really test much, except to remove a potential future barrier. It can still be merged probably. |
Do HERON tests pass locally on your machine with the updated pyomo version? |
That's a good question; my RAVEN is mid development right now so I can't check. I will soon. UPDATE: It looks like there's some number-of-argument errors, investigating ... UPDATE 2: An inner solve succeeds on pyomo 5.7.3. Checking other versions:
I don't see an obvious reason from the patchnotes why this changed, but I'm looking further. The error raised is:
... which is strange because it definitely takes 3 arguments and I'm not sure what the 4th is. Is it trying to pass Objective construction: def _create_objective(self, meta, m):
rule = partial(self._cashflow_rule, meta)
m.obj = pyo.Objective(rule=rule, sense=pyo.maximize) Cashflow Rule def _cashflow_rule(self, meta, m):
activity = m.Activity
state_args = {'valued': False}
total = self._compute_cashflows(m.Components, activity, m.Times, meta,
state_args=state_args, time_offset=m.time_offset)
return total |
@PaulTalbot-INL could it have something to do with EDIT: This SO answer might explain more what I'm talking about: https://stackoverflow.com/questions/16626789/functools-partial-on-class-method |
Hm. (1) Why do none of the constraints have this problem? Trying some things. Good thought, though. The error is:
|
Ah, also, the SO you shared suggests the method isn't getting enough arguments, while in our case it says it's getting too many arguments. |
@PaulTalbot-INL I might have found the problem. Look at this line of code here in pyomo: if type(init) is functools.partial:
_args = inspect.getfullargspec(init.func)
if len(_args.args) - len(init.args) == 1 and _args.varargs is None:
return ScalarCallInitializer(init)
else:
return IndexedCallInitializer(init) I did some playing around and when we try to apply |
This is interesting. Let's talk and see if we can convince it to behave like we want. |
I think I found the descrepency between 6.0 and 6.1. It can be found in the With the introduction of |
@PaulTalbot-INL I think you may have accidently committed and pushed some scratch code. Let me know if not. |
yeah, this is WIP figuring out that silly change from 6.0 to 6.1. Not finished yet. |
I don't know why this makes a difference, but it does. From what I understand, I don't know if I can put my changes into this PR, but I can put up a new PR tomorrow for y'all to review. |
superseded by #142. |
Pull Request Description
What issue does this change request address?
Continues #74
What are the significant changes in functionality due to this change request?
Unlocks the pyomo version in the dependency installer
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.