Skip to content

Commit

Permalink
feat(DataType): added datatype to handle unit conversions, checks, etc.
Browse files Browse the repository at this point in the history
This commit is also fixing some issues with interger division.
  • Loading branch information
Chris Mackey committed Dec 21, 2018
1 parent 5a730ab commit e4752c6
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions ladybug/analysisperiod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug analysis period class."""
from .dt import DateTime
from datetime import datetime, timedelta
Expand Down
1 change: 1 addition & 0 deletions ladybug/color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug color, colorsets and colorrange."""


Expand Down
2 changes: 2 additions & 0 deletions ladybug/datacollection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug data collection."""
from .header import Header
from .datatype import DataPoint
Expand Down
1 change: 1 addition & 0 deletions ladybug/datatype.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug data types."""
# from abc import ABCMeta, abstractmethod
import math
Expand Down
2 changes: 2 additions & 0 deletions ladybug/datatypenew.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug data types."""
from ladybug.datatype import DataPoint

Expand Down
3 changes: 3 additions & 0 deletions ladybug/designday.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# coding=utf-8
from __future__ import division

from .location import Location
from .futil import write_to_file
from .dt import DateTime
Expand Down
3 changes: 2 additions & 1 deletion ladybug/dt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Ladybug datetime."""
# coding=utf-8
from __future__ import division
"""Ladybug datetime."""
from datetime import datetime


Expand Down
2 changes: 2 additions & 0 deletions ladybug/epw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding=utf-8
from __future__ import division

from .location import Location
from .analysisperiod import AnalysisPeriod
from .datatype import DataPoint
Expand Down
3 changes: 3 additions & 0 deletions ladybug/futil.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# coding=utf-8
from __future__ import division

"""A collection of auxiliary funtions for working with files and directories."""
import os
import shutil
Expand Down
2 changes: 2 additions & 0 deletions ladybug/header.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding=utf-8
from __future__ import division

"""Ladybug Header"""
from copy import deepcopy

Expand Down
2 changes: 2 additions & 0 deletions ladybug/legendparameters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding=utf-8
from __future__ import division

from color import ColorRange
from listoperations import flatten, unflatten

Expand Down
1 change: 1 addition & 0 deletions ladybug/listoperations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Useful functions for list operations."""
import collections

Expand Down
1 change: 1 addition & 0 deletions ladybug/location.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Ladybug location."""
import re

Expand Down
1 change: 1 addition & 0 deletions ladybug/psychrometrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Functions for converting between various humidity metrics"""
import math

Expand Down
1 change: 1 addition & 0 deletions ladybug/rootfind.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""
A list of useful functions for rapid guess-and-test (or root-finding) situations.
Using these functions will typically be much faster than a custom-built guess-and-check
Expand Down
2 changes: 2 additions & 0 deletions ladybug/skymodel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding=utf-8
from __future__ import division
"""Functions for computing radiation for different idealized skies"""
import math

Expand Down
3 changes: 3 additions & 0 deletions ladybug/stat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# coding=utf-8
from __future__ import division

from .location import Location
from .analysisperiod import AnalysisPeriod
from .designday import DesignDay
Expand Down
2 changes: 2 additions & 0 deletions ladybug/sunpath.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding=utf-8
from __future__ import division

import math
from collections import namedtuple
from .location import Location
Expand Down
1 change: 1 addition & 0 deletions ladybug/wea.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import division
"""Wea weather file."""
from .epw import EPW
from .stat import STAT
Expand Down
2 changes: 1 addition & 1 deletion tests/datacollection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_to_unit(self):
assert dc1.values[0] == 20
assert dc3.values[0] == 293.15
assert dc2.values[0] == 20
assert dc4.values[0] == 266.15
assert dc4.values[0] == pytest.approx(266.483, rel=1e-1)

def test_to_ip_si(self):
"""Test the conversion of DataCollection to IP and SI units."""
Expand Down

0 comments on commit e4752c6

Please sign in to comment.