Skip to content

Commit b7d755a

Browse files
committed
use st.columns instead of st.beta_columns
This is not beta any more since streamlit 0.86.0
1 parent 7e568a5 commit b7d755a

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515
- Fix internal TODOs to improve code quality
1616
- Fix partial reconstruction in plain numpy backend
17+
- Fix deprecation warning about st.beta_columns
1718

1819
## [0.1.1] - 2021-07-22
1920
### Added

demos/demo_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def st_visualize_results(V: np.ndarray,
6666
if verbose:
6767
st.caption('''The visualization below shows a **comparison between the input signal and its
6868
reconstruction** obtained through the learned factorization model.''')
69-
cols = st.beta_columns(2)
69+
cols = st.columns(2)
7070
for col, X, Xc, title in zip(cols, [V, R], [Vc, Rc], ['Input', 'Reconstruction']):
7171
with col:
7272
for x, xc in zip(X, cycle(Xc)):
@@ -100,7 +100,7 @@ def plot(X, title):
100100
plt.close(fig)
101101

102102
for i_atom in range(n_atoms):
103-
col1, col2, col3 = st.beta_columns((1, 3, 3))
103+
col1, col2, col3 = st.columns((1, 3, 3))
104104
with col1:
105105
plot(np.moveaxis(nmf.W[i_atom], 0, -1), f'Atom {i_atom}')
106106
with col2:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ more-itertools==8.6.0
44
numpy==1.19.4
55
opt-einsum==3.3.0
66
scipy==1.5.4
7-
streamlit==0.84.0
7+
streamlit==0.87.0
88
torch==1.8.1
99

1010
# Development and Tests

tnmf/utils/demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def st_compare_signals(cls, V: np.ndarray, R: np.ndarray, verbose: bool = True):
238238
''')
239239

240240
# show the input, its reconstruction, and the reconstruction error as images next to each other
241-
cols = st.beta_columns(3)
241+
cols = st.columns(3)
242242
for col, X, title in zip(cols, [V, R, V-R], ['Input', 'Reconstruction', 'Error']):
243243
with col:
244244
fig = plt.figure()
@@ -298,7 +298,7 @@ def st_plot_partial_reconstructions(cls, V: np.ndarray, nmf: TransformInvariantN
298298
i_signal = st.slider('Signal number', 1, V.shape[0], key='i_signal_partial') - 1 if V.shape[0] > 1 else 0
299299
for i_atom in range(nmf.n_atoms):
300300
R_atom = nmf.R_partial(i_atom)
301-
cols = st.beta_columns(2)
301+
cols = st.columns(2)
302302
for col, signals, signal_opts, opts in zip(
303303
cols,
304304
[[nmf.W[i_atom]], [R_atom[i_signal], V[i_signal]]],
@@ -497,7 +497,7 @@ def generate_signal(cls, signal_params: dict) -> Tuple[np.ndarray, np.ndarray]:
497497

498498
@classmethod
499499
def _st_compare_individual_signals(cls, V_i: np.ndarray, R_i: np.ndarray):
500-
cols = st.beta_columns(2)
500+
cols = st.columns(2)
501501
for col, X, title in zip(cols, [V_i, R_i], ['Input', 'Reconstruction']):
502502
with col:
503503
cls.plot_signals([X], opts={'title': title})

0 commit comments

Comments
 (0)