Skip to content

Commit

Permalink
fighting mypy, round #2345235923523099836
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jun 14, 2023
1 parent deabd51 commit 02499c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script.
# It can be safely removed at anytime to force the build script to run again.
# Check out build.rs to see how it's computed.
3d28189eee2aedf7a97ecc05a75d17fc1977826c343fee85d4bbb2b0b48412fc
184f79acfe7c0608f9ec2bb5f6a6783dc2270f5cae0edb147ad08ad4ee89c825
6 changes: 3 additions & 3 deletions crates/re_types_builder/src/codegen/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ fn quote_str_repr_from_obj(obj: &Object) -> String {

unindent::unindent(
r#"
def __str__(self):
def __str__(self) -> str:
s = f"rr.{type(self).__name__}(\n"
from dataclasses import fields
Expand All @@ -482,7 +482,7 @@ fn quote_str_repr_from_obj(obj: &Object) -> String {
return s
def __repr__(self):
def __repr__(self) -> str:
return str(self)
"#,
Expand Down Expand Up @@ -535,7 +535,7 @@ fn quote_str_method_from_obj(objects: &Objects, obj: &Object) -> String {
let field_name = &obj.fields[0].name;
unindent::unindent(&format!(
"
def __str__(self):
def __str__(self) -> str:
return self.{field_name}
",
))
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun_sdk/rerun2/archetypes/points2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Points2D:
Unique identifiers for each individual point in the batch.
"""

def __str__(self):
def __str__(self) -> str:
s = f"rr.{type(self).__name__}(\n"

from dataclasses import fields
Expand All @@ -86,7 +86,7 @@ def __str__(self):

return s

def __repr__(self):
def __repr__(self) -> str:
return str(self)

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion rerun_py/rerun_sdk/rerun2/components/color_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _from_similar(
elif array.dtype.type == np.uint32:
array = np.asarray(data).flatten()
else:
array = np.asarray(data).reshape((-1, 4))
array = np.asarray(data, dtype=np.uint8).reshape((-1, 4))
array = u8_array_to_rgba(array)

return arrow().wrap_array(pa.array(array, type=arrow().storage_type))
2 changes: 1 addition & 1 deletion rerun_py/rerun_sdk/rerun2/components/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Label:

value: str

def __str__(self):
def __str__(self) -> str:
return self.value


Expand Down

0 comments on commit 02499c2

Please sign in to comment.