Skip to content

Commit

Permalink
Fix comments and upgrade some commented outprints to python3
Browse files Browse the repository at this point in the history
  • Loading branch information
kstppd committed Aug 30, 2024
1 parent fb562ff commit e6bb0ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyPlots/plot_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def plot_colormap(filename=None,
string, tries to use that as the location, e.g. "NW","NE","SW","SW"
:kword wmarkb: As for wmark, but uses an all-black Vlasiator logo.
:kword Earth: If set, draws an earth at (0,0)
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for logging.info).
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for print).
:kword draw: Set to anything but None or False in order to draw image on-screen instead of saving to file (requires x-windowing)
Expand Down
2 changes: 1 addition & 1 deletion pyPlots/plot_colormap3dslice.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def plot_colormap3dslice(filename=None,
string, tries to use that as the location, e.g. "NW","NE","SW","SW"
:kword wmarkb: As for wmark, but uses an all-black Vlasiator logo.
:kword Earth: If set, draws an earth at (0,0)
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for logging.info).
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for print).
:kword draw: Set to nonzero in order to draw image on-screen instead of saving to file (requires x-windowing)
Expand Down
2 changes: 1 addition & 1 deletion pyPlots/plot_isosurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def plot_neutral_sheet(filename=None,
string, tries to use that as the location, e.g. "NW","NE","SW","SW"
:kword wmarkb: As for wmark, but uses an all-black Vlasiator logo.
:kword Earth: If set, draws an earth at (0,0)
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for logging.info).
:kword highres: Creates the image in high resolution, scaled up by this value (suitable for print).
:kword draw: Set to nonzero in order to draw image on-screen instead of saving to file (requires x-windowing)
Expand Down
8 changes: 4 additions & 4 deletions pyVlsv/vlsvreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3003,13 +3003,13 @@ def read_velocity_cells(self, cellid, pop="proton"):
random_index = 4 # Just some index
random_velocity_cell_id = velocity_cell_ids[random_index]
logging.info "Velocity cell value at velocity cell id " + str(random_velocity_cell_id) + ": " + str(velocity_cell_map[random_velocity_cell_id])
print ("Velocity cell value at velocity cell id " + str(random_velocity_cell_id) + ": " + str(velocity_cell_map[random_velocity_cell_id]))
# Getting the corresponding coordinates might be more useful than having the velocity cell id so:
velocity_cell_coordinates = vlsvReader.get_velocity_cell_coordinates(velocity_cell_ids) # Get velocity cell coordinates corresponding to each velocity cell id
random_velocity_cell_coordinates = velocity_cell_ids[random_index]
logging.info "Velocity cell value at velocity cell id " + str(random_velocity_cell_id) + "and coordinates " + str(random_velocity_cell_coordinates) + ": " + str(velocity_cell_map[random_velocity_cell_id])
print("Velocity cell value at velocity cell id " + str(random_velocity_cell_id) + "and coordinates " + str(random_velocity_cell_coordinates) + ": " + str(velocity_cell_map[random_velocity_cell_id]))
.. seealso:: :func:`read_blocks`
'''
Expand Down Expand Up @@ -3404,10 +3404,10 @@ def optimize_clear_fileindex_for_cellid_blocks(self):
# Open a list of vlsv files
for i in range(1000):
vlsvReaders.append( VlsvReader("test" + str(i) + ".vlsv") )
# Go through vlsv readers and logging.info info:
# Go through vlsv readers and print info:
for vlsvReader in vlsvReaders:
# Print something from the file on the screen
logging.info vlsvReader.read_blocks( cellid= 5021 ) # Stores info into a private variable
print( vlsvReader.read_blocks( cellid= 5021 )) # Stores info into a private variable
# Upon reading from vlsvReader a private variable that contains info on cells that have blocks has been saved -- now clear it to save memory
vlsvReader.optimize_clear_fileindex_for_cellid_blocks()
Expand Down

0 comments on commit e6bb0ae

Please sign in to comment.