Skip to content

Commit

Permalink
Merge pull request #69 from Iamtheboneofmysword/dev
Browse files Browse the repository at this point in the history
Some changes to make VisualPIC work well with OSIRIS
  • Loading branch information
AngelFP authored Mar 11, 2024
2 parents 0919dd7 + 436ee13 commit 5e061e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions visualpic/data_handling/data_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def add_derived_field(self, derived_field):
for field_name in required_fields:
base_fields.append(self.get_field(field_name))

self.derived_fields.append(DerivedField(
derived_field, sim_geometry, self.sim_params,
base_fields))
self.derived_fields.append(DerivedField(
derived_field, sim_geometry, self.sim_params,
base_fields))

def _set_folder_scanner(self):
"""Return the folder scanner corresponding to the simulation code."""
Expand Down
14 changes: 7 additions & 7 deletions visualpic/ui/basic_render_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
License: GNU GPL-3.0.
"""


from pkg_resources import resource_filename
import platform
import ctypes
Expand All @@ -24,8 +23,9 @@
from visualpic.ui.setup_field_volume_window import SetupFieldVolumeWindow
from visualpic.ui.setup_scatter_species_dialog import SetupScatterSpeciesDialog
from visualpic.ui.render_settings_dialog import RenderSettingsDialog
from visualpic.helper_functions import (
get_closest_timestep, get_previous_timestep, get_next_timestep)
from visualpic.helper_functions import (get_closest_timestep,
get_previous_timestep,
get_next_timestep)

# code for proper scaling in high-DPI screens. Move this somewhere else once \
# final UI is implemented.
Expand All @@ -40,7 +40,6 @@


class BasicRenderWindow(QtWidgets.QMainWindow):

"""Basic Qt window for interactive visualization of 3D renders."""

def __init__(self, vtk_visualizer, parent=None, window_size=None):
Expand Down Expand Up @@ -95,9 +94,10 @@ def setup_interface(self):
self.hl.addWidget(self.next_button)
self.timestep_slider = QtWidgets.QSlider(Qt.Horizontal)
if len(self.available_timesteps) > 0:
self.timestep_slider.setRange(np.min(self.available_timesteps),
np.max(self.available_timesteps))
self.timestep_slider.setValue(self.vtk_vis.current_time_step)
self.timestep_slider.setRange(
int(np.min(self.available_timesteps)),
int(np.max(self.available_timesteps)))
self.timestep_slider.setValue(int(self.vtk_vis.current_time_step))
else:
self.timestep_slider.setEnabled(False)
self.hl.addWidget(self.timestep_slider)
Expand Down
7 changes: 5 additions & 2 deletions visualpic/ui/controls/mpl_figure_with_draggable_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ def __init__(self, nrows=1, ncols=1, figsize=None, dpi=None,
self.patch_color = patch_color
self.drag_points = {}
self.histograms = {}
super().__init__(figsize, dpi, facecolor, edgecolor, linewidth,
frameon, subplotpars, tight_layout)
super().__init__(
figsize=figsize, dpi=dpi, facecolor=facecolor,
edgecolor=edgecolor, linewidth=linewidth,
frameon=frameon, subplotpars=subplotpars,
tight_layout=tight_layout)
self.create_axes(nrows, ncols, xlabels, ylabels, share_x_axis,
share_y_axis, hist, hist_edges)

Expand Down

0 comments on commit 5e061e3

Please sign in to comment.