Skip to main content

MetamEnTh is an object-oriented metamodel designed to model the operational aspects of buildings. It focuses on the relationships and interactions between mechanical, electrical, and plumbing (MEP) entities and their connections to sensors and spatial entities such as rooms and open spaces within buildings.

Project description

MetamEnTh

Build Status Version License PyPI version Wiki

Read the documentation here: MetamEnTh Documentation

Setting up MetamEnTh Locally

  1. Clone the GitHub repository:

    git clone https://github.com/peteryefi/metamenth.git
    cd metamenth
    
  2. Create a virtual environment

    python3 -m venv venv
    
  3. Activate the virtual environment

    • Windows
      venv\Scripts\activate
      
    • MacOS/Linux
      source venv/bin/activate
      
  4. Install project dependencies

    pip install -r requirements.txt
    
  5. Run the tests

     chmod +x run_tests.sh
     ./run_tests.sh
    

Example usage

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))
# height of building
height = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                       Measure(MeasurementUnit.METERS, 30))
# internal mass of the building
internal_mass = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                              Measure(MeasurementUnit.KILOGRAMS, 2000))
area = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                     Measure(MeasurementUnit.SQUARE_METERS, 45))
# create room
room = Room(area, "Office 1", RoomType.OFFICE)

mechanical_room = Room(area, "MR 01", RoomType.MECHANICAL)

# create a hall
hall = OpenSpace("Dinning Hall", area, OpenSpaceType.HALL)

# create floor with a room and a hall
floor = Floor(area=area, number=1, floor_type=FloorType.REGULAR, rooms=[room, hall, mechanical_room])

# create the building's address
address = Address("Montreal", "6399 Rue Sherbrooke", "QC", "H1N 2Z3", "Canada")

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

# material properties
density_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                                Measure(MeasurementUnit.KILOGRAM_PER_CUBIC_METER, 0.5))
hc_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                           Measure(MeasurementUnit.JOULES_PER_KELVIN, 4.5))
tt_measure = MeasureFactory.create_measure(RecordingType.BINARY.value,
                                           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))
# 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
)

# roof layer measurement
roof_height = MeasureFactory.create_measure(RecordingType.BINARY.value, Measure(MeasurementUnit.METERS, 20))
roof_length = MeasureFactory.create_measure(RecordingType.BINARY.value, Measure(MeasurementUnit.METERS, 15))
roof_width = MeasureFactory.create_measure(RecordingType.BINARY.value, Measure(MeasurementUnit.METERS, 3))
# create a layer of steel roof
roof_layer = Layer(roof_height, roof_length, roof_width, roof_material, LayerRoughness.MEDIUM_ROUGH)

# create a cover for the roof
roof_cover = Cover(CoverType.FLOOR)

# roof layer to cover
roof_cover.add_layer(roof_layer)

# create building envelope and add roof cover
envelope = Envelope()
envelope.add_cover(roof_cover)
building.envelope = envelope

NB: Refer to the test directory for more insight on usage

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metamenth-1.0.2b1.tar.gz (164.6 kB view details)

Uploaded Source

Built Distribution

metamenth-1.0.2b1-py3-none-any.whl (127.6 kB view details)

Uploaded Python 3

File details

Details for the file metamenth-1.0.2b1.tar.gz.

File metadata

  • Download URL: metamenth-1.0.2b1.tar.gz
  • Upload date:
  • Size: 164.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for metamenth-1.0.2b1.tar.gz
Algorithm Hash digest
SHA256 a08dfee2a6b0e2c5e9baaf75d01b40e769b5dc3593f7545433c2ed825fd22748
MD5 451611cecf6de98880443b131414c9f5
BLAKE2b-256 c223c16b7331f0df66a6b6513e0f24f7eecd7173bed52a6d7488bad65c129f0c

See more details on using hashes here.

File details

Details for the file metamenth-1.0.2b1-py3-none-any.whl.

File metadata

  • Download URL: metamenth-1.0.2b1-py3-none-any.whl
  • Upload date:
  • Size: 127.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for metamenth-1.0.2b1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e20145d5af5846fce598caafa2b1489e041c0ecf4449e8f175a3ee7c9faa030
MD5 85d6a2a63a057a2aa60c543dd66b0bdf
BLAKE2b-256 03b18a43e532323300142ffabf3345117f0f1b46c787278dd42acd72aec44869

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page