diff --git a/contrib/hamilton/contrib/user/zilto/nixtla_statsforecast/__init__.py b/contrib/hamilton/contrib/user/zilto/nixtla_statsforecast/__init__.py index 1dd68a81c..97b4d9b63 100644 --- a/contrib/hamilton/contrib/user/zilto/nixtla_statsforecast/__init__.py +++ b/contrib/hamilton/contrib/user/zilto/nixtla_statsforecast/__init__.py @@ -125,7 +125,7 @@ def best_model_per_series(cross_validation_evaluation: pd.DataFrame) -> pd.Serie def inference_predictions( forecaster: StatsForecast, inference_forecast_steps: int = 12, - inference_confidence_percentile: list[float] = [90.0], # noqa + inference_confidence_percentile: list[float] = [90.0], # noqa: B006 ) -> pd.DataFrame: """Infer values using the training harness. Fitted models aren't stored diff --git a/contrib/setup.py b/contrib/setup.py index 5b5903696..b7c4fe9e5 100644 --- a/contrib/setup.py +++ b/contrib/setup.py @@ -10,7 +10,7 @@ try: with open("README.md") as readme_file: readme = readme_file.read() -except Exception: +except FileNotFoundError: warnings.warn("README.md not found") # noqa readme = None diff --git a/examples/LLM_Workflows/image_telephone/streamlit.py b/examples/LLM_Workflows/image_telephone/streamlit.py index dbf78384b..59fd40293 100644 --- a/examples/LLM_Workflows/image_telephone/streamlit.py +++ b/examples/LLM_Workflows/image_telephone/streamlit.py @@ -403,7 +403,6 @@ def explore_display(): image_urls_to_display = image_urls[0 : len(projection)] if len(image_urls_to_display) != len(projection): image_url_length = len(image_urls_to_display) - # for i in range(len(projection) - len(image_urls_to_display)): image_urls_to_display.append(image_urls[image_url_length - 1]) embedding_path_plot(projection, image_urls_to_display, selected_entry, prompt_path) # highlight_point(projection, selected_entry) diff --git a/examples/LLM_Workflows/knowledge_retrieval/summarize_text.py b/examples/LLM_Workflows/knowledge_retrieval/summarize_text.py index 23fa233cc..580756a49 100644 --- a/examples/LLM_Workflows/knowledge_retrieval/summarize_text.py +++ b/examples/LLM_Workflows/knowledge_retrieval/summarize_text.py @@ -56,7 +56,7 @@ def pdf_text(pdf_path: pd.Series) -> pd.Series: :return: Series of strings of the PDFs' contents """ _pdf_text = [] - for _, file_path in pdf_path.items(): + for _i, file_path in pdf_path.items(): # creating a pdf reader object reader = PdfReader(file_path) text = "" diff --git a/examples/due_date_probabilities/probability_estimation.py b/examples/due_date_probabilities/probability_estimation.py index 054a3ad72..5c673e5ed 100644 --- a/examples/due_date_probabilities/probability_estimation.py +++ b/examples/due_date_probabilities/probability_estimation.py @@ -125,10 +125,9 @@ def raw_probabilities(raw_data: str) -> pd.DataFrame: def resampled(raw_probabilities: pd.DataFrame) -> List[int]: sample_data = [] - for _, row in raw_probabilities.iterrows(): + for _idx, row in raw_probabilities.iterrows(): count = row.probability * 1000 - for _i in range(int(count)): - sample_data.append(row.days) + sample_data.extend([row.days] * int(count)) return sample_data diff --git a/hamilton/execution/state.py b/hamilton/execution/state.py index ec855f444..f12182611 100644 --- a/hamilton/execution/state.py +++ b/hamilton/execution/state.py @@ -307,7 +307,7 @@ def realize_parameterized_group( for dependency in new_task.base_dependencies: new_dependencies[dependency] = [] if dependency in task_names_in_group: - for _, name_map in name_maps.items(): + for _group_name, name_map in name_maps.items(): new_dependencies[dependency].append(name_map[dependency]) else: new_dependencies[dependency].append(dependency)