mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:02:29 +00:00
rename sequence.assign_workplan for consistency
This commit is contained in:
@@ -35,7 +35,7 @@ from .assign_process import assign_process
|
|||||||
from .assign_product import assign_product
|
from .assign_product import assign_product
|
||||||
from .assign_recurrence_pattern import assign_recurrence_pattern
|
from .assign_recurrence_pattern import assign_recurrence_pattern
|
||||||
from .assign_sequence import assign_sequence
|
from .assign_sequence import assign_sequence
|
||||||
from .assign_workplan import assign_workplan
|
from .assign_work_plan import assign_work_plan
|
||||||
from .calculate_task_duration import calculate_task_duration
|
from .calculate_task_duration import calculate_task_duration
|
||||||
from .cascade_schedule import cascade_schedule
|
from .cascade_schedule import cascade_schedule
|
||||||
from .create_baseline import create_baseline
|
from .create_baseline import create_baseline
|
||||||
@@ -81,7 +81,7 @@ __all__ = [
|
|||||||
"assign_product",
|
"assign_product",
|
||||||
"assign_recurrence_pattern",
|
"assign_recurrence_pattern",
|
||||||
"assign_sequence",
|
"assign_sequence",
|
||||||
"assign_workplan",
|
"assign_work_plan",
|
||||||
"calculate_task_duration",
|
"calculate_task_duration",
|
||||||
"cascade_schedule",
|
"cascade_schedule",
|
||||||
"create_baseline",
|
"create_baseline",
|
||||||
|
|||||||
+2
-3
@@ -20,8 +20,7 @@ import ifcopenshell
|
|||||||
import ifcopenshell.api
|
import ifcopenshell.api
|
||||||
|
|
||||||
|
|
||||||
# TODO: rename to assign_work_plan for consistency
|
def assign_work_plan(
|
||||||
def assign_workplan(
|
|
||||||
file: ifcopenshell.file, work_schedule: ifcopenshell.entity_instance, work_plan: ifcopenshell.entity_instance
|
file: ifcopenshell.file, work_schedule: ifcopenshell.entity_instance, work_plan: ifcopenshell.entity_instance
|
||||||
) -> ifcopenshell.entity_instance:
|
) -> ifcopenshell.entity_instance:
|
||||||
"""Assigns a work schedule to a work plan
|
"""Assigns a work schedule to a work plan
|
||||||
@@ -48,7 +47,7 @@ def assign_workplan(
|
|||||||
schedule = ifcopenshell.api.run("sequence.add_work_schedule", model, name="Construction Schedule A")
|
schedule = ifcopenshell.api.run("sequence.add_work_schedule", model, name="Construction Schedule A")
|
||||||
|
|
||||||
# ... you can assign the work plan afterwards.
|
# ... you can assign the work plan afterwards.
|
||||||
ifcopenshell.api.run("sequence.assign_workplan", work_schedule=schedule, work_plan=work_plan)
|
ifcopenshell.api.run("sequence.assign_work_plan", work_schedule=schedule, work_plan=work_plan)
|
||||||
"""
|
"""
|
||||||
settings = {"work_schedule": work_schedule, "work_plan": work_plan}
|
settings = {"work_schedule": work_schedule, "work_plan": work_plan}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ class TestRemoveWorkPlan(test.bootstrap.IFC4):
|
|||||||
self.file.create_entity("IfcProject")
|
self.file.create_entity("IfcProject")
|
||||||
work_plan = ifcopenshell.api.sequence.add_work_plan(self.file)
|
work_plan = ifcopenshell.api.sequence.add_work_plan(self.file)
|
||||||
work_schedule = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
work_schedule = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
||||||
ifcopenshell.api.sequence.assign_workplan(self.file, work_schedule, work_plan)
|
ifcopenshell.api.sequence.assign_work_plan(self.file, work_schedule, work_plan)
|
||||||
ifcopenshell.api.sequence.remove_work_plan(self.file, work_plan=work_plan)
|
ifcopenshell.api.sequence.remove_work_plan(self.file, work_plan=work_plan)
|
||||||
assert len(self.file.by_type("IfcWorkPlan")) == 0
|
assert len(self.file.by_type("IfcWorkPlan")) == 0
|
||||||
assert declared_objects(self.file) == set()
|
assert declared_objects(self.file) == set()
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class TestRemoveWorkSchedule(test.bootstrap.IFC4):
|
|||||||
work_schedule = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
work_schedule = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
||||||
|
|
||||||
work_plan = ifcopenshell.api.sequence.add_work_plan(self.file)
|
work_plan = ifcopenshell.api.sequence.add_work_plan(self.file)
|
||||||
ifcopenshell.api.sequence.assign_workplan(self.file, work_schedule, work_plan)
|
ifcopenshell.api.sequence.assign_work_plan(self.file, work_schedule, work_plan)
|
||||||
|
|
||||||
work_schedule1 = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
work_schedule1 = ifcopenshell.api.sequence.add_work_schedule(self.file)
|
||||||
rel = self.file.create_entity("IfcRelDefinesByObject")
|
rel = self.file.create_entity("IfcRelDefinesByObject")
|
||||||
|
|||||||
Reference in New Issue
Block a user