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

Update code to work with Pyomo 6 #25

Closed
4 of 5 tasks
grgmiller opened this issue Aug 12, 2021 · 3 comments
Closed
4 of 5 tasks

Update code to work with Pyomo 6 #25

grgmiller opened this issue Aug 12, 2021 · 3 comments
Assignees
Labels
bug Something isn't working cleanup

Comments

@grgmiller
Copy link
Collaborator

grgmiller commented Aug 12, 2021

The code is currently limited to only work with <= 5.6.8. However, CPLEX is incompatible with versions < 5.7.3. It would also probably be good to update to the newest version.

This issue was raised in the original switch documentation:

Steps:

  • Test branch to make sure it is error free on 5.6.8
  • Create a new switch environment that uses Pyomo 6
  • Run the code and see what breaks
  • Fix it!
  • Test updates with CPLEX
@grgmiller grgmiller added bug Something isn't working cleanup labels Aug 12, 2021
@grgmiller grgmiller self-assigned this Aug 12, 2021
@grgmiller
Copy link
Collaborator Author

We are currently using Pyomo 5.6.8 (Dec 2019) and we want to update to the Pyomo 6.1. According to the changelog, the following updates will need to be addressed:

  • May need to re-work sets

@grgmiller
Copy link
Collaborator Author

Changes encountered so far include:

  • OrderedSimpleSet became OrderedScalarSet
  • SimpleParam became ScalarParam
  • DEPRECATED: The default domain for Param objects is 'Any'. However,
    we will be changing that default to 'Reals' in the future. If you really
    intend the domain of this Param (tp_timestamp) to be 'Any', you can
    suppress this warning by explicitly specifying 'within=Any' to the Param
    constructor. (deprecated in 5.6.9, will be removed in 6.0) (called from
    C:\Users\gmiller\miniconda3\envs\switch_pyomo_update\lib\site-
    packages\pyomo\core\base\PyomoModel.py:856)
    WARNING: Initializing ordered Set PERIODS_FOR_GEN_BLD_YR with a fundamentally
    unordered data source (type: set). This WILL potentially lead to
    nondeterministic behavior in Pyomo

Removed PERIODS_FOR_GEN_BLD_YR, and TPS_FOR_GEN_IN_PERIOD because not used in the model

@grgmiller
Copy link
Collaborator Author

grgmiller commented Aug 26, 2021

The update also introduced an error when loading tabular data using the load_aug() function in utilities.py. When specifying an index=, it was no longer properly calculating the number of dimensions of the set, returning an UnknownSetDimen type object. Pyomo must have started requiring that the number of dimensions be manually specified, so to fix this, I had to add dimen=1 to several sets that are used as indexes when loading data, such as PERIODS

grgmiller added a commit that referenced this issue Aug 26, 2021
grgmiller added a commit that referenced this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cleanup
Projects
None yet
Development

No branches or pull requests

1 participant