Skip to content

Commit

Permalink
Merge pull request #10 from peteryefi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
peteryefi authored Oct 22, 2024
2 parents da9e926 + 4c81d25 commit b6d594b
Show file tree
Hide file tree
Showing 222 changed files with 938 additions and 941 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.2
current_version = 1.0.2b1
commit = True
tag = True

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
.coverage
.bumpversion.cfg
.bumpversion.cfg
.DS_Store
6 changes: 5 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
include README.md
include requirements.txt
include LICENSE
exclude tests/*
exclude .github/*
exclude .github/*
exclude relationship/*
exclude venv/*
recursive-include metamenth *
74 changes: 37 additions & 37 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,39 @@ Read the documentation here: [MetamEnTh Documentation](https://github.com/petery
./run_tests.sh
### Example usage
```python
from unittest import TestCase
from misc import MeasureFactory
from enumerations import RecordingType
from datatypes.measure import Measure
from enumerations import MeasurementUnit
from structure.open_space import OpenSpace
from enumerations import OpenSpaceType
from enumerations import RoomType
from structure.room import Room
from structure.floor import Floor
from enumerations import FloorType
from structure.building import Building
from enumerations import BuildingType
from datatypes.address import Address
from structure.layer import Layer
from structure.material import Material
from enumerations import MaterialType
from enumerations import LayerRoughness
from structure.cover import Cover
from structure.envelope import Envelope
from enumerations import CoverType
from metamenth.misc import MeasureFactory
from metamenth.enumerations import RecordingType
from metamenth.datatypes.measure import Measure
from metamenth.enumerations import MeasurementUnit
from metamenth.structure.open_space import OpenSpace
from metamenth.enumerations import OpenSpaceType
from metamenth.enumerations import RoomType
from metamenth.structure.room import Room
from metamenth.structure.floor import Floor
from metamenth.enumerations import FloorType
from metamenth.structure.building import Building
from metamenth.enumerations import BuildingType
from metamenth.datatypes.address import Address
from metamenth.structure.layer import Layer
from metamenth.structure.material import Material
from metamenth.enumerations import MaterialType
from metamenth.enumerations import LayerRoughness
from metamenth.structure.cover import Cover
from metamenth.structure.envelope import Envelope
from metamenth.enumerations import CoverType

floor_area = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.SQUARE_METERS, 5))
Measure(MeasurementUnit.SQUARE_METERS, 5))
# height of building
height = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.METERS, 30))
Measure(MeasurementUnit.METERS, 30))
# internal mass of the building
internal_mass = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.KILOGRAMS, 2000))
Measure(MeasurementUnit.KILOGRAMS, 2000))
area = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.SQUARE_METERS, 45))
Measure(MeasurementUnit.SQUARE_METERS, 45))
# create room
room = Room(area, "Office 1", RoomType.OFFICE)

Expand All @@ -87,26 +87,26 @@ address = Address("Montreal", "6399 Rue Sherbrooke", "QC", "H1N 2Z3", "Canada")

# create building
building = Building(2009, height, floor_area, internal_mass, address,
BuildingType.COMMERCIAL, [floor])
BuildingType.COMMERCIAL, [floor])

# material properties
density_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.KILOGRAM_PER_CUBIC_METER, 0.5))
Measure(MeasurementUnit.KILOGRAM_PER_CUBIC_METER, 0.5))
hc_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.JOULES_PER_KELVIN, 4.5))
Measure(MeasurementUnit.JOULES_PER_KELVIN, 4.5))
tt_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.WATTS_PER_SQUARE_METER_KELVIN, 2.5))
Measure(MeasurementUnit.WATTS_PER_SQUARE_METER_KELVIN, 2.5))
tr_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
Measure(MeasurementUnit.SQUARE_METERS_KELVIN_PER_WATTS,
2.3))
Measure(MeasurementUnit.SQUARE_METERS_KELVIN_PER_WATTS,
2.3))
# create roof material
roof_material = Material(
description="Steel roof",
material_type=MaterialType.ROOF_STEEL,
density=density_measure,
heat_capacity=hc_measure,
thermal_transmittance=tt_measure,
thermal_resistance=tr_measure
description="Steel roof",
material_type=MaterialType.ROOF_STEEL,
density=density_measure,
heat_capacity=hc_measure,
thermal_transmittance=tt_measure,
thermal_resistance=tr_measure
)

# roof layer measurement
Expand Down
14 changes: 0 additions & 14 deletions datatypes/relationships/one_to_many.py

This file was deleted.

62 changes: 0 additions & 62 deletions enumerations/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions datatypes/address.py → metamenth/datatypes/address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .point import Point
from datatypes.binary_measure import BinaryMeasure
from misc import Validate
from metamenth.datatypes.point import Point
from metamenth.datatypes.binary_measure import BinaryMeasure
from metamenth.misc import Validate


class Address:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datatypes.interfaces.abstract_measure import AbstractMeasure
from .measure import Measure
from enumerations import DataMeasurementType
from metamenth.datatypes.interfaces.abstract_measure import AbstractMeasure
from metamenth.datatypes.measure import Measure
from metamenth.enumerations import DataMeasurementType


class BinaryMeasure(AbstractMeasure):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from .measure import Measure
from metamenth.datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from metamenth.datatypes.measure import Measure


class ContinuousMeasure(AbstractRangeMeasure):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from .measure import Measure
from metamenth.datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from metamenth.datatypes.measure import Measure


class ExponentialMeasure(AbstractRangeMeasure):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from abc import ABC
from utils import EntityInsert
from utils import EntityRemover
from utils import StructureEntitySearch
from transducers.interfaces.abstract_transducer import AbstractTransducer
from enumerations import BuildingEntity
from metamenth.utils import EntityInsert
from metamenth.utils import EntityRemover
from metamenth.utils import StructureEntitySearch
from metamenth.transducers.interfaces.abstract_transducer import AbstractTransducer
from metamenth.enumerations import BuildingEntity
from typing import Dict


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC
from datatypes.measure import Measure
from enumerations import DataMeasurementType
from metamenth.datatypes.measure import Measure
from metamenth.enumerations import DataMeasurementType


class AbstractMeasure(ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .abstract_measure import AbstractMeasure
from datatypes.measure import Measure
from metamenth.datatypes.measure import Measure


class AbstractRangeMeasure(AbstractMeasure):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from .measure import Measure
from metamenth.datatypes.interfaces.abstract_range_measure import AbstractRangeMeasure
from metamenth.datatypes.measure import Measure


class LinearMeasure(AbstractRangeMeasure):
Expand Down
2 changes: 1 addition & 1 deletion datatypes/measure.py → metamenth/datatypes/measure.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from enumerations import MeasurementUnit
from metamenth.enumerations import MeasurementUnit


@dataclass
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from dataclasses import dataclass
from typing import Type
from datatypes.interfaces.abstract_measure import AbstractMeasure
from metamenth.datatypes.interfaces.abstract_measure import AbstractMeasure
from uuid import uuid4


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from enumerations import WaveForm
from datatypes.interfaces.abstract_measure import AbstractMeasure
from metamenth.enumerations import WaveForm
from metamenth.datatypes.interfaces.abstract_measure import AbstractMeasure


@dataclass
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC
from enumerations import RelationshipName
from metamenth.enumerations import RelationshipName


class AbstractRelationship(ABC):
Expand Down
14 changes: 14 additions & 0 deletions metamenth/datatypes/relationships/one_to_many.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from metamenth.datatypes.relationships.interfaces.abstract_relationship import AbstractRelationship
from metamenth.enumerations import RelationshipName
from metamenth.subsystem.hvac_components.interfaces.abstract_hvac_component import AbstractHVACComponent
from metamenth.subsystem.hvac_components.interfaces.abstract_duct_connected_component import AbstractDuctConnectedComponent
from typing import Union
from typing import List


class OneToMany(AbstractRelationship):

def __init__(self, name: RelationshipName, hvac_component: Union[List[AbstractHVACComponent],
List[AbstractDuctConnectedComponent]]):
super().__init__(name)
self.component = hvac_component
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import List
from datatypes.operational_schedule import OperationalSchedule
from utils import EntityRemover
from utils import EntityInsert
from utils import StructureEntitySearch
from metamenth.datatypes.operational_schedule import OperationalSchedule
from metamenth.utils import EntityRemover
from metamenth.utils import EntityInsert
from metamenth.utils import StructureEntitySearch
from typing import Dict
from enumerations import BuildingEntity
from metamenth.enumerations import BuildingEntity


class SchedulableEntity:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from energysystem.interfaces.abstract_electrical import AbstractElectrical
from enumerations import PowerState
from datatypes.binary_measure import BinaryMeasure
from metamenth.energysystem.interfaces.abstract_electrical import AbstractElectrical
from metamenth.enumerations import PowerState
from metamenth.datatypes.binary_measure import BinaryMeasure


class Alternator(AbstractElectrical):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from energysystem.interfaces.abstract_electrical import AbstractElectrical
from enumerations import PowerState
from enumerations import ATSPowerSourceType
from enumerations import ATSOperationMode
from enumerations import ATSTransitionType
from enumerations import ATSSwitchingMechanism
from metamenth.energysystem.interfaces.abstract_electrical import AbstractElectrical
from metamenth.enumerations import PowerState
from metamenth.enumerations import ATSPowerSourceType
from metamenth.enumerations import ATSOperationMode
from metamenth.enumerations import ATSTransitionType
from metamenth.enumerations import ATSSwitchingMechanism


class AutomaticTransferSwitch(AbstractElectrical):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from energysystem.interfaces.abstract_electrical import AbstractElectrical
from enumerations import PowerState
from enumerations import UPSPhase
from datatypes.binary_measure import BinaryMeasure
from energysystem.storage_system.immobile_storage_energy_system import ImmobileStorageEnergySystem
from enumerations import BuildingEntity
from utils import EntityInsert
from utils import EntityRemover
from utils import StructureEntitySearch
from metamenth.energysystem.interfaces.abstract_electrical import AbstractElectrical
from metamenth.enumerations import PowerState
from metamenth.enumerations import UPSPhase
from metamenth.datatypes.binary_measure import BinaryMeasure
from metamenth.energysystem.storage_system.immobile_storage_energy_system import ImmobileStorageEnergySystem
from metamenth.enumerations import BuildingEntity
from metamenth.utils import EntityInsert
from metamenth.utils import EntityRemover
from metamenth.utils import StructureEntitySearch


class UninterruptiblePowerSupply(AbstractElectrical):
Expand Down
Loading

0 comments on commit b6d594b

Please sign in to comment.