mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
maintain snake in api calls
there were only two methods using camel case for arguments
This commit is contained in:
@@ -23,7 +23,7 @@ from typing import Optional
|
||||
|
||||
|
||||
def add_group(
|
||||
file: ifcopenshell.file, Name: str = "Unnamed", Description: Optional[str] = None
|
||||
file: ifcopenshell.file, name: str = "Unnamed", description: Optional[str] = None
|
||||
) -> ifcopenshell.entity_instance:
|
||||
"""Adds a new group
|
||||
|
||||
@@ -37,8 +37,8 @@ def add_group(
|
||||
|
||||
:param Name: The name of the group. Defaults to "Unnamed"
|
||||
:type Name: str, optional
|
||||
:param Description: The description of the purpose of the group.
|
||||
:type Description: str, optional
|
||||
:param description: The description of the purpose of the group.
|
||||
:type description: str, optional
|
||||
:return: The newly created IfcGroup
|
||||
:rtype: ifcopenshell.entity_instance
|
||||
|
||||
@@ -46,11 +46,11 @@ def add_group(
|
||||
|
||||
.. code:: python
|
||||
|
||||
ifcopenshell.api.run("group.add_group", model, Name="Unit 1A")
|
||||
ifcopenshell.api.run("group.add_group", model, name="Unit 1A")
|
||||
"""
|
||||
settings = {
|
||||
"Name": Name or "Unnamed",
|
||||
"Description": Description,
|
||||
"name": name or "Unnamed",
|
||||
"description": description,
|
||||
}
|
||||
|
||||
return file.create_entity(
|
||||
@@ -58,7 +58,7 @@ def add_group(
|
||||
**{
|
||||
"GlobalId": ifcopenshell.guid.new(),
|
||||
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", file),
|
||||
"Name": settings["Name"],
|
||||
"Description": settings["Description"],
|
||||
"Name": settings["name"],
|
||||
"Description": settings["description"],
|
||||
}
|
||||
)
|
||||
|
||||
@@ -42,7 +42,7 @@ def assign_group(
|
||||
|
||||
.. code:: python
|
||||
|
||||
group = ifcopenshell.api.run("group.add_group", model, Name="Furniture")
|
||||
group = ifcopenshell.api.run("group.add_group", model, name="Furniture")
|
||||
ifcopenshell.api.run("group.assign_group", model,
|
||||
products=model.by_type("IfcFurniture"), group=group)
|
||||
"""
|
||||
|
||||
@@ -36,7 +36,7 @@ def edit_group(file: ifcopenshell.file, group: ifcopenshell.entity_instance, att
|
||||
|
||||
.. code:: python
|
||||
|
||||
group = ifcopenshell.api.run("group.add_group", model, Name="Unit 1A")
|
||||
group = ifcopenshell.api.run("group.add_group", model, name="Unit 1A")
|
||||
ifcopenshell.api.run("group.edit_group", model,
|
||||
group=group, attributes={"Description": "All furniture and joinery included in the unit"})
|
||||
"""
|
||||
|
||||
@@ -36,7 +36,7 @@ def remove_group(file: ifcopenshell.file, group: ifcopenshell.entity_instance) -
|
||||
|
||||
.. code:: python
|
||||
|
||||
group = ifcopenshell.api.run("group.add_group", model, Name="Unit 1A")
|
||||
group = ifcopenshell.api.run("group.add_group", model, name="Unit 1A")
|
||||
ifcopenshell.api.run("group.remove_group", model, group=group)
|
||||
"""
|
||||
settings = {"group": group}
|
||||
|
||||
@@ -39,7 +39,7 @@ def unassign_group(
|
||||
|
||||
.. code:: python
|
||||
|
||||
group = ifcopenshell.api.run("group.add_group", model, Name="Furniture")
|
||||
group = ifcopenshell.api.run("group.add_group", model, name="Furniture")
|
||||
furniture = model.by_type("IfcFurniture")
|
||||
ifcopenshell.api.run("group.assign_group", model, products=furniture, group=group)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def update_group_products(
|
||||
|
||||
.. code:: python
|
||||
|
||||
group = ifcopenshell.api.run("group.add_group", model, Name="Furniture")
|
||||
group = ifcopenshell.api.run("group.add_group", model, name="Furniture")
|
||||
ifcopenshell.api.run("group.update_group_products", model,
|
||||
products=model.by_type("IfcFurniture"), group=group)
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user