Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
smellycloud committed Jan 23, 2025
1 parent fc89966 commit c7aa204
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion views_pipeline_core/data/dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def get_data(
return df, alerts
else:
raise RuntimeError(
f"file {viewser_df_name} incompatible with partition {self.partition}"
f"file {path_viewser_df.name} incompatible with partition {self.partition}"
)
logger.debug(f"DataFrame shape: {df.shape if df is not None else 'None'}")
for ialert, alert in enumerate(
Expand Down
2 changes: 1 addition & 1 deletion views_pipeline_core/managers/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ def execute_single_run(self, args) -> None:
validate=True,
)
self._wandb_alert(
title=f"Queryset Fetch Complete ({str(args.run_type)})",
title=f"Queryset Fetch Complete ({str(self._data_loader.partition)})",
text=f"Queryset for {self._model_path.target} {self.config['name']} with depvar {self.config['depvar']} and LoA of {self.config['level']} downloaded successfully. Drift self test is set to {args.drift_self_test}.",
level=wandb.AlertLevel.INFO,
)
Expand Down
48 changes: 24 additions & 24 deletions views_pipeline_core/templates/ensemble/template_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ def generate(script_path: Path) -> bool:
"""

code = """import wandb
import warnings
from pathlib import Path
from views_pipeline_core.cli.utils import parse_args, validate_arguments
from views_pipeline_core.managers.log import LoggingManager
from views_pipeline_core.managers.ensemble import EnsemblePathManager, EnsembleManager
warnings.filterwarnings("ignore")
try:
ensemble_path = EnsemblePathManager(Path(__file__))
logger = LoggingManager(ensemble_path).get_logger()
except FileNotFoundError as fnf_error:
raise RuntimeError(
f"File not found: {fnf_error}. Check the file path and try again."
)
except PermissionError as perm_error:
raise RuntimeError(
f"Permission denied: {perm_error}. Check your permissions and try again."
)
except Exception as e:
raise RuntimeError(f"Unexpected error: {e}. Check the logs for details.")
if __name__ == "__main__":
import warnings
from pathlib import Path
from views_pipeline_core.cli.utils import parse_args, validate_arguments
from views_pipeline_core.managers.log import LoggingManager
from views_pipeline_core.managers.ensemble import EnsemblePathManager, EnsembleManager
warnings.filterwarnings("ignore")
try:
ensemble_path = EnsemblePathManager(Path(__file__))
logger = LoggingManager(ensemble_path).get_logger()
except FileNotFoundError as fnf_error:
raise RuntimeError(
f"File not found: {fnf_error}. Check the file path and try again."
)
except PermissionError as perm_error:
raise RuntimeError(
f"Permission denied: {perm_error}. Check your permissions and try again."
)
except Exception as e:
raise RuntimeError(f"Unexpected error: {e}. Check the logs for details.")
if __name__ == "__main__":
wandb.login()
args = parse_args()
validate_arguments(args)
EnsembleManager(ensemble_path=ensemble_path).execute_single_run(args)
"""
"""
return save_python_script(script_path, code)
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def generate(script_path: Path, model_name: str, model_algorithm: str) -> bool:
# "queryset": "escwa001_cflong",
# "level": "pgm",
# "creator": "Your name here"
"metrics": ["RMSLE", "CRPS"],
}}
return meta_config
"""
Expand Down

0 comments on commit c7aa204

Please sign in to comment.