Skip to content

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
diondrapeck committed Jul 19, 2024
1 parent 946d0fc commit ac12490
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
17 changes: 10 additions & 7 deletions src/promptflow-evals/promptflow/evals/evaluate/_eval_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class RunStatus(enum.Enum):
TERMINATED = 3


class EvalRun(contextlib.AbstractContextManager):
class EvalRun(
contextlib.AbstractContextManager
): # pylint: disable=too-many-instance-attributes,docstring-missing-param
"""
The simple singleton run class, used for accessing artifact store.
Expand Down Expand Up @@ -118,6 +120,7 @@ def __init__(
self._run_name = run_name
self._promptflow_run = promptflow_run
self._status = RunStatus.NOT_STARTED
self._url_base = None
self.info = None

@property
Expand Down Expand Up @@ -237,7 +240,7 @@ def __enter__(self):
self._start_run()
return self

def __exit__(self, exc_type, exc_value, exc_tb):
def __exit__(self, exc_type, exc_value, exc_tb): # pylint: disable=docstring-missing-param
"""The context manager exit call."""
self._end_run("FINISHED")

Expand Down Expand Up @@ -332,11 +335,11 @@ def _log_warning(self, failed_op: str, response: requests.Response) -> None:
)

def _check_state_and_log(
self,
action: str,
bad_states: Set[RunStatus],
should_raise: bool
) -> bool:
self,
action: str,
bad_states: Set[RunStatus],
should_raise: bool
) -> bool:
"""
Check that the run is in the correct state and log worning if it is not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ class CallbackConversationBot(ConversationBot):
:type kwargs: Any
"""
def __init__(
self,
callback: Callable,
user_template: str,
user_template_parameters: Dict,
*args,
**kwargs,
) -> None:
self,
callback: Callable,
user_template: str,
user_template_parameters: Dict,
*args,
**kwargs,
) -> None:
self.callback = callback
self.user_template = user_template
self.user_template_parameters = user_template_parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def monitor_adversarial_scenario(func) -> Callable:
"""Decorator to monitor adversarial scenario.
:param func: The function to be decorated.
:type func: Callable
:return: The decorated function.
Expand Down

0 comments on commit ac12490

Please sign in to comment.