Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mosaic/cli/findomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def go():
comp_path = os.path.join(os.path.join(os.path.dirname(cuda_home), 'compilers'), 'lib')
break

if comp_path is None:
if comp_path is None or not os.path.exists(comp_path):
hpcsdk_home = os.environ.get('HPCSDK_HOME')
if hpcsdk_home:
comp_path = os.path.join(os.path.join(hpcsdk_home, 'compilers'), 'lib')

# If not, try to get from LD_LIBRARY_PATH
if comp_path is None:
if comp_path is None or not os.path.exists(comp_path):
library_path = os.environ.get('LD_LIBRARY_PATH', '')
for path in library_path.split(':'):
if re.match('.*/nvidia/hpc_sdk/.*/?compilers/lib', path) or \
Expand Down
34 changes: 34 additions & 0 deletions stride/plotting/plot_points.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import os
import numpy as np
import matplotlib.pyplot as plt


__all__ = ['plot_points', 'plot_points_2d', 'plot_points_3d']
Expand Down Expand Up @@ -71,6 +72,39 @@ def plot_points_2d(coordinates, axis=None, colour='red', size=15, title=None,


def plot_points_3d(coordinates, axis=None, colour='red', size=15, title=None, **kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change the name to plot_points_3d_matplotlib?

"""
Utility function to plot 3D scattered points using matplotlib.

Parameters
----------
coordinates : 2-dimensional array
Coordinates of the points to be plotted, shape should be (n_points, 3).
axis : MayaVi axis, optional
Axis in which to make the plotting, defaults to new empty one.
colour : str
Colour to apply to the points, defaults to red.
size : float
Size of the plotted points, defaults to 15.
title : str, optional
Figure title, defaults to empty title.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check other matplotlib functions to add display test at top

fig = plt.figure(figsize=(10, 8))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check how other matplotlib functions are written, where we let the user provide some external figure/axes and, if not, we create create ones

ax = fig.add_subplot(111, projection='3d')
ax.set_title('3D View: Tangent Points with Out-of-Plane Displacement')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title should be provided externally as parameter, as done in other functions like this


ax.plot(coordinates[:, 0], coordinates[:, 1], coordinates[:, 2], 'o')

ax.set_xlabel('X (mm)')
ax.set_ylabel('Y (mm)')
ax.set_zlabel('Z (mm)')
ax.legend()
ax.grid(True)
ax.set_box_aspect([1, 1, 0.5])
plt.tight_layout()
plt.show()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in all of these functions, we return the axis instead of plotting inside the function - remove these last two lines and change to return ax



def plot_points_3d_mayavi(coordinates, axis=None, colour='red', size=15, title=None, **kwargs):
"""
Utility function to plot 3D scattered points using MayaVi.

Expand Down
Loading