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

style(release): Add an extra for installing mapping dependencies #370

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install -r mapping-requirements.txt
- name: run tests
run: python -m pytest --cov=. tests/
- name: run test coverage
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ COPY .git ${LIBRARYDIR}/.git
COPY setup.py ${LIBRARYDIR}
COPY setup.cfg ${LIBRARYDIR}
COPY requirements.txt ${LIBRARYDIR}
COPY mapping-requirements.txt ${LIBRARY_PATH}
COPY README.md ${LIBRARYDIR}
COPY LICENSE ${LIBRARYDIR}

USER root
RUN pip3 install --no-cache-dir setuptools wheel\
&& pip3 install --no-cache-dir ${LIBRARYDIR} \
&& pip3 install --no-cache-dir ${LIBRARYDIR}[mapping] \
&& apt-get -y --purge remove git \
&& apt-get -y clean \
&& apt-get -y autoremove \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Ladybug-comfort is a Python library that adds thermal comfort functionalities to

`pip install ladybug-comfort`

If you want to also include the dependencies needed for thermal mapping use:

`pip install -U honeybee-energy[mapping]`

To check if the Ladybug-comfort command line interface is installed correctly,
use `ladybug-comfort --help`.

Expand Down
6 changes: 6 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Installation

``pip install -U ladybug-comfort``

If you want to also include the dependencies needed for thermal mapping use.

``pip install -U honeybee-energy[mapping]``

To check if the command line interface is installed correctly use ``ladybug-comfort --help``


CLI Docs
=============
Expand Down
10 changes: 5 additions & 5 deletions ladybug_comfort/collection/adaptive.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Adaptive(ComfortCollection):
'_cooling_effect_coll')

def __init__(self, outdoor_temperature, operative_temperature, air_speed=None,
comfort_parameter=None):
comfort_parameter=None):
"""Initialize an Adaptive comfort object from DataCollections of inputs.
"""
# set up the object using operative temperature as a base
Expand Down Expand Up @@ -133,7 +133,7 @@ def from_air_and_rad_temp(cls, outdoor_temperature, air_temperature,
return cls(outdoor_temperature, to, air_speed, comfort_parameter)

def _calculate_adaptive(self):
"""Compute Adaptive comfort for each step of the Data Collection."""
"""Compute Adaptive comfort for each step of the Data Collection."""
# empty properties to be calculated
self._neutral_temperature = []
self._degrees_from_neutral = []
Expand Down Expand Up @@ -307,9 +307,9 @@ def __init__(self, outdoor_temperature, avg_month=True):
self._head = self._t_out.header
self._avg_month = avg_month

assert isinstance(self._head.data_type, Temperature) and self._head.unit == 'C',\
'outdoor_temperature must be Temperature in C. Got {} in {}'.format(
self._head.data_type, self._head.unit)
assert isinstance(self._head.data_type, Temperature) and \
self._head.unit == 'C', 'outdoor_temperature must be Temperature in C. ' \
'Got {} in {}'.format(self._head.data_type, self._head.unit)
assert self._t_out.is_continuous, 'outdoor_temperature must be continuous.'
assert self._head.analysis_period.is_annual, 'outdoor_temperature must be annual'
assert isinstance(self._avg_month, bool), 'avg_month' \
Expand Down
1 change: 1 addition & 0 deletions mapping-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numpy<2.0.0
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
with open('requirements.txt') as f:
requirements = f.read().splitlines()

with open('mapping-requirements.txt') as f:
mapping_requirements = f.read().splitlines()

setuptools.setup(
name="ladybug-comfort",
use_scm_version=True,
Expand All @@ -20,6 +23,9 @@
packages=setuptools.find_packages(exclude=['tests']),
include_package_data=True,
install_requires=requirements,
extras_require={
'mapping': mapping_requirements
},
entry_points={
"console_scripts": ["ladybug-comfort = ladybug_comfort.cli:comfort"]
},
Expand Down
Loading