Skip to content

Commit 92c979f

Browse files
committed
black .
1 parent 8834a51 commit 92c979f

27 files changed

Lines changed: 121 additions & 271 deletions

File tree

nix/build-all.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,24 +315,18 @@ def get_pyodide_build_version() -> "tuple[int, ...]":
315315
cecho(f"* Dependency Directory = {DEPS_DIR}", MAGENTA)
316316
cecho(f" - The directory where {PROJECT_NAME} dependencies are installed.")
317317
cecho(f"* Build Config Type = {BUILD_CFG}", MAGENTA)
318-
cecho(
319-
""" - The used build configuration type for the dependencies.
320-
Defaults to RelWithDebInfo if not specified."""
321-
)
318+
cecho(""" - The used build configuration type for the dependencies.
319+
Defaults to RelWithDebInfo if not specified.""")
322320

323321
if BUILD_CFG == "MinSizeRel":
324322
cecho(" WARNING: MinSizeRel build can suffer from a significant performance loss.", RED)
325323

326324
cecho(f"* IFCOS_NUM_BUILD_PROCS = {IFCOS_NUM_BUILD_PROCS}", MAGENTA)
327-
cecho(
328-
""" - How many compiler processes may be run in parallel.
329-
"""
330-
)
325+
cecho(""" - How many compiler processes may be run in parallel.
326+
""")
331327
cecho(f" * IFCOS_SCHEMAS = '{os.environ.get('IFCOS_SCHEMAS')}'", MAGENTA)
332-
cecho(
333-
""" - IFC Schemas to compile. If not provided, fallback to default provided in cmake.
334-
"""
335-
)
328+
cecho(""" - IFC Schemas to compile. If not provided, fallback to default provided in cmake.
329+
""")
336330

337331
dependency_tree: "dict[str, tuple[str, ...]]" = {
338332
"IfcParse": ("boost", "libxml2", "hdf5", "rocksdb"),

src/bcf/bcf/v3/bcfapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
class OAuthReceiver(http.server.BaseHTTPRequestHandler):
3535
def do_GET(self) -> None:
3636
query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
37-
self.server.auth_code = query.get("code", [""])[0] # type:ignore
38-
self.server.auth_state = query.get("state", [""])[0] # type:ignore
37+
self.server.auth_code = query.get("code", [""])[0] # type: ignore
38+
self.server.auth_state = query.get("state", [""])[0] # type: ignore
3939
self.send_response(200)
4040
self.send_header("Content-type", "text/plain")
4141
self.end_headers()

src/bonsai/bonsai/bim/module/brick/data.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def active_relations(cls):
6363
if namespace == "https://brickschema.org/schema/Brick":
6464
return []
6565
results = []
66-
query = BrickStore.graph.query(
67-
"""
66+
query = BrickStore.graph.query("""
6867
PREFIX brick: <https://brickschema.org/schema/Brick#>
6968
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
7069
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -81,10 +80,7 @@ def active_relations(cls):
8180
}
8281
}
8382
GROUP BY ?object
84-
""".replace(
85-
"{uri}", uri
86-
)
87-
)
83+
""".replace("{uri}", uri))
8884
for row in query:
8985
predicate_uri = row.get("predicate")
9086
predicate_name = predicate_uri.toPython().split("#")[-1]

src/bonsai/bonsai/bim/module/drawing/shaders.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,9 @@ class BaseLinesShader(BaseShader):
335335

336336
TYPE = "LINES"
337337

338-
DEF_GLSL = (
339-
BaseShader.DEF_GLSL
340-
+ """
338+
DEF_GLSL = BaseShader.DEF_GLSL + """
341339
#define GAP_SIZE {gap_size}
342340
"""
343-
)
344341

345342
GEOM_GLSL = """
346343
layout(lines) in;
@@ -401,13 +398,10 @@ class DotsGizmoShader(GizmoShader):
401398

402399
TYPE = "POINTS"
403400

404-
DEF_GLSL = (
405-
BaseShader.DEF_GLSL
406-
+ """
401+
DEF_GLSL = BaseShader.DEF_GLSL + """
407402
#define CIRCLE_SEGMENTS 12
408403
#define CIRCLE_RADIUS 8
409404
"""
410-
)
411405

412406
GEOM_GLSL = """
413407
layout(points) in;

src/bonsai/bonsai/bim/module/structural/shader.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ def new(
5858
"PLANAR LOAD",
5959
}
6060
if pattern not in valid_patterns:
61-
raise ValueError(
62-
"""pattern must be one of:
61+
raise ValueError("""pattern must be one of:
6362
PERPENDICULAR DISTRIBUTED FORCE
6463
PARALLEL DISTRIBUTED FORCE,
6564
DISTRIBUTED MOMENT,
6665
SINGLE FORCE,
6766
SINGLE MOMENT,
68-
PLANAR LOAD"""
69-
)
67+
PLANAR LOAD""")
7068
if "DISTRIBUTED" in pattern.upper():
7169
shader = self.get_linear_shader(pattern)
7270
return shader

src/bonsai/bonsai/bim/ui.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
from bonsai.bim.module.pset.prop import IfcProperty
5656
from bonsai.bim.prop import Attribute
5757

58-
5958
if TYPE_CHECKING:
6059
from bonsai.bim.module.project.prop import BIMProjectProperties
6160
from bonsai.bim.prop import ObjProperty

src/bonsai/bonsai/tool/brick.py

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,13 @@ def clear_project(cls) -> None:
164164

165165
@classmethod
166166
def export_brick_attributes(cls, brick_uri: str) -> dict[str, Any]:
167-
query = BrickStore.graph.query(
168-
"""
167+
query = BrickStore.graph.query("""
169168
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
170169
SELECT ?label {
171170
<{brick_uri}> rdfs:label ?label .
172171
}
173172
LIMIT 1
174-
""".replace(
175-
"{brick_uri}", brick_uri
176-
)
177-
)
173+
""".replace("{brick_uri}", brick_uri))
178174
name = None
179175
for row in query:
180176
name = str(row.get("label"))
@@ -218,18 +214,14 @@ def get_brick_path_name(cls) -> str:
218214
@classmethod
219215
def get_brickifc_project(cls) -> Union[str, None]:
220216
project = tool.Ifc.get().by_type("IfcProject")[0]
221-
query = BrickStore.graph.query(
222-
"""
217+
query = BrickStore.graph.query("""
223218
PREFIX ref: <https://brickschema.org/schema/Brick/ref#>
224219
SELECT ?proj WHERE {
225220
?proj a ref:ifcProject .
226221
?proj ref:ifcProjectID "{project_globalid}" .
227222
}
228223
LIMIT 1
229-
""".replace(
230-
"{project_globalid}", project.GlobalId
231-
)
232-
)
224+
""".replace("{project_globalid}", project.GlobalId))
233225
results = list(query)
234226
if results:
235227
return results[0][0].toPython()
@@ -275,17 +267,13 @@ def get_element_feeds(cls, element: ifcopenshell.entity_instance) -> set[ifcopen
275267

276268
@classmethod
277269
def get_item_class(cls, item: str) -> Union[str, None]:
278-
query = BrickStore.graph.query(
279-
"""
270+
query = BrickStore.graph.query("""
280271
PREFIX brick: <https://brickschema.org/schema/Brick#>
281272
SELECT ?class WHERE {
282273
<{item}> a ?class .
283274
}
284275
LIMIT 1
285-
""".replace(
286-
"{item}", item
287-
)
288-
)
276+
""".replace("{item}", item))
289277
for row in query:
290278
return row.get("class").toPython().split("#")[-1]
291279

@@ -308,8 +296,7 @@ def get_namespace(cls, uri: str) -> str:
308296

309297
@classmethod
310298
def import_brick_classes(cls, brick_class: str, split_screen: bool = False) -> None:
311-
query = BrickStore.graph.query(
312-
"""
299+
query = BrickStore.graph.query("""
313300
PREFIX brick: <https://brickschema.org/schema/Brick#>
314301
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
315302
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -322,10 +309,7 @@ def import_brick_classes(cls, brick_class: str, split_screen: bool = False) -> N
322309
}
323310
GROUP BY ?group
324311
ORDER BY asc(?group)
325-
""".replace(
326-
"{brick_class}", brick_class
327-
)
328-
)
312+
""".replace("{brick_class}", brick_class))
329313
props = tool.Brick.get_brick_props()
330314
if split_screen:
331315
bricks = props.split_screen_bricks
@@ -342,8 +326,7 @@ def import_brick_classes(cls, brick_class: str, split_screen: bool = False) -> N
342326

343327
@classmethod
344328
def import_brick_items(cls, brick_class: str, split_screen: bool = False) -> None:
345-
query = BrickStore.graph.query(
346-
"""
329+
query = BrickStore.graph.query("""
347330
PREFIX brick: <https://brickschema.org/schema/Brick#>
348331
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
349332
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -354,10 +337,7 @@ def import_brick_items(cls, brick_class: str, split_screen: bool = False) -> Non
354337
}
355338
}
356339
ORDER BY asc(?item)
357-
""".replace(
358-
"{brick_class}", brick_class
359-
)
360-
)
340+
""".replace("{brick_class}", brick_class))
361341
props = tool.Brick.get_brick_props()
362342
if split_screen:
363343
bricks = props.split_screen_bricks
@@ -507,8 +487,7 @@ def get_project(cls) -> brickschema.graph.Graph:
507487

508488
@classmethod
509489
def load_sub_roots(cls) -> None:
510-
query = BrickStore.graph.query(
511-
"""
490+
query = BrickStore.graph.query("""
512491
PREFIX brick: <https://brickschema.org/schema/Brick#>
513492
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
514493
SELECT ?subRoot ?subClasses WHERE {
@@ -525,8 +504,7 @@ def load_sub_roots(cls) -> None:
525504
}
526505
FILTER(?subClasses > 3)
527506
}
528-
"""
529-
)
507+
""")
530508
for row in query:
531509
sub_root = row.get("subRoot").toPython().split("#")[-1]
532510
BrickStore.root_classes.append(sub_root)
@@ -558,8 +536,7 @@ def load_namespaces(cls) -> None:
558536
@classmethod
559537
def load_entity_classes(cls) -> None:
560538
for root_class in BrickStore.root_classes:
561-
query = BrickStore.graph.query(
562-
"""
539+
query = BrickStore.graph.query("""
563540
PREFIX brick: <https://brickschema.org/schema/Brick#>
564541
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
565542
PREFIX owl: <http://www.w3.org/2002/07/owl#>
@@ -569,25 +546,20 @@ def load_entity_classes(cls) -> None:
569546
?class owl:deprecated true .
570547
}
571548
}
572-
""".replace(
573-
"{root_class}", root_class
574-
)
575-
)
549+
""".replace("{root_class}", root_class))
576550
BrickStore.entity_classes[root_class] = []
577551
for uri in sorted([x[0].toPython() for x in query]):
578552
BrickStore.entity_classes[root_class].append(uri)
579553

580554
@classmethod
581555
def load_relationships(cls) -> None:
582-
query = BrickStore.graph.query(
583-
"""
556+
query = BrickStore.graph.query("""
584557
PREFIX brick: <https://brickschema.org/schema/Brick#>
585558
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
586559
SELECT DISTINCT ?relation WHERE {
587560
?relation rdfs:subPropertyOf brick:Relationship .
588561
}
589-
"""
590-
)
562+
""")
591563
for uri in sorted([x[0].toPython() for x in query]):
592564
BrickStore.relationships.append(uri)
593565

src/bonsai/bonsai/tool/drawing.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,16 +2710,14 @@ def convert_scale_string(cls, value: str) -> float:
27102710
return float(value)
27112711
except:
27122712
pass # Perhaps it's imperial?
2713-
l = lark.Lark(
2714-
"""start: feet? "-"? inches?
2713+
l = lark.Lark("""start: feet? "-"? inches?
27152714
feet: NUMBER? "-"? fraction? "'"
27162715
inches: NUMBER? "-"? fraction? "\\""
27172716
fraction: NUMBER "/" NUMBER
27182717
%import common.NUMBER
27192718
%import common.WS
27202719
%ignore WS // Disregard spaces in text
2721-
"""
2722-
)
2720+
""")
27232721

27242722
try:
27252723
start = l.parse(value)

src/bonsai/scripts/classifications/brick_classifiction.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def generate(self):
2222
}
2323
)
2424

25-
query = self.schema.query(
26-
"""
25+
query = self.schema.query("""
2726
PREFIX brick: <https://brickschema.org/schema/Brick#>
2827
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2928
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
@@ -49,8 +48,7 @@ def generate(self):
4948
}
5049
}
5150
GROUP BY ?entity
52-
"""
53-
)
51+
""")
5452

5553
# create references dictionary
5654
references = {}
@@ -76,17 +74,13 @@ def generate(self):
7674
)
7775

7876
# get all parents of the entity
79-
query = self.schema.query(
80-
"""
77+
query = self.schema.query("""
8178
PREFIX brick: <https://brickschema.org/schema/Brick#>
8279
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8380
SELECT ?parent WHERE {
8481
brick:{entity} rdfs:subClassOf ?parent .
8582
}
86-
""".replace(
87-
"{entity}", location.split("#")[-1]
88-
)
89-
)
83+
""".replace("{entity}", location.split("#")[-1]))
9084
# filter parents for the brick entity
9185
for row in query:
9286
parent = row.get("parent").toPython()

src/bonsai/scripts/reregister_bonsai.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
to ensure disable and enable occur in the same Blender session.
2424
"""
2525

26-
2726
import bpy
2827

2928
import bonsai.tool as tool

0 commit comments

Comments
 (0)