Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-f-cruz committed Jul 22, 2024
1 parent e1da101 commit 4902243
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 21 deletions.
5 changes: 1 addition & 4 deletions scripts/regenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ def main():
namespace=f"{NAMESPACE_PREFIX}.AindBehaviorSession",
)

convert_pydantic_to_bonsai(
{"aind_behavior_data_types": DataTypes},
schema_path=SCHEMA_ROOT, skip_sgen=True
)
convert_pydantic_to_bonsai({"aind_behavior_data_types": DataTypes}, schema_path=SCHEMA_ROOT, skip_sgen=True)

convert_pydantic_to_bonsai(
{"aind_behavior_subject_database": db_utils.SubjectDataBase},
Expand Down
1 change: 0 additions & 1 deletion src/DataSchemas/aind_behavior_services/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def __get_pydantic_json_schema__(


def coerce_schema_version(cls: BaseModel, v: str) -> str:

try: # Get the default schema version from the model literal field
_default_schema_version = Version.parse(get_args(cls.model_fields["version"].annotation)[0])
except IndexError: # This handles the case where the base class does not define a literal schema_version value
Expand Down
3 changes: 0 additions & 3 deletions src/DataSchemas/aind_behavior_services/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ def _make_folder(folder: os.PathLike | str) -> None:


class LauncherCli(Generic[TRig, TSession, TTaskLogic]):

def __init__(
self,
rig_schema: Type[TRig],
Expand All @@ -527,7 +526,6 @@ def __init__(
repository_dir: Optional[os.PathLike | str] = None,
**launcher_kwargs,
) -> None:

parser = self._get_default_arg_parser()
args, _ = parser.parse_known_args()

Expand Down Expand Up @@ -577,7 +575,6 @@ def _validate_dependencies(self) -> None:

@staticmethod
def _get_default_arg_parser() -> argparse.ArgumentParser:

parser = argparse.ArgumentParser()

parser.add_argument("--data_dir", help="Specify the data directory")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class TaskParameters(curriculum_task.TaskParameters):


class AindBehaviorTaskLogicModel(curriculum_task.Task):

task_parameters: TaskParameters = Field(..., description="Parameters of the task logic", validate_default=True)
version: str = Field(..., pattern=curriculum_task.SEMVER_REGEX, description="task schema version")

Expand Down
4 changes: 0 additions & 4 deletions src/DataSchemas/aind_behavior_services/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ def convert_pydantic_to_bonsai(
skip_sgen: bool = False,
export_schema_kwargs: Dict[str, Any] = {},
) -> Dict[str, Optional[CompletedProcess]]:

def _write_json(schema_path: PathLike, output_model_name: str, model: ModelInputTypeSignature) -> None:
with open(os.path.join(schema_path, f"{output_model_name}.json"), "w", encoding="utf-8") as f:
json_model = export_schema(model, **export_schema_kwargs)
Expand Down Expand Up @@ -325,7 +324,6 @@ def _build_bonsai_process_command(
layout: Optional[PathLike | str] = None,
additional_properties: Optional[Dict[str, str]] = None,
) -> str:

output_cmd: str = f'"{bonsai_exe}" "{workflow_file}"'
if is_editor_mode:
if is_start_flag:
Expand Down Expand Up @@ -353,7 +351,6 @@ def run_bonsai_process(
timeout: Optional[float] = None,
print_cmd: bool = False,
) -> CompletedProcess:

output_cmd = _build_bonsai_process_command(
workflow_file=workflow_file,
bonsai_exe=bonsai_exe,
Expand Down Expand Up @@ -381,7 +378,6 @@ def open_bonsai_process(
creation_flags: Optional[int] = None,
print_cmd: bool = False,
) -> subprocess.Popen:

output_cmd = _build_bonsai_process_command(
workflow_file=workflow_file,
bonsai_exe=bonsai_exe,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_bonsai.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@


class BonsaiTests(unittest.TestCase):

def test_deserialization(self):

tested_modules = [
"aind_manipulator",
"load_cells",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" testing examples """
"""testing examples"""

import glob
import unittest
Expand Down
3 changes: 0 additions & 3 deletions tests/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@


class LauncherTests(unittest.TestCase):

def test_instance(self):

__version__ = "0.1.0"

class AindGenericTaskRig(AindBehaviorRigModel):
Expand All @@ -38,7 +36,6 @@ class AindGenericTaskTaskLogic(AindBehaviorTaskLogicModel):
self.assertTrue("This is broken" in context.exception)

def test_launcher_cli(self):

__version__ = "0.1.0"

class AindGenericTaskRig(AindBehaviorRigModel):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_schema_version_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ class AindBehaviorRigModelPost(AindBehaviorTaskLogicModel):


class SchemaVersionCoercionTest(unittest.TestCase):

def test_version_update_coercion(self):

pre_instance = AindBehaviorRigModelPre()
post_instance = AindBehaviorRigModelPost()
with warnings.catch_warnings():
Expand Down

0 comments on commit 4902243

Please sign in to comment.