Skip to content

Commit 589239b

Browse files
authored
ktensor vis() -> viz() (#372)
method name change to align with MATLAB
1 parent 0a469f5 commit 589239b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

docs/source/matlab/ktensor.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ Methods
2222
+-----------------+----------------------+------------------------------------------------------------------------+
2323
| ``tensor`` | ``to_tensor`` | ``X.to_tensor()`` |
2424
+-----------------+----------------------+------------------------------------------------------------------------+
25-
26-
MATLAB methods not included in ``pyttb``
27-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
* ``viz``
25+
| ``viz`` | ``viz`` | ``X.viz()`` |
26+
+-----------------+----------------------+------------------------------------------------------------------------+

pyttb/ktensor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ def update(self, modes: OneDArray, data: np.ndarray) -> ktensor:
22262226

22272227
return self
22282228

2229-
def vis( # noqa: PLR0912, PLR0913
2229+
def viz( # noqa: PLR0912, PLR0913
22302230
self,
22312231
plots: Optional[Union[tuple, list]] = None,
22322232
show_figure: bool = True,
@@ -2295,9 +2295,9 @@ def vis( # noqa: PLR0912, PLR0913
22952295
>>> np.random.seed(1)
22962296
>>> K = ttb.ktensor.from_function(np.random.random_sample, (2, 3, 10), 2)
22972297
2298-
Use plot K using default behavior K.vis()
2298+
Use plot K using default behavior K.viz()
22992299
2300-
>>> fig, axs = K.vis(show_figure=False) # doctest: +ELLIPSIS
2300+
>>> fig, axs = K.viz(show_figure=False) # doctest: +ELLIPSIS
23012301
>>> plt.close(fig)
23022302
23032303
Define a more realistic plot fuctions with x labels,
@@ -2314,7 +2314,7 @@ def vis( # noqa: PLR0912, PLR0913
23142314
... ax.semilogx(np.logspace(-2, 2, v.shape[0]), v)
23152315
... ax.set_xlabel("$E$, [kJ]")
23162316
>>> plots = [mode_1_plot, mode_2_plot, mode_3_plot]
2317-
>>> fig, axs = K.vis(
2317+
>>> fig, axs = K.viz(
23182318
... show_figure=False,
23192319
... plots=plots,
23202320
... rel_widths=[1, 2, 3],

0 commit comments

Comments
 (0)