Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.9", "3.12" ]
os: [ubuntu-latest]
python-version: ["3.9", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -21,33 +21,22 @@ jobs:
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: Setup Python
poetry-version: 1.8.4
- name: Install dependencies with Poetry
run: |
pip install --upgrade pip
poetry install
- name: Run tests
- name: Run pytest
run: |
poetry run pytest
formatting:
name: Pre-commit checks
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --all-files
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3
- name: type check
run: |
poetry install
poetry run mypy .
16 changes: 10 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args: [ '--maxkb=2000' ]
args: ["--maxkb=2000"]
- id: check-ast
- id: check-json
- id: check-merge-conflict
Expand All @@ -14,17 +14,21 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: [ '--autofix', '--no-sort-keys' ]
args: ["--autofix", "--no-sort-keys"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [markdown, yaml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.12.1
hooks:
- id: mypy
args: [ "--install-types", "--non-interactive", "--ignore-missing-imports" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.7
rev: v0.7.0
hooks:
# Run the linter
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, --output-format=full ]
args: [--fix, --exit-non-zero-on-fix, --output-format=full]
# Run the formatter
- id: ruff-format
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Version 0.2.2

- Added explicit support for Python v3.13

## Version 0.2.1

- Replaced flake8 and other tools with Ruff, applied Ruff fixes
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BuildingSync®, Copyright (c) 2015-2022, Alliance for Sustainable Energy, LLC, and other contributors.
BuildingSync®, Copyright (c) 2015, 2024 Alliance for Sustainable Energy, LLC, and other contributors.

All rights reserved.

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The pre-importer will identify assets defined in the `asset_definitions.json` fi
There are various methods of calculating assets:

1. `sqft`. The sqft method will calculate a 'primary' and 'secondary' value for the asset based on the area it serves.
This is calculated from the floor areas defined in each `Section` element. `Conditioned` floor area values will be
This is calculated from the floor areas defined in each `Section` element. `Conditioned` floor area values will be
used if present; `Gross` otherwise.

1. `num`. The num method will sum up all assets of the specified type and return a single overall number.
Expand Down Expand Up @@ -100,7 +100,7 @@ There are currently 5 types of assets that can be extracted:
1. sqft: Sqft assets take into account the floor area served by a specific asset and returns 'Primary' and 'Secondary'
values. For example: Primary HVAC System and Secondary HVAC System.

1. avg_sqft: Avg_sqft assets compute a weighted average to get the an average asset value. For example: Average Heating
1. avg_sqft: Avg_sqft assets compute a weighted average to get the an average asset value. For example: Average Heating
Setpoint.

1. num: Num assets count the total number of the specified asset found. For example, Total number of lighting systems.
Expand All @@ -110,11 +110,11 @@ There are currently 5 types of assets that can be extracted:

1. custom: For asset that need particular handling, such as Heating Efficiency. The current assets that have custom
methods are:
- Heating System Efficiency
- Cooling System Efficiency
- Lighting System Efficiency
- Water Heater Efficiency
- Heating Fuel Type
- Heating System Efficiency
- Cooling System Efficiency
- Lighting System Efficiency
- Water Heater Efficiency
- Heating Fuel Type

The schema for the assets definition JSON file is in `schemas/asset_definitions_schema.json`.

Expand Down Expand Up @@ -174,7 +174,7 @@ will be saved to `tests\output\cts_output.xlsx`.

### Pre-commit

This project uses `pre-commit <https://pre-commit.com/>`_ to ensure code consistency.
This project uses `pre-commit <https://pre-commit.com/>`\_ to ensure code consistency.
To enable pre-commit on every commit run the following from the command line from within the git checkout of the
BuildingSync-asset-extractor

Expand Down
Loading