Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sumalreddy17 committed Nov 22, 2024
1 parent b9c7497 commit c19636e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
30 changes: 6 additions & 24 deletions python/src/robyn/robyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,27 +400,10 @@ def optimize_budget(
logger.error("Budget optimization failed: %s", str(e))
raise

def plot_one_pager(self, solution_id: Optional[str] = None) -> None:
"""Generate one pager plots for the model.
Args:
solution_id: Optional specific solution ID to plot.
If None, generates plots for top pareto solutions
"""
try:
self._generate_one_pager(solution_id=solution_id)
except Exception as e:
logging.error(f"Failed to generate one pager plots: {str(e)}")
raise

def _generate_one_pager(
self,
plots: Optional[List[PlotType]] = None,
solution_id: Optional[str] = None
) -> None:
def generate_one_pager(self, solution_id: Optional[str] = None) -> None:
"""
Generate one-page summary report.
Args:
plots: Optional list of specific plots to include
solution_id: Optional specific solution ID to plot
Expand All @@ -431,16 +414,15 @@ def _generate_one_pager(
clustered_result=self.cluster_result,
adstock=self.hyperparameters.adstock,
mmm_data=self.mmm_data,
holidays_data=self.holidays_data
holidays_data=self.holidays_data,
)

# Set top_pareto based on whether solution_id is provided
top_pareto = solution_id is None

figures = onepager.generate_one_pager(
plots=plots,
solution_ids=solution_id if solution_id else "all",
top_pareto=top_pareto
top_pareto=top_pareto,
)
return figures

Expand Down
6 changes: 3 additions & 3 deletions python/src/robyn/tutorials/tutorial1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"source": [
"import sys\n",
"\n",
"sys.path.append(\"/Users/sumalreddy/workspace/Robyn/python/src\")\n",
"sys.path.append(\"/Users/yijuilee/robynpy_release_reviews/Robyn/python/src\")\n",
"import pandas as pd\n",
"import numpy as np\n",
"from robyn.robyn import Robyn\n",
Expand Down Expand Up @@ -287,7 +287,7 @@
"metadata": {},
"outputs": [],
"source": [
"robyn.plot_one_pager()"
"robyn.generate_one_pager()"
]
},
{
Expand All @@ -297,7 +297,7 @@
"metadata": {},
"outputs": [],
"source": [
"robyn.plot_one_pager(solution_id=\"1_4_1\")"
"robyn.generate_one_pager(solution_id=\"1_4_1\")"
]
},
{
Expand Down

0 comments on commit c19636e

Please sign in to comment.