From 2246ff2d3724db329abab266f4bf8b4296a33353 Mon Sep 17 00:00:00 2001 From: Kenneth Yang Date: Fri, 5 Apr 2024 09:42:16 -0700 Subject: [PATCH] fix: linting errors --- src/vbl_aquarium/build.py | 2 +- src/vbl_aquarium/models/dock.py | 14 ++++++----- src/vbl_aquarium/models/generic.py | 7 +++++- src/vbl_aquarium/models/urchin.py | 37 +++++++++++++++++++----------- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/vbl_aquarium/build.py b/src/vbl_aquarium/build.py index 1c9f11a..ac4b463 100644 --- a/src/vbl_aquarium/build.py +++ b/src/vbl_aquarium/build.py @@ -57,7 +57,7 @@ def remove_ignored_classes(module): # Move using statement to top output = "using System;\n" + output - + if "using UnityEngine;" in output: output = "using UnityEngine;\n" + output.replace("using UnityEngine;", "") diff --git a/src/vbl_aquarium/models/dock.py b/src/vbl_aquarium/models/dock.py index 76b0bf4..964d5ed 100644 --- a/src/vbl_aquarium/models/dock.py +++ b/src/vbl_aquarium/models/dock.py @@ -13,17 +13,19 @@ class UploadModel(VBLBaseModel): data: str password: str + class DownloadModel(VBLBaseModel): password: str + # Models for sending save/load messages class SaveModel(VBLBaseModel): - filename: str = '' - bucket: str = '' - password: str = '' + filename: str = "" + bucket: str = "" + password: str = "" class LoadModel(VBLBaseModel): - filename: str = '' - bucket: str = '' - password: str = '' + filename: str = "" + bucket: str = "" + password: str = "" diff --git a/src/vbl_aquarium/models/generic.py b/src/vbl_aquarium/models/generic.py index e1266e3..d44c8ab 100644 --- a/src/vbl_aquarium/models/generic.py +++ b/src/vbl_aquarium/models/generic.py @@ -10,10 +10,12 @@ class IDData(VBLBaseModel): id: str = Field(..., alias="ID") + class Vector2Data(VBLBaseModel): - id: str = Field(alias= "ID") + id: str = Field(alias="ID") value: Vector2 + class Vector3Data(VBLBaseModel): id: str = Field(..., alias="ID") value: Vector3 @@ -80,14 +82,17 @@ class BoolList(VBLBaseModel): class IDList(VBLBaseModel): ids: list[str] = Field(..., alias="IDs") + class IDListVector2Data(VBLBaseModel): ids: list[str] = Field(..., alias="IDs") value: Vector2 + class IDListVector2List(VBLBaseModel): ids: list[str] = Field(..., alias="IDs") values: list[Vector2] + class IDListVector3Data(VBLBaseModel): ids: list[str] = Field(..., alias="IDs") value: Vector3 diff --git a/src/vbl_aquarium/models/urchin.py b/src/vbl_aquarium/models/urchin.py index 765862c..53342dd 100644 --- a/src/vbl_aquarium/models/urchin.py +++ b/src/vbl_aquarium/models/urchin.py @@ -72,14 +72,16 @@ class CameraMode(str, Enum): zoom: float = 16 pan: Vector2 = Vector2() mode: CameraMode = CameraMode.orthographic - background_color: Color = Color() # white by default + background_color: Color = Color() # white by default controllable: bool = True main: bool = False + class CameraRotationModel(VBLBaseModel): start_rotation: Vector3 end_rotation: Vector3 + # Individual mesh neuron @@ -96,15 +98,19 @@ class MeshModel(VBLBaseModel): material: str interactive: bool + # Lines - + + class LineModel(VBLBaseModel): id: str = Field(alias="ID") - positions: list[Vector3] = [] + positions: list[Vector3] = Field(default_factory=list) color: Color = Color() + # Probes - + + class ProbeModel(VBLBaseModel): id: str = Field(alias="ID") position: Vector3 @@ -113,30 +119,35 @@ class ProbeModel(VBLBaseModel): style: str scale: Vector3 + # Particle group class ParticleSystemModel(VBLBaseModel): id: str = Field(alias="ID") n: int - material: str = 'circle' + material: str = "circle" + + positions: list[Vector3] = Field(default_factory=list) + sizes: list[float] = Field(default_factory=list) + colors: list[Color] = Field(default_factory=list) - positions: list[Vector3] = [] - sizes: list[float] = [] - colors: list[Color] = [] # Text - + + class TextModel(VBLBaseModel): id: str = Field(alias="ID") text: str - color: Color = Color(r = 0, g = 0, b = 0) + color: Color = Color(r=0, g=0, b=0) font_size: int = 12 position: Vector2 = Vector2() + # Utilities - + + class ColormapModel(VBLBaseModel): - name: str = '' + name: str = "" min: float = 0 - max: float = 1 \ No newline at end of file + max: float = 1