Skip to content

Commit

Permalink
Add docstring & test for mdraw_est_markers (#88, #89)
Browse files Browse the repository at this point in the history
  • Loading branch information
LSYS committed Dec 16, 2023
1 parent be5eed0 commit 003ec98
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion forestplot/mplot_graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def mdraw_est_markers(
_y = base_y_vector + (ix * offset)
ax.scatter(y=_y, x=_df[estimate], marker=msymbols[ix], color=mcolor[ix], s=markersize)
return ax


def mdraw_ci(
dataframe: pd.core.frame.DataFrame,
Expand Down
15 changes: 0 additions & 15 deletions tests/test_mplot_graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,6 @@ def test_mdraw_yticklabels():


def test_mdraw_est_markers():
# Creating test data
# df = pd.DataFrame({
# 'estimate': [1, 2, 3, 4],
# 'model_col': ['model1', 'model1', 'model2', 'model2'],
# })
# models = ['model1', 'model2']

# # Initialize Matplotlib Axes
# fig, ax = plt.subplots()

# # Call the function
# ax = mdraw_est_markers(df, 'estimate', 'model_col', 'model_col', models, ax)

# # Assertions
# # assert len(ax.collections) == len(models), "Incorrect number of scatter plots."
_, ax = plt.subplots()
ax = mdraw_est_markers(input_df, estimate='estimate', model_col='model', models=list(set(models_vector)), ax=ax)
assert (all(isinstance(tick, int)) for tick in ax.get_yticks())
Expand Down

0 comments on commit 003ec98

Please sign in to comment.