Skip to main content

airallergy's research kit

Project description

aark

airallergy’s research kit

aark is a collection of Python tools for my research in built environment.

Table of contents

Usage

NCM

Tools for analysing the National Calculation Methodology (NCM) database, tested primarily on data related to English dwellings.

[!TIP] To access the NCM database, the NCM modules depend on pyodbc, which in turn depends on an ODBC driver and driver manager for Microsoft Access. See pyodbc's installation guide for details.

Get activity schedules in the epJSON format

The aark.ncm.sched module provides functions for extracting NCM activity schedules and converting them into the epJSON format for EnergyPlus. In particular, the aark.ncm.sched.get_scheds function takes a sequence of NCM room names, a sequence of NCM schedule categories and a pyodbc.Cursor object for the NCM activity database, and returns an epJSON of schedule objects ready for EnergyPlus simulations.

[!IMPORTANT] This module currently has the following caveats:

  • A non-leap year is assumed.
  • Other gains schedules are not converted.

For instance, the following script retrieves the occupancy and heating set point schedules for the bedroom and the lounge.

import pyodbc

import aark.ncm.sched


room_names = ["Dwell_DomBed", "Dwell_DomLounge"]
sched_categories = ["OCCUPANCY_SCH", "HEAT_SET_SCH"]

with pyodbc.connect(
    Driver="Microsoft Access Driver (*.mdb, *.accdb)", DBQ="/path/to/the/database"
) as con:
    cur = con.cursor()

    sched_epjson = aark.ncm.sched.get_scheds(
        room_names=room_names, sched_categories=sched_categories, cursor=cur
    )

The sched_epjson variable contains the following epJSON of schedule objects.

Full epJSON
{
  "ScheduleTypeLimits": {
    "TEMPERATURE": {
      "lower_limit_value": -100,
      "upper_limit_value": 100,
      "numeric_type": "Continuous",
      "unit_type": "Temperature"
    },
    "FRACTION": {
      "lower_limit_value": 0,
      "upper_limit_value": 1,
      "numeric_type": "Continuous",
      "unit_type": "Dimensionless"
    }
  },
  "Schedule:Day:Hourly": {
    "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 18,
      "hour_2": 18,
      "hour_3": 18,
      "hour_4": 18,
      "hour_5": 18,
      "hour_6": 18,
      "hour_7": 18,
      "hour_8": 18,
      "hour_9": 18,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 12,
      "hour_16": 12,
      "hour_17": 12,
      "hour_18": 12,
      "hour_19": 12,
      "hour_20": 12,
      "hour_21": 18,
      "hour_22": 18,
      "hour_23": 18,
      "hour_24": 18
    },
    "ncm-daily-9345-Dwell_DomBed_Heat_Wknd": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 18,
      "hour_2": 18,
      "hour_3": 18,
      "hour_4": 18,
      "hour_5": 18,
      "hour_6": 18,
      "hour_7": 18,
      "hour_8": 18,
      "hour_9": 18,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 12,
      "hour_16": 12,
      "hour_17": 12,
      "hour_18": 12,
      "hour_19": 12,
      "hour_20": 12,
      "hour_21": 18,
      "hour_22": 18,
      "hour_23": 18,
      "hour_24": 18
    },
    "ncm-daily-9346-Dwell_DomBed_Heat_Hol": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 18,
      "hour_2": 18,
      "hour_3": 18,
      "hour_4": 18,
      "hour_5": 18,
      "hour_6": 18,
      "hour_7": 18,
      "hour_8": 18,
      "hour_9": 18,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 12,
      "hour_16": 12,
      "hour_17": 12,
      "hour_18": 12,
      "hour_19": 12,
      "hour_20": 12,
      "hour_21": 18,
      "hour_22": 18,
      "hour_23": 18,
      "hour_24": 18
    },
    "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 0,
      "hour_2": 0,
      "hour_3": 0,
      "hour_4": 0,
      "hour_5": 0,
      "hour_6": 0,
      "hour_7": 0,
      "hour_8": 0,
      "hour_9": 0,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0.5,
      "hour_18": 0.5,
      "hour_19": 1,
      "hour_20": 1,
      "hour_21": 1,
      "hour_22": 1,
      "hour_23": 0.666666667,
      "hour_24": 0
    },
    "ncm-daily-9396-Dwell_DomLounge_Occ_Wknd": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 0,
      "hour_2": 0,
      "hour_3": 0,
      "hour_4": 0,
      "hour_5": 0,
      "hour_6": 0,
      "hour_7": 0,
      "hour_8": 0,
      "hour_9": 0,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0.5,
      "hour_18": 0.5,
      "hour_19": 1,
      "hour_20": 1,
      "hour_21": 1,
      "hour_22": 1,
      "hour_23": 0.666666667,
      "hour_24": 0
    },
    "ncm-daily-9397-Dwell_DomLounge_Occ_Hol": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 0,
      "hour_2": 0,
      "hour_3": 0,
      "hour_4": 0,
      "hour_5": 0,
      "hour_6": 0,
      "hour_7": 0,
      "hour_8": 0,
      "hour_9": 0,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0.5,
      "hour_18": 0.5,
      "hour_19": 1,
      "hour_20": 1,
      "hour_21": 1,
      "hour_22": 1,
      "hour_23": 0.666666667,
      "hour_24": 0
    },
    "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 12,
      "hour_2": 12,
      "hour_3": 12,
      "hour_4": 12,
      "hour_5": 12,
      "hour_6": 12,
      "hour_7": 12,
      "hour_8": 12,
      "hour_9": 12,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 21,
      "hour_16": 21,
      "hour_17": 21,
      "hour_18": 21,
      "hour_19": 21,
      "hour_20": 21,
      "hour_21": 21,
      "hour_22": 21,
      "hour_23": 21,
      "hour_24": 12
    },
    "ncm-daily-9405-Dwell_DomLounge_Heat_Wknd": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 12,
      "hour_2": 12,
      "hour_3": 12,
      "hour_4": 12,
      "hour_5": 12,
      "hour_6": 12,
      "hour_7": 12,
      "hour_8": 12,
      "hour_9": 12,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 21,
      "hour_16": 21,
      "hour_17": 21,
      "hour_18": 21,
      "hour_19": 21,
      "hour_20": 21,
      "hour_21": 21,
      "hour_22": 21,
      "hour_23": 21,
      "hour_24": 12
    },
    "ncm-daily-9406-Dwell_DomLounge_Heat_Hol": {
      "sched_type_limits_name": "TEMPERATURE",
      "hour_1": 12,
      "hour_2": 12,
      "hour_3": 12,
      "hour_4": 12,
      "hour_5": 12,
      "hour_6": 12,
      "hour_7": 12,
      "hour_8": 12,
      "hour_9": 12,
      "hour_10": 12,
      "hour_11": 12,
      "hour_12": 12,
      "hour_13": 12,
      "hour_14": 12,
      "hour_15": 21,
      "hour_16": 21,
      "hour_17": 21,
      "hour_18": 21,
      "hour_19": 21,
      "hour_20": 21,
      "hour_21": 21,
      "hour_22": 21,
      "hour_23": 21,
      "hour_24": 12
    },
    "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 1,
      "hour_2": 1,
      "hour_3": 1,
      "hour_4": 1,
      "hour_5": 1,
      "hour_6": 1,
      "hour_7": 1,
      "hour_8": 0.5,
      "hour_9": 0.25,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0,
      "hour_18": 0,
      "hour_19": 0,
      "hour_20": 0,
      "hour_21": 0,
      "hour_22": 0,
      "hour_23": 0.25,
      "hour_24": 0.75
    },
    "ncm-daily-9336-Dwell_DomBed_Occ_Wknd": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 1,
      "hour_2": 1,
      "hour_3": 1,
      "hour_4": 1,
      "hour_5": 1,
      "hour_6": 1,
      "hour_7": 1,
      "hour_8": 0.5,
      "hour_9": 0.25,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0,
      "hour_18": 0,
      "hour_19": 0,
      "hour_20": 0,
      "hour_21": 0,
      "hour_22": 0,
      "hour_23": 0.25,
      "hour_24": 0.75
    },
    "ncm-daily-9337-Dwell_DomBed_Occ_Hol": {
      "sched_type_limits_name": "FRACTION",
      "hour_1": 1,
      "hour_2": 1,
      "hour_3": 1,
      "hour_4": 1,
      "hour_5": 1,
      "hour_6": 1,
      "hour_7": 1,
      "hour_8": 0.5,
      "hour_9": 0.25,
      "hour_10": 0,
      "hour_11": 0,
      "hour_12": 0,
      "hour_13": 0,
      "hour_14": 0,
      "hour_15": 0,
      "hour_16": 0,
      "hour_17": 0,
      "hour_18": 0,
      "hour_19": 0,
      "hour_20": 0,
      "hour_21": 0,
      "hour_22": 0,
      "hour_23": 0.25,
      "hour_24": 0.75
    }
  },
  "Schedule:Week:Daily": {
    "ncm-weekly-3530-Dwell_DomBed_Heat_Wk1": {
      "monday_schedule_day_name": "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy",
      "tuesday_schedule_day_name": "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy",
      "wednesday_schedule_day_name": "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy",
      "thursday_schedule_day_name": "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy",
      "friday_schedule_day_name": "ncm-daily-9344-Dwell_DomBed_Heat_Wkdy",
      "saturday_schedule_day_name": "ncm-daily-9345-Dwell_DomBed_Heat_Wknd",
      "sunday_schedule_day_name": "ncm-daily-9345-Dwell_DomBed_Heat_Wknd",
      "holiday_schedule_day_name": "ncm-daily-9346-Dwell_DomBed_Heat_Hol",
      "summerdesignday_schedule_day_name": "ncm-daily-9346-Dwell_DomBed_Heat_Hol",
      "winterdesignday_schedule_day_name": "ncm-daily-9346-Dwell_DomBed_Heat_Hol",
      "customday1_schedule_day_name": "ncm-daily-9346-Dwell_DomBed_Heat_Hol",
      "customday2_schedule_day_name": "ncm-daily-9346-Dwell_DomBed_Heat_Hol"
    },
    "ncm-weekly-3557-Dwell_DomLounge_Occ_Wk1": {
      "monday_schedule_day_name": "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy",
      "tuesday_schedule_day_name": "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy",
      "wednesday_schedule_day_name": "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy",
      "thursday_schedule_day_name": "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy",
      "friday_schedule_day_name": "ncm-daily-9395-Dwell_DomLounge_Occ_Wkdy",
      "saturday_schedule_day_name": "ncm-daily-9396-Dwell_DomLounge_Occ_Wknd",
      "sunday_schedule_day_name": "ncm-daily-9396-Dwell_DomLounge_Occ_Wknd",
      "holiday_schedule_day_name": "ncm-daily-9397-Dwell_DomLounge_Occ_Hol",
      "summerdesignday_schedule_day_name": "ncm-daily-9397-Dwell_DomLounge_Occ_Hol",
      "winterdesignday_schedule_day_name": "ncm-daily-9397-Dwell_DomLounge_Occ_Hol",
      "customday1_schedule_day_name": "ncm-daily-9397-Dwell_DomLounge_Occ_Hol",
      "customday2_schedule_day_name": "ncm-daily-9397-Dwell_DomLounge_Occ_Hol"
    },
    "ncm-weekly-3555-Dwell_DomLounge_Heat_Wk1": {
      "monday_schedule_day_name": "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy",
      "tuesday_schedule_day_name": "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy",
      "wednesday_schedule_day_name": "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy",
      "thursday_schedule_day_name": "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy",
      "friday_schedule_day_name": "ncm-daily-9404-Dwell_DomLounge_Heat_Wkdy",
      "saturday_schedule_day_name": "ncm-daily-9405-Dwell_DomLounge_Heat_Wknd",
      "sunday_schedule_day_name": "ncm-daily-9405-Dwell_DomLounge_Heat_Wknd",
      "holiday_schedule_day_name": "ncm-daily-9406-Dwell_DomLounge_Heat_Hol",
      "summerdesignday_schedule_day_name": "ncm-daily-9406-Dwell_DomLounge_Heat_Hol",
      "winterdesignday_schedule_day_name": "ncm-daily-9406-Dwell_DomLounge_Heat_Hol",
      "customday1_schedule_day_name": "ncm-daily-9406-Dwell_DomLounge_Heat_Hol",
      "customday2_schedule_day_name": "ncm-daily-9406-Dwell_DomLounge_Heat_Hol"
    },
    "ncm-weekly-3532-Dwell_DomBed_Occ_Wk1": {
      "monday_schedule_day_name": "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy",
      "tuesday_schedule_day_name": "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy",
      "wednesday_schedule_day_name": "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy",
      "thursday_schedule_day_name": "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy",
      "friday_schedule_day_name": "ncm-daily-9335-Dwell_DomBed_Occ_Wkdy",
      "saturday_schedule_day_name": "ncm-daily-9336-Dwell_DomBed_Occ_Wknd",
      "sunday_schedule_day_name": "ncm-daily-9336-Dwell_DomBed_Occ_Wknd",
      "holiday_schedule_day_name": "ncm-daily-9337-Dwell_DomBed_Occ_Hol",
      "summerdesignday_schedule_day_name": "ncm-daily-9337-Dwell_DomBed_Occ_Hol",
      "winterdesignday_schedule_day_name": "ncm-daily-9337-Dwell_DomBed_Occ_Hol",
      "customday1_schedule_day_name": "ncm-daily-9337-Dwell_DomBed_Occ_Hol",
      "customday2_schedule_day_name": "ncm-daily-9337-Dwell_DomBed_Occ_Hol"
    }
  },
  "Schedule:Year": {
    "ncm-annual-3232-Dwell_DomBed_Heat": {
      "schedule_type_limits_name": "TEMPERATURE",
      "schedule_weeks": [
        {
          "schedule_week_name": "ncm-weekly-3530-Dwell_DomBed_Heat_Wk1",
          "start_month": 1,
          "start_day": 1,
          "end_month": 12,
          "end_day": 31
        }
      ]
    },
    "ncm-annual-3249-Dwell_DomLounge_Occ": {
      "schedule_type_limits_name": "FRACTION",
      "schedule_weeks": [
        {
          "schedule_week_name": "ncm-weekly-3557-Dwell_DomLounge_Occ_Wk1",
          "start_month": 1,
          "start_day": 1,
          "end_month": 12,
          "end_day": 31
        }
      ]
    },
    "ncm-annual-3252-Dwell_DomLounge_Heat": {
      "schedule_type_limits_name": "TEMPERATURE",
      "schedule_weeks": [
        {
          "schedule_week_name": "ncm-weekly-3555-Dwell_DomLounge_Heat_Wk1",
          "start_month": 1,
          "start_day": 1,
          "end_month": 12,
          "end_day": 31
        }
      ]
    },
    "ncm-annual-3229-Dwell_DomBed_Occ": {
      "schedule_type_limits_name": "FRACTION",
      "schedule_weeks": [
        {
          "schedule_week_name": "ncm-weekly-3532-Dwell_DomBed_Occ_Wk1",
          "start_month": 1,
          "start_day": 1,
          "end_month": 12,
          "end_day": 31
        }
      ]
    }
  }
}

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

aark-0.1.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aark-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file aark-0.1.0.tar.gz.

File metadata

  • Download URL: aark-0.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aark-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6fab96ac5155a6506ab56436ab10f14ef7643c9d7bb0ea28c2b080e4b463bfee
MD5 645f5fad967869263826b491e3c1fd92
BLAKE2b-256 5980d8d36ed72fe769e87c19cd341250c847f677d92bfe042574ddad9cc8fc1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aark-0.1.0.tar.gz:

Publisher: publish_pypi.yml on airallergy/aark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aark-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aark-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aark-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10da985f6843ba4c4b02850dc51e6610e9dfecabf9293d793a343bfa8e8939dc
MD5 710d26b388801fec71bf2cf810666082
BLAKE2b-256 7e95af88850322333a04c50b079e8da7c5e713ee413147fd0a95b20419d53ed2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aark-0.1.0-py3-none-any.whl:

Publisher: publish_pypi.yml on airallergy/aark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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