Skip to content

Commit

Permalink
style(code): Fix various PEP8 issues in the code
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jan 15, 2025
1 parent 272a675 commit c83f200
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
7 changes: 4 additions & 3 deletions honeybee_energy/construction/air.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from honeybee.typing import valid_ep_string, float_positive
from ..properties.extension import AirBoundaryConstructionProperties


@lockable
class AirBoundaryConstruction(object):
"""Construction for Faces with an AirBoundary face type.
Expand Down Expand Up @@ -130,7 +131,7 @@ def user_data(self, value):
def thickness(self):
"""Thickness of the construction, always zero for air boundary construction."""
return 0

@property
def properties(self):
"""Get the properties object for this construction."""
Expand Down Expand Up @@ -207,8 +208,8 @@ def to_idf(self):
Note that the to_air_mixing_idf method must also be used to write air
mixing objects into the IDF for each Face that has the construction
assigned to it.
.. code-block:: shell
.. code-block:: shell
Construction:AirBoundary,
Air Wall, !- Name
Expand Down
6 changes: 3 additions & 3 deletions honeybee_energy/constructionset.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def __copy__(self):
new_obj = self.__class__(
self._exterior_construction, self._interior_construction,
self._ground_construction)
return(new_obj)
return new_obj

def __repr__(self):
return 'Base Face Set'
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def __copy__(self):
self._window_construction, self._interior_construction,
self._skylight_construction, self._operable_construction
)
return(new_obj)
return new_obj

def __repr__(self):
return 'Aperture Construction Set: [Window: {}] [Interior: {}]' \
Expand Down Expand Up @@ -1596,7 +1596,7 @@ def __copy__(self):
self._exterior_construction, self._interior_construction,
self._exterior_glass_construction, self._interior_glass_construction,
self._overhead_construction)
return(new_obj)
return new_obj

def __repr__(self):
return 'Door Construction Set: [Exterior: {}] [Interior: {}]' \
Expand Down
2 changes: 1 addition & 1 deletion honeybee_energy/schedule/day.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def to_idf(self, schedule_type_limit=None):
"""IDF string representation of ScheduleDay object.
Args:
schedule_type_limits: Optional ScheduleTypeLimit object, which will
schedule_type_limit: Optional ScheduleTypeLimit object, which will
be written into the IDF string in order to validate the values
within the schedule during the EnergyPlus run.
Expand Down
2 changes: 1 addition & 1 deletion honeybee_energy/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def model_to_idf(
# must be imported here to avoid circular imports
from .lib.constructions import air_boundary

# write all of the zone geometry
# write all of the room geometry
model_str.append('!- ============ ROOM GEOMETRY ============\n')
ap_objs = []
found_ab = []
Expand Down
14 changes: 7 additions & 7 deletions tests/construction_extend_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from honeybee_energy.construction.window import WindowConstruction
from honeybee_energy.construction.windowshade import WindowConstructionShade
from honeybee_energy.properties.extension import WindowConstructionShadeProperties
from honeybee_energy.construction.window import WindowConstruction
from honeybee_energy.material.glazing import EnergyWindowMaterialGlazing
from honeybee_energy.material.gas import EnergyWindowMaterialGas
from honeybee_energy.material.shade import EnergyWindowMaterialShade


def test_energy_properties():
# -- Build the Window Construction
clear_glass = EnergyWindowMaterialGlazing(
Expand All @@ -14,19 +14,18 @@ def test_energy_properties():
gap = EnergyWindowMaterialGas('air gap', thickness=0.0127)
construction_window = WindowConstruction(
'Triple Pane', [clear_glass, gap, clear_glass, gap, clear_glass])

# -- Build the Shade Construction
material_shade = EnergyWindowMaterialShade("test_shade_material")
construction_shade = WindowConstructionShade(
"test_construction_shade", construction_window, material_shade)

# --

assert hasattr(construction_shade, "properties")
assert isinstance(
construction_shade.properties, WindowConstructionShadeProperties)
assert construction_shade.identifier == "test_construction_shade"
assert construction_shade.window_construction == construction_window


def test_shade_construction_dict_round_trip():
# -- Build the Window Construction
clear_glass = EnergyWindowMaterialGlazing(
Expand All @@ -35,16 +34,17 @@ def test_shade_construction_dict_round_trip():
gap = EnergyWindowMaterialGas('air gap', thickness=0.0127)
construction_window = WindowConstruction(
'Triple Pane', [clear_glass, gap, clear_glass, gap, clear_glass])

# -- Build the Shade Construction
material_shade = EnergyWindowMaterialShade("test_shade_material")
c1 = WindowConstructionShade(
"test_c1", construction_window, material_shade)

d1 = c1.to_dict()
c2 = WindowConstructionShade.from_dict(d1)
assert c2.to_dict() == d1


def test_duplicate_shade_construction():
# -- Build the Window Construction
clear_glass = EnergyWindowMaterialGlazing(
Expand All @@ -53,7 +53,7 @@ def test_duplicate_shade_construction():
gap = EnergyWindowMaterialGas('air gap', thickness=0.0127)
construction_window = WindowConstruction(
'Triple Pane', [clear_glass, gap, clear_glass, gap, clear_glass])

# -- Build the Shade Construction
material_shade = EnergyWindowMaterialShade("test_shade_material")
c1 = WindowConstructionShade(
Expand Down
1 change: 0 additions & 1 deletion tests/constructionset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def test_constructionset_dict_methods(userdatadict):
insulated_set.aperture_set.window_construction = triple_clear
insulated_set.user_data = userdatadict
constr_dict = insulated_set.to_dict()


assert constr_dict['wall_set']['exterior_construction'] is None
assert constr_dict['wall_set']['interior_construction'] is None
Expand Down
1 change: 1 addition & 0 deletions tests/material_gas_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest
from .fixtures.userdata_fixtures import userdatadict


def test_gas_init(userdatadict):
"""Test the initalization of gas material objects and basic properties."""
air = EnergyWindowMaterialGas('Air Gap', 0.0125, 'Air')
Expand Down

0 comments on commit c83f200

Please sign in to comment.