-
Notifications
You must be signed in to change notification settings - Fork 6
0000: Added typing and linting tooling framework, setup shared vscode workspace configuration #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
beb193c
49e5591
1848de5
8f45e9c
af06bd3
9147120
f7732f8
003ac3a
a351b0b
cdbeabb
9ab480e
9e9277a
0d1e894
899560c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"cSpell.words": [ | ||
"autouse", | ||
"caml", | ||
"camls", | ||
"dateutil", | ||
"finfo", | ||
"howsoai", | ||
"iinfo", | ||
"isinstance", | ||
"isoparse", | ||
"issubdtype", | ||
"itemsize", | ||
"jsonifiable", | ||
"pyright", | ||
"pytest", | ||
"setosa", | ||
"SMAPE", | ||
"subdtype", | ||
"targetless" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ def __init__( | |
train_initial_batch_size: int = 100, | ||
verbose: bool = False, | ||
version_check: bool = True, | ||
**kwargs | ||
**kwargs # noqa ARG002 | ||
): | ||
global _VERSION_CHECKED | ||
|
||
|
@@ -378,10 +378,10 @@ def _deserialize(self, label: str, payload: str | bytes | None) -> t.Any: | |
return data | ||
except HowsoError: | ||
raise | ||
except Exception: # noqa: Deliberately broad | ||
except Exception: # Deliberately broad | ||
raise HowsoError('Failed to deserialize the Howso Engine response.') | ||
|
||
def _resolve_trainee(self, trainee_id: str, **kwargs) -> DirectTrainee: | ||
def _resolve_trainee(self, trainee_id: str, **kwargs) -> DirectTrainee: # noqa ARG002 | ||
""" | ||
Resolve a Trainee and acquire its resources. | ||
|
||
|
@@ -538,7 +538,7 @@ def _get_trainee_from_engine(self, trainee_id: str) -> DirectTrainee: | |
file_size=file_size | ||
) | ||
|
||
def _get_trainee_thread_count(self, trainee_id: str) -> int: | ||
def _get_trainee_thread_count(self, trainee_id: str) -> int: # noqa ARG002 | ||
""" | ||
Get the number of available cpu threads a Trainee has access to. | ||
|
||
|
@@ -612,7 +612,7 @@ def _trainee_size(self, filename: str) -> int | None: | |
return None | ||
return path.stat().st_size | ||
|
||
def execute(self, trainee_id: str, label: str, payload: t.Any, **kwargs) -> t.Any: | ||
def execute(self, trainee_id: str, label: str, payload: t.Any, **kwargs) -> t.Any: # noqa ARG002 | ||
""" | ||
Execute a label in Howso engine. | ||
|
||
|
@@ -638,7 +638,7 @@ def execute(self, trainee_id: str, label: str, payload: t.Any, **kwargs) -> t.An | |
raise HowsoError('Invalid payload - please check for infinity or NaN values') from err | ||
return self._deserialize(label, result) | ||
|
||
def execute_sized(self, trainee_id: str, label: str, payload: t.Any, **kwargs) -> tuple[t.Any, int, int]: | ||
def execute_sized(self, trainee_id: str, label: str, payload: t.Any, **kwargs) -> tuple[t.Any, int, int]: # noqa ARG002 | ||
""" | ||
Execute a label in Howso engine and return the request and response sizes. | ||
|
||
|
@@ -668,7 +668,7 @@ def execute_sized(self, trainee_id: str, label: str, payload: t.Any, **kwargs) - | |
raise HowsoError('Invalid payload - please check for infinity or NaN values') from err | ||
return self._deserialize(label, result), len(json_payload), len(result) | ||
|
||
def is_tracing_enabled(self, trainee_id: str) -> bool: | ||
def is_tracing_enabled(self, trainee_id: str) -> bool: # noqa ARG002 | ||
""" | ||
Get if tracing is enabled for Trainee. | ||
|
||
|
@@ -747,7 +747,7 @@ def check_name_valid_for_save( | |
): | ||
return False, 'Cannot write to this path' | ||
|
||
except Exception as e: # noqa: Deliberately broad | ||
except Exception as e: # Deliberately broad | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's many of these warnings in the output in pipeline. The comment is meaningful, but it's not the same as a QA check disable. We probably want to correct the entire list at some point.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This causes a problem with Martin's tooling setup. Will need to review the issue for ways to coexist. |
||
return False, f'Exception {e} while checking file' | ||
else: | ||
return True, 'OK' | ||
|
@@ -759,13 +759,13 @@ def create_trainee( # noqa: C901 | |
*, | ||
id: t.Optional[str | uuid.UUID] = None, | ||
library_type: t.Optional[LibraryType] = None, | ||
max_wait_time: t.Optional[int | float] = None, | ||
max_wait_time: t.Optional[int | float] = None, # noqa ARG002 | ||
metadata: t.Optional[MutableMapping[str, t.Any]] = None, | ||
overwrite_trainee: bool = False, | ||
persistence: Persistence = "allow", | ||
project: t.Optional[str | Project] = None, | ||
project: t.Optional[str | Project] = None, # noqa ARG002 | ||
resources: t.Optional[Mapping[str, t.Any]] = None, | ||
runtime: t.Optional[TraineeRuntimeOptions] = None, | ||
runtime: t.Optional[TraineeRuntimeOptions] = None, # noqa ARG002 | ||
) -> Trainee: | ||
""" | ||
Create a Trainee on the Howso service. | ||
|
@@ -856,7 +856,7 @@ def create_trainee( # noqa: C901 | |
self.configuration.verbose, | ||
f'Deleting existing Trainee "{trainee_id}" before creating.') | ||
self.amlg.destroy_entity(trainee_id) | ||
except Exception: # noqa: Deliberately broad | ||
except Exception: # Deliberately broad | ||
util.dprint( | ||
self.configuration.verbose, | ||
f'Unable to delete Trainee "{trainee_id}". Continuing.') | ||
|
@@ -1246,7 +1246,7 @@ def copy_trainee( | |
*, | ||
library_type: t.Optional[LibraryType] = None, | ||
resources: t.Optional[Mapping[str, t.Any]] = None, | ||
runtime: t.Optional[TraineeRuntimeOptions] = None | ||
runtime: t.Optional[TraineeRuntimeOptions] = None # noqa ARG002 | ||
) -> Trainee: | ||
""" | ||
Copies a trainee to a new trainee id in the Howso service. | ||
|
@@ -1349,7 +1349,7 @@ def acquire_trainee_resources( | |
self, | ||
trainee_id: str, | ||
*, | ||
max_wait_time: t.Optional[int | float] = None | ||
max_wait_time: t.Optional[int | float] = None # noqa ARG002 | ||
): | ||
""" | ||
Acquire resources for a trainee in the Howso service. | ||
|
@@ -1511,7 +1511,7 @@ def query_sessions( | |
search_terms: t.Optional[str] = None, | ||
*, | ||
trainee: t.Optional[str | Trainee] = None, | ||
**kwargs | ||
**kwargs # noqa ARG002 | ||
) -> list[Session]: | ||
""" | ||
Return a list of all accessible sessions. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause local .vscode entries to have to be removed before pulling main if merged.