mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
See #6570. Better column name for import csv.
Change column name for import rate from csv from Rate Cost Schedule to RateSchedule
This commit is contained in:
committed by
Massimo Fabbro
parent
d552f247fa
commit
e28979ceb7
@@ -50,15 +50,8 @@ class CsvHeader(TypedDict):
|
|||||||
Query: NotRequired[int]
|
Query: NotRequired[int]
|
||||||
|
|
||||||
# Assigning rates
|
# Assigning rates
|
||||||
__annotations__ = {
|
RateSchedule: NotRequired[str]
|
||||||
"Rate cost schedule": NotRequired[str],
|
RateID : NotRequired[str]
|
||||||
"RateID": NotRequired[str],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# # Assigning rates
|
|
||||||
# "Rate cost schedule": NotRequired[str]
|
|
||||||
# "RateID" : NotRequired[str]
|
|
||||||
|
|
||||||
|
|
||||||
# Currently we assume that if column is not part of the main header,
|
# Currently we assume that if column is not part of the main header,
|
||||||
@@ -168,7 +161,7 @@ class Csv2Ifc:
|
|||||||
self.has_categories = True
|
self.has_categories = True
|
||||||
self.has_rates = False
|
self.has_rates = False
|
||||||
self.headers = {col: i for i, col in enumerate(row) if col}
|
self.headers = {col: i for i, col in enumerate(row) if col}
|
||||||
if "Rate cost schedule" in self.headers and "RateID" in self.headers:
|
if "RateSchedule" in self.headers and "RateID" in self.headers:
|
||||||
self.has_rates = True
|
self.has_rates = True
|
||||||
if "Value" in self.headers:
|
if "Value" in self.headers:
|
||||||
self.has_categories = False
|
self.has_categories = False
|
||||||
@@ -239,7 +232,7 @@ 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["RateSchedule"])] if "RateSchedule" 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:
|
||||||
|
|||||||
Reference in New Issue
Block a user