Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup.py and export public functions #7

Merged
merged 6 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Inputs must have datatypes as defined in `src/smart_building_rating_calculator/i
Example of how to call `sbr_score` in python:

```ruby
Ianlmgoddard marked this conversation as resolved.
Show resolved Hide resolved
from src.smart_building_rating_calculator.calculate_sbr_score import sbr_score
from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.calculate_sbr_score import sbr_score
from smart_building_rating_calculator.inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup
from setuptools import find_packages, setup

setup(
name="smart-buildings-rating-calculator",
Expand All @@ -9,10 +9,14 @@
long_description_content_type="text/markdown",
url="https://github.com/centrefornetzero/smart-building-rating-calculator",
package_dir={"": "src"},
packages=find_packages(where="src"),
install_requires=[
"pandas",
],
shengy90 marked this conversation as resolved.
Show resolved Hide resolved
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires="==3.11",
python_requires=">=3.11",
)
17 changes: 17 additions & 0 deletions src/smart_building_rating_calculator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from .calculate_sbr_score import sbr_score
Ianlmgoddard marked this conversation as resolved.
Show resolved Hide resolved
from .inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
HotWaterSource,
SolarInverterSize,
)

__all__ = [
"sbr_score",
"BatterySize",
"EVChargerPower",
"HeatingSource",
"HotWaterSource",
"SolarInverterSize",
]
8 changes: 4 additions & 4 deletions src/smart_building_rating_calculator/calculate_sbr_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import pandas as pd

from src.smart_building_rating_calculator.flex_archetype import calc_flex_archetype
from src.smart_building_rating_calculator.initiate_user_inputs import prep_user_inputs
from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.flex_archetype import calc_flex_archetype
from smart_building_rating_calculator.initiate_user_inputs import prep_user_inputs
from smart_building_rating_calculator.inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
HotWaterSource,
SolarInverterSize,
UserInputs,
)
from src.smart_building_rating_calculator.intermediate_scoring import calc_sbr_score
from smart_building_rating_calculator.intermediate_scoring import calc_sbr_score


def calc_sbr(sbr_val: float) -> str:
Expand Down
4 changes: 2 additions & 2 deletions src/smart_building_rating_calculator/flex_archetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Based on Andy's calcuations, this module calculates the flex archetype of a building based on the user inputs and the SBR value.
"""

from src.smart_building_rating_calculator.flexer_enums import FlexArchetype
from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.flexer_enums import FlexArchetype
from smart_building_rating_calculator.inputs import (
HeatingSource,
HotWaterSource,
UserInputs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import replace
from typing import List

from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
Expand Down
10 changes: 5 additions & 5 deletions tests/test_sbr_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@

import pytest

from src.smart_building_rating_calculator.calculate_sbr_score import (
from smart_building_rating_calculator.calculate_sbr_score import (
get_sbr_scores,
sbr_score,
)
from src.smart_building_rating_calculator.flex_archetype import FlexArchetype
from src.smart_building_rating_calculator.initiate_user_inputs import prep_user_inputs
from src.smart_building_rating_calculator.inputs import (
from smart_building_rating_calculator.flex_archetype import FlexArchetype
from smart_building_rating_calculator.initiate_user_inputs import prep_user_inputs
from smart_building_rating_calculator.inputs import (
BatterySize,
EVChargerPower,
HeatingSource,
HotWaterSource,
SolarInverterSize,
UserInputs,
)
from src.smart_building_rating_calculator.intermediate_scoring import (
from smart_building_rating_calculator.intermediate_scoring import (
calc_alternative_heating_score,
calc_alternative_hot_water_score,
calc_elec_heating_score,
Expand Down
Loading