Add analysis period filtering to utci_comfort_band_comparison plot
@Tom-Kingstone đang làm issue này rồi.
Từ ngày 30/9/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Add the ability to filter each HourlyContinuousCollection with an AnalysisPeriod to the utci_comfort_band_comparison plot.
Here is a rough version of something that works. It needs additional verification, e.g. to ensure that the length of the analysis_periods is the same as the length of the utci_collections, it is handled if this is not the case, and comments need updating. Add any additional necessary imports too. Further comments welcome.
def utci_comfort_band_comparison(
utci_collections: tuple[HourlyContinuousCollection],
ax: plt.Axes = None,
identifiers: tuple[str] = None,
utci_categories: CategoricalComfort = UTCI_DEFAULT_CATEGORIES,
density: bool = True,
analysis_periods = [],
**kwargs,
) -> plt.Axes:
"""Create a proportional bar chart showing how different UTCI collections
compare in terms of time within each comfort band.
Args:
utci_collections (list[HourlyContinuousCollection]):
A list of UTCI collections.
ax (plt.Axes, optional):
The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
identifiers (list[str], optional):
A list of names to give each collection. Defaults to None.
utci_categories (Categories, optional):
The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
density (bool, optional):
If True, then show percentage, otherwise show count. Defaults to True.
**kwargs:
Additional keyword arguments to pass to the function.
Returns:
plt.Axes:
A matplotlib Axes object.
"""
for n, col in enumerate(utci_collections):
if not isinstance(col.header.data_type, LB_UniversalThermalClimateIndex):
raise ValueError(
f"Collection {n} data type is not UTCI and cannot be used in this plot."
)
if any(len(i) != len(utci_collections[0]) for i in utci_collections):
raise ValueError("All collections must be the same length.")
if ax is None:
ax = plt.gca()
# set the title
ax.set_title(kwargs.pop("title", None))
if identifiers is None:
identifiers = [f"{n}" for n in range(len(utci_collections))]
if len(identifiers) != len(utci_collections):
raise ValueError(
"The number of identifiers given does not match the number of UTCI collections given!"
)
#new stuff starts here
if len(analysis_periods) > 0 and len(analysis_periods) == len(utci_collections):
series_zips = zip(utci_collections, analysis_periods)
serieses = [collection_to_series(utci_collection.filter_by_analysis_period(analysis_period)) for utci_collection, analysis_period in series_zips]
counts = pd.concat(
[utci_categories.value_counts(i, density=density) for i in serieses],
axis=1,
keys=identifiers,
)
counts.T.plot(
ax=ax,
kind="bar",
stacked=True,
color=utci_categories.colors,
width=0.8,
legend=False,
)
# rest of file.....
- Ngôn ngữ chính
- Python
- Star
- 3
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của BHoM/LadybugTools_Toolkit
-
Queenbee path fails to resolve with default resolverCó thể đã có người làm @jamesramsden-bh đã nhận 46 ngày trước. Đang mởtype:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BHoM/LadybugTools_Toolkit#361 ·
-
type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BHoM/LadybugTools_Toolkit#339 ·
-
evaporative_cooling_potential_epw missing comma when calling the series version of the methodCó thể đã có người làm @Tom-Kingstone đã nhận 11 ngày trước. Đang mởtype:bug
BHoM/LadybugTools_Toolkit#364 · 1 người được giao ·
-
Grasshopper Sample ScriptsCó thể làm lại được @Felix-Mallinder đã nhận 94 ngày trước và không có pull request nào đang mở. Đang mởtype:feature
BHoM/LadybugTools_Toolkit#352 · 1 người được giao ·
-
Upgrade pollination versionCó thể đã có người làm @Tom-Kingstone đã nhận 143 ngày trước. Đang mởtype:external-api-changes
BHoM/LadybugTools_Toolkit#349 · 1 người được giao ·
Tất cả issue của BHoM/LadybugTools_Toolkit
Issue tương tự
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Có thể đã có người làm @geyazheng đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
langchain-ai/langchain-aws#1469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GCToggler leaves collection enabled if the body re-enables itCó thể đã có người làm @Gambit-Checkmate đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
EESSI/docs#949 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
doronz88/pymobiledevice3#2176 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
b4b usability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày