-
Notifications
You must be signed in to change notification settings - Fork 59
Hide boundary points in figure #391
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f30cb6d
hide boundary points in figure
059272a
set xindices as an option
bae5f8e
keep boundary points in test_field_with_numerical
ff4fac0
format document with black
e2de8d0
init xindices in Euler1DSolver
0936eb9
refactor xindices
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,6 +511,8 @@ def set_solver_config(self): | |
| self.interval = self.solver_config.get_var("timer_interval", "value") | ||
| self.max_steps = self.solver_config.get_var("max_steps", "value") | ||
| self.profiling = self.solver_config.get_var("profiling", "value") | ||
| ncoord = self.solver_config.get_var("ncoord", "value") | ||
| self.plot_point = np.linspace(2, (ncoord - 3), num=((ncoord - 3) // 2), dtype=int) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A convention of short-living temporary variables is _ = self.solver_config.get_var("ncoord", "value")
self.xindices = np.linspace(2, (_ - 3), num=((_ - 3) // 2), dtype=int)
|
||
|
|
||
| def setup_timer(self): | ||
| """ | ||
|
|
@@ -530,7 +532,7 @@ def build_grid_figure(self): | |
|
|
||
| :return: FigureCanvas | ||
| """ | ||
| x = self.st.svr.coord[::2] | ||
| x = self.st.svr.coord[self.plot_point] | ||
| fig = Figure() | ||
| canvas = FigureCanvas(fig) | ||
| ax = canvas.figure.subplots(3, 2) | ||
|
|
@@ -574,7 +576,7 @@ def build_single_figure(self): | |
|
|
||
| :return: FigureCanvas | ||
| """ | ||
| x = self.st.svr.coord[::2] | ||
| x = self.st.svr.coord[self.plot_point] | ||
| fig = Figure() | ||
| canvas = FigureCanvas(fig) | ||
| ax = canvas.figure.subplots() | ||
|
|
@@ -744,23 +746,23 @@ def update_lines(self): | |
| """ | ||
| if self.use_grid_layout: | ||
| self.density.update(adata=self.st.density_field, | ||
| ndata=self.st.svr.density[::2]) | ||
| ndata=self.st.svr.density[self.plot_point]) | ||
| self.pressure.update(adata=self.st.pressure_field, | ||
| ndata=self.st.svr.pressure[::2]) | ||
| ndata=self.st.svr.pressure[self.plot_point]) | ||
| self.velocity.update(adata=self.st.velocity_field, | ||
| ndata=self.st.svr.velocity[::2]) | ||
| ndata=self.st.svr.velocity[self.plot_point]) | ||
| self.temperature.update(adata=self.st.temperature_field, | ||
| ndata=self.st.svr.temperature[::2]) | ||
| ndata=self.st.svr.temperature[self.plot_point]) | ||
| self.internal_energy.update(adata=(self.st.internal_energy_field), | ||
| ndata=(self.st.svr. | ||
| internal_energy[::2])) | ||
| internal_energy[self.plot_point])) | ||
| self.entropy.update(adata=self.st.entropy_field, | ||
| ndata=self.st.svr.entropy[::2]) | ||
| ndata=self.st.svr.entropy[self.plot_point]) | ||
| else: | ||
| for name, is_selected, *_ in self.plot_config.state: | ||
| if is_selected: | ||
| eval(f'(self.{name}.update(adata=self.st.{name}_field,' | ||
| f' ndata=self.st.svr.{name}[::2]))') | ||
| f' ndata=self.st.svr.{name}[self.plot_point]))') | ||
|
|
||
|
|
||
| class PlotArea(PuiInQt): | ||
|
|
||
This file contains hidden or 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
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.
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.
@j8xixo12 With this PR I realized that
self.solver_config.get_var()is too wordy. The lengthy API makes it hard to quickly write and understand code.Please propose a new design of
SolverConfigandPlotConfigin the discussions. We can probably consider__getattr__()or__getitem__()@Gene0315 please provide an option to keep existing behavior.
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.
@Gene0315 You can use the inline comment for focused discussions.
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.
@j8xixo12 Any comments?
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.
Ok, I will create a discussion and propose a new design in the discussion.
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.
Thanks, @j8xixo12 . Maybe creating an issue describing what we know and may be done can help.