Commit 0081c167 authored by hazrmard's avatar hazrmard
Browse files

conversions for runtime, setpoint, other field names for temperature units

parent 43975c39
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ Python package/script for downloading trends from Building Logix Data Exchange (
## Installation

```
pip install git+https://git.isis.vanderbilt.edu/SmartBuildings/bdx@v0.2.1
pip install git+https://git.isis.vanderbilt.edu/SmartBuildings/bdx@v0.2.2
```

## Usage
@@ -62,7 +62,7 @@ dataframe = get_trend(trend_id='2422',
# Optionally, to convert fields to SI units
from bdx import apply_heuristics

dataframe, left = apply_heuristiccs(dataframe)
dataframe, left = apply_heuristics(dataframe)
print('The following fields did not match and were not converted:', left)

```
+3 −1
Original line number Diff line number Diff line
@@ -66,7 +66,9 @@ def get_trend(trend_id: str, username: str, password: str, start: datetime,
        'javax.faces.ViewState': view_state}
    res_auth = sess.post(authURL, data=urlencode(payload),
                         headers={'Content-Type': 'application/x-www-form-urlencoded'})
    key = res_auth.cookies['IS_SSO']
    key = res_auth.cookies.get('IS_SSO')
    if key is None:
        raise Exception('Authentication failed.')

    res_trend_info = sess.get(trendinfoURL)
    trend_info = json.loads(res_trend_info.content)
+11 −11
Original line number Diff line number Diff line
@@ -18,17 +18,17 @@ from .thermo import f2k, gpm2m3s, psi2pa, btuhr2w, ton2w

# Patterns in order of preference. If a patternn is matched, later patterns
# are not considered.
# TODO: units for: SCHWP_Campus_CHW_Supply_SP Value, Chiller_*_Runtime Value
HEURISTICS = (
    ('_Temp|Temp$|_Humidity|Wet_Bulb',      f2k),
    ('Temp|_Humidity|Wet_Bulb|_Supply_SP',          f2k),
    ('Percent',                                     lambda pct: 0.01 * pct),
    ('KW_Ton',                                      lambda kw: kw),
    ('Kw$',                                         lambda kw: 1000 * kw),
    ('Power$',                                      lambda p: p),
    ('Runtime',                                     lambda r: r * 60.0),
    ('Flow$',                                       gpm2m3s),
    ('Press$',                              psi2pa),
    ('Press$|Pressure$',                            psi2pa),
    ('Load_Btuh',                                   btuhr2w),
    ('Load_Tons|Load\sValue|_Capacity',     ton2w)
    ('Load_Tons|Load\sValue|Capacity',              ton2w)
)


+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ from distutils.core import setup


setup(name='bdx',
      version='0.2.1',
      version='0.2.2',
      description='Download trends from Building Logix data exchange (BDX)',
      author='Ibrahim Ahmed',
      author_email='ibrahim.ahmed@vanderbilt.edu',