mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 00:32:38 +00:00
Black
This commit is contained in:
committed by
Massimo Fabbro
parent
f75d629990
commit
25c0ed6759
@@ -26,8 +26,8 @@ import ifcopenshell.util.unit
|
|||||||
import ifcopenshell.util.selector
|
import ifcopenshell.util.selector
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
import locale
|
import locale
|
||||||
import bonsai.tool as tool #i need that because there are useful tool there
|
import bonsai.tool as tool # i need that because there are useful tool there
|
||||||
import bonsai.core as core #i need that because there is useful core function
|
import bonsai.core as core # i need that because there is useful core function
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Union, Optional, TypedDict
|
from typing import Union, Optional, TypedDict
|
||||||
from typing_extensions import NotRequired
|
from typing_extensions import NotRequired
|
||||||
@@ -239,8 +239,8 @@ class Csv2Ifc:
|
|||||||
|
|
||||||
if self.has_rates:
|
if self.has_rates:
|
||||||
cost_rate = {
|
cost_rate = {
|
||||||
"Schedule" : row[(self.headers["Rate cost schedule"])] if "Rate cost schedule" in self.headers else None,
|
"Schedule": row[(self.headers["Rate cost schedule"])] if "Rate cost schedule" in self.headers else None,
|
||||||
"RateID" : row[(self.headers["RateID"])] if "RateID" in self.headers else None,
|
"RateID": row[(self.headers["RateID"])] if "RateID" in self.headers else None,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
cost_rate = None
|
cost_rate = None
|
||||||
@@ -329,7 +329,7 @@ class Csv2Ifc:
|
|||||||
assert isinstance(cost_rate, dict)
|
assert isinstance(cost_rate, dict)
|
||||||
|
|
||||||
if cost_rate.get("Schedule") and cost_rate.get("RateID"):
|
if cost_rate.get("Schedule") and cost_rate.get("RateID"):
|
||||||
#if cost_rate["Schedule"] is not "":
|
# if cost_rate["Schedule"] is not "":
|
||||||
schedules = self.file.by_type("IfcCostSchedule")
|
schedules = self.file.by_type("IfcCostSchedule")
|
||||||
for schedule in schedules:
|
for schedule in schedules:
|
||||||
if schedule.Name == cost_rate["Schedule"]:
|
if schedule.Name == cost_rate["Schedule"]:
|
||||||
@@ -345,10 +345,7 @@ class Csv2Ifc:
|
|||||||
break
|
break
|
||||||
if rate_cost_item:
|
if rate_cost_item:
|
||||||
core.cost.assign_cost_value(
|
core.cost.assign_cost_value(
|
||||||
tool.Ifc,
|
tool.Ifc, tool.Cost, cost_item=cost_item["ifc"], cost_rate=rate_cost_item
|
||||||
tool.Cost,
|
|
||||||
cost_item=cost_item["ifc"],
|
|
||||||
cost_rate=rate_cost_item
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print(f"No cost item found with RateID={cost_rate['RateID']}")
|
print(f"No cost item found with RateID={cost_rate['RateID']}")
|
||||||
|
|||||||
Reference in New Issue
Block a user