dragonfly-radiance 0.4.121__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dragonfly-radiance might be problematic. Click here for more details.

@@ -0,0 +1,122 @@
1
+ # coding=utf-8
2
+ """Story Radiance Properties."""
3
+ from honeybee_radiance.modifierset import ModifierSet
4
+
5
+ from honeybee_radiance.lib.modifiersets import generic_modifier_set_visible
6
+
7
+
8
+ class StoryRadianceProperties(object):
9
+ """Radiance Properties for Dragonfly Story.
10
+
11
+ Args:
12
+ host: A dragonfly_core Story object that hosts these properties.
13
+ modifier_set: A honeybee ModifierSet object to specify all default modifiers
14
+ for the Story geometry. If None, it will be the honeybee default modifier
15
+ set, which is only representative of typical indoor conditions in
16
+ the visible spectrum. (Default: None).
17
+
18
+ Properties:
19
+ * host
20
+ * modifier_set
21
+ """
22
+
23
+ __slots__ = ('_host', '_modifier_set')
24
+
25
+ def __init__(self, host, modifier_set=None):
26
+ """Initialize Story radiance properties."""
27
+ self._host = host
28
+ self.modifier_set = modifier_set
29
+
30
+ @property
31
+ def host(self):
32
+ """Get the Story object hosting these properties."""
33
+ return self._host
34
+
35
+ @property
36
+ def modifier_set(self):
37
+ """Get or set the Story ModifierSet object.
38
+
39
+ If not set, it will be set by the parent Building or will be the Honeybee
40
+ default generic ModifierSet.
41
+ """
42
+ if self._modifier_set is not None: # set by the user
43
+ return self._modifier_set
44
+ elif self._host.has_parent: # set by parent building
45
+ return self._host.parent.properties.radiance.modifier_set
46
+ else:
47
+ return generic_modifier_set_visible
48
+
49
+ @modifier_set.setter
50
+ def modifier_set(self, value):
51
+ if value is not None:
52
+ assert isinstance(value, ModifierSet), \
53
+ 'Expected ModifierSet. Got {}'.format(type(value))
54
+ value.lock() # lock in case modifier set has multiple references
55
+ self._modifier_set = value
56
+
57
+ @classmethod
58
+ def from_dict(cls, data, host):
59
+ """Create StoryRadianceProperties from a dictionary.
60
+
61
+ Note that the dictionary must be a non-abridged version for this
62
+ classmethod to work.
63
+
64
+ Args:
65
+ data: A dictionary representation of StoryRadianceProperties.
66
+ host: A Story object that hosts these properties.
67
+ """
68
+ assert data['type'] == 'StoryRadianceProperties', \
69
+ 'Expected StoryRadianceProperties. Got {}.'.format(data['type'])
70
+
71
+ new_prop = cls(host)
72
+ if 'modifier_set' in data and data['modifier_set'] is not None:
73
+ new_prop.modifier_set = ModifierSet.from_dict(data['modifier_set'])
74
+
75
+ return new_prop
76
+
77
+ def apply_properties_from_dict(self, abridged_data, modifier_sets):
78
+ """Apply properties from a StoryRadiancePropertiesAbridged dictionary.
79
+
80
+ Args:
81
+ abridged_data: A StoryRadiancePropertiesAbridged dictionary (typically
82
+ coming from a Model).
83
+ modifier_sets: A dictionary of ModifierSets with identifiers
84
+ of the sets as keys, which will be used to re-assign modifier_sets.
85
+ """
86
+ if 'modifier_set' in abridged_data and abridged_data['modifier_set'] is not None:
87
+ self.modifier_set = modifier_sets[abridged_data['modifier_set']]
88
+
89
+ def to_dict(self, abridged=False):
90
+ """Return Story Radiance properties as a dictionary.
91
+
92
+ Args:
93
+ abridged: Boolean for whether the full dictionary of the Story should
94
+ be written (False) or just the identifier of the the individual
95
+ properties (True). Default: False.
96
+ """
97
+ base = {'radiance': {}}
98
+ base['radiance']['type'] = 'StoryRadianceProperties' if not \
99
+ abridged else 'StoryRadiancePropertiesAbridged'
100
+
101
+ # write the ModifierSet into the dictionary
102
+ if self._modifier_set is not None:
103
+ base['radiance']['modifier_set'] = \
104
+ self._modifier_set.identifier if abridged else \
105
+ self._modifier_set.to_dict()
106
+
107
+ return base
108
+
109
+ def duplicate(self, new_host=None):
110
+ """Get a copy of this object.
111
+
112
+ new_host: A new Story object that hosts these properties.
113
+ If None, the properties will be duplicated with the same host.
114
+ """
115
+ _host = new_host or self._host
116
+ return StoryRadianceProperties(_host, self._modifier_set)
117
+
118
+ def ToString(self):
119
+ return self.__repr__()
120
+
121
+ def __repr__(self):
122
+ return 'Story Radiance Properties: {}'.format(self.host.identifier)
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: dragonfly-radiance
3
+ Version: 0.4.121
4
+ Summary: Dragonfly extension for radiance simulation.
5
+ Home-page: https://github.com/ladybug-tools/dragonfly-radiance
6
+ Author: Ladybug Tools
7
+ Author-email: info@ladybug.tools
8
+ License: AGPL-3.0
9
+ Classifier: Programming Language :: Python :: 2.7
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: Implementation :: CPython
17
+ Classifier: Programming Language :: Python :: Implementation :: IronPython
18
+ Classifier: Operating System :: OS Independent
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: dragonfly-core==1.74.22
22
+ Requires-Dist: honeybee-radiance==1.66.217
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: license
30
+ Dynamic: license-file
31
+ Dynamic: requires-dist
32
+ Dynamic: summary
33
+
34
+ ![Dragonfly](https://www.ladybug.tools/assets/img/dragonfly.png)
35
+
36
+ [![Build Status](https://github.com/ladybug-tools/dragonfly-radiance/actions/workflows/ci.yaml/badge.svg)](https://github.com/ladybug-tools/dragonfly-radiance/actions)
37
+
38
+ [![Python 3.10](https://img.shields.io/badge/python-3.10-orange.svg)](https://www.python.org/downloads/release/python-3100/) [![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/) [![Python 2.7](https://img.shields.io/badge/python-2.7-green.svg)](https://www.python.org/downloads/release/python-270/) [![IronPython](https://img.shields.io/badge/ironpython-2.7-red.svg)](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.8/)
39
+
40
+ # dragonfly-radiance
41
+
42
+ Dragonfly extension for Radiance simulation.
43
+
44
+ ## Installation
45
+
46
+ `pip install dragonfly-radiance`
47
+
48
+ To check if the command line interface is installed correctly
49
+ use `dragonfly-radiance --help`.
50
+
51
+ ## QuickStart
52
+
53
+ ```python
54
+ import dragonfly_radiance
55
+ ```
56
+
57
+ ## [API Documentation](http://ladybug-tools.github.io/dragonfly-radiance/docs)
58
+
59
+ ## Local Development
60
+
61
+ 1. Clone this repo locally
62
+ ```
63
+ git clone git@github.com:ladybug-tools/dragonfly-radiance
64
+
65
+ # or
66
+
67
+ git clone https://github.com/ladybug-tools/dragonfly-radiance
68
+ ```
69
+ 2. Install dependencies:
70
+ ```
71
+ cd dragonfly-radiance
72
+ pip install -r dev-requirements.txt
73
+ pip install -r requirements.txt
74
+ ```
75
+
76
+ 3. Run Tests:
77
+ ```
78
+ python -m pytest tests/
79
+ ```
80
+
81
+ 4. Generate Documentation:
82
+ ```
83
+ sphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_radiance
84
+ sphinx-build -b html ./docs ./docs/_build/docs
85
+ ```
@@ -0,0 +1,18 @@
1
+ dragonfly_radiance/__init__.py,sha256=a5zhx2c8vxlpBs2Tw1jbiQxgVaB_2x3X9HIN2sfvOeM,244
2
+ dragonfly_radiance/__main__.py,sha256=ly6FLNs9Rxq7G_TcItza_9faTXQ48nzZlXgXKd-2n_8,87
3
+ dragonfly_radiance/_extend_dragonfly.py,sha256=eYxw_KAtcMBFQAlAFXOY_aUrWbeP-lsxAepMxyorquo,1965
4
+ dragonfly_radiance/gridpar.py,sha256=3u04rncp2Oy-ckpwwvTAZbvriy8J560Vxk0fjCx-bNo,25643
5
+ dragonfly_radiance/cli/__init__.py,sha256=7Zx_-nOm0gIioPH5XtVyrTfGPwzniTUF3vqcCp4RLn4,423
6
+ dragonfly_radiance/cli/translate.py,sha256=zj04WUFk-WWV9zwAgKYUygoaaKgq84bceRAHljFhEgs,20674
7
+ dragonfly_radiance/properties/__init__.py,sha256=h-O2WRFI5r12owvSQUrSgdLmlhM7shJAvzLFGryG3rk,37
8
+ dragonfly_radiance/properties/building.py,sha256=nRjezCr7JLMD6fsmQhYBb2GNUtrgtKV2Tli8l9tJ1Fg,6283
9
+ dragonfly_radiance/properties/context.py,sha256=WshH9BOhqbwvxmILRugTMfbvTMl8u5QzIETbJiORTUk,5250
10
+ dragonfly_radiance/properties/model.py,sha256=4SWWq79zwQlBZJ6np7_i1vIj8Cvr9NCj7YhF5Z0cj_k,20197
11
+ dragonfly_radiance/properties/room2d.py,sha256=I_JcNqOjhwov-U0wiFc9JeMmTX1Wukc-jPmU0khpEI4,9125
12
+ dragonfly_radiance/properties/story.py,sha256=htHHyAh8tNdQCGJGMvbI9Xo3RAdHdC8JPE1fnEPY-44,4519
13
+ dragonfly_radiance-0.4.121.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
14
+ dragonfly_radiance-0.4.121.dist-info/METADATA,sha256=6Yw_AbOuoGWo0wdksTR7bTpzLHKSlSa0grZegQi751k,2742
15
+ dragonfly_radiance-0.4.121.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ dragonfly_radiance-0.4.121.dist-info/entry_points.txt,sha256=7KZdeDvrwJ-ZB0LiTJ3TBkYJAmLl6_uSXXhZnLGct4g,71
17
+ dragonfly_radiance-0.4.121.dist-info/top_level.txt,sha256=uvkDZDtPEVgdj7rWsDAl4vcUIuWT7GFBBVmFK4pNE4s,19
18
+ dragonfly_radiance-0.4.121.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dragonfly-radiance = dragonfly_radiance.cli:radiance