-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
#1722 store first states #1759
#1722 store first states #1759
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1759 +/- ##
========================================
Coverage 99.28% 99.28%
========================================
Files 343 343
Lines 18894 18900 +6
========================================
+ Hits 18759 18765 +6
Misses 135 135
Continue to review full report at Codecov.
|
@@ -935,6 +945,7 @@ def solve( | |||
if self.solution is not None and len(all_cycle_solutions) > 0: | |||
self.solution.cycles = all_cycle_solutions | |||
self.solution.set_summary_variables(all_summary_variables) | |||
self.solution.all_first_states = all_first_states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't this whole PR be a one-liner with
self.solution.all_first_states = [cycle.first_state for cycle in self.solution.cycles]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried and it doesn't work because if the cycle is not stored cycle
is None
so you can't pull the first state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that's why we were doing this in the first place haha
Description
Added a variable to the solution called
all_first_states
which is a list of thefirst_state
of each cycle.Fixes #1722
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: