Skip to content

Conversation

@JRGarza
Copy link

@JRGarza JRGarza commented Nov 23, 2023

Adding input options to the plotting method:

  • figure and axes object, giving the opportunity to plot over the Kippenhahn figures if needed.
  • camp_label, if the profile column that will be plotted in the Kippenhahn diagrams is not pre defined in the method, the string for the colormap title needs to be defined as input.
  • log_cmap, if True (default value) the colormap will be in log10 scale, otherwise it will be in linear scale.

@JRGarza JRGarza requested review from mkruckow and tassos25 November 23, 2023 10:28
raise ValueError(self._param['Variable']+"not a valid option for parameter Variable")


"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you start a second docstring here? Btw. never use docstrings to multi line comments, this is very dirty coding!

else:
ax1 = ax
ax1 = self._param['ax']
fig1 = self._param['fig']
Copy link
Contributor

Choose a reason for hiding this comment

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

After this change, shouldn't we remove the argument ax from the plot function? If it is still used somewhere else you should replace it there with the new axis object stored in the kippenhahn object.

if self._param['log_cmap']:
data_to_plot = np.log10(np.abs(np.transpose(self._data)))
else:
data_to_plot = np.transpose(self._data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a matter of style, should you better use the structure:

if self._param['signed_log_cmap']:
    ...
elif self._param['log_cmap']:
    ...
else:
    ...

instead of

if self._param['signed_log_cmap']:
    ...
else:
    if self._param['log_cmap']:
        ...
    else:
        ...

ax2.set_ylim([1e-5,1.])
else:
ax2.set_ylim([0.,1.])
if ax is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you don't want to check for self._param['ax'] here?
Even a deeper thought: shouldn't we check, whether self._Xaxis_min, self._Xaxis_max, ... are given? Usually, I'd let the user overwrite old limits, when new ones are given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants