-
Notifications
You must be signed in to change notification settings - Fork 32
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
FIX: Live graphing in ODECSolver
using wrong decoder
#755
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added missing import to `TauHybridCSolver` - Added correct decoder for `ODECSolver`
BryanRumsey
requested changes
Mar 29, 2022
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.
Error occurred when plotting results from ODECSolver
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/var/folders/z4/bqpnd_kx7xg3s3c9jtz0pnfh0000gn/T/ipykernel_9401/4213838279.py in <module>
----> 1 results3.plot()
~/Documents/GillesPy2/gillespy2/core/results.py in plot(self, index, xaxis_label, xscale, yscale, yaxis_label, style, title, show_title, show_legend, multiple_graphs, included_species_list, save_png, figsize)
406 _plot_iterate(trajectory, included_species_list=included_species_list, show_labels=False)
407 else:
--> 408 _plot_iterate(trajectory, included_species_list=included_species_list)
409
410 if show_legend:
~/Documents/GillesPy2/gillespy2/core/results.py in _plot_iterate(self, show_labels, included_species_list)
48 label = ""
49
---> 50 plt.plot(self.data['time'], self.data[species], label=label, color=line_color)
51
52
/opt/homebrew/lib/python3.9/site-packages/matplotlib/pyplot.py in plot(scalex, scaley, data, *args, **kwargs)
3017 @_copy_docstring_and_deprecators(Axes.plot)
3018 def plot(*args, scalex=True, scaley=True, data=None, **kwargs):
-> 3019 return gca().plot(
3020 *args, scalex=scalex, scaley=scaley,
3021 **({"data": data} if data is not None else {}), **kwargs)
/opt/homebrew/lib/python3.9/site-packages/matplotlib/axes/_axes.py in plot(self, scalex, scaley, data, *args, **kwargs)
1603 """
1604 kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
-> 1605 lines = [*self._get_lines(*args, data=data, **kwargs)]
1606 for line in lines:
1607 self.add_line(line)
/opt/homebrew/lib/python3.9/site-packages/matplotlib/axes/_base.py in __call__(self, data, *args, **kwargs)
313 this += args[0],
314 args = args[1:]
--> 315 yield from self._plot_args(this, kwargs)
316
317 def get_next_color(self):
/opt/homebrew/lib/python3.9/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs, return_kwargs)
499
500 if x.shape[0] != y.shape[0]:
--> 501 raise ValueError(f"x and y must have same first dimension, but "
502 f"have shapes {x.shape} and {y.shape}")
503 if x.ndim > 2 or y.ndim > 2:
ValueError: x and y must have same first dimension, but have shapes (6001,) and (10001,)
It seems that the end_time is not being read in correctly in the IterativeSimDecoder.read
. This issue is only present in the ODECsolver
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should allow full support for live graphing for the
ODECSolver
andTauHybridCSolver
.Fixes
ODECSolver
(IterativeSimDecoder
is required for live graphing)numpy
import toTauHybridCSolver
Closes #659