Skip to content

Commit

Permalink
Merge branch 'main' into custom-dropdown-component
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoTartarini authored Dec 5, 2023
2 parents bb9852c + 4560f5b commit a3b2403
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.12
current_version = 0.8.13
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion assets/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
"orientation": "portrait",
"background_color": "#ffffff",
"display": "standalone",
"id": "0.8.12",
"id": "0.8.13",
"description": "CBE Clima Tool: a free and open-source web application for climate analysis tailored to sustainable building design",
"start_url": "/",
"scope": "/",
Expand Down
Binary file removed docs/.gitbook/assets/Cloudy.png
Binary file not shown.
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ description: Web application for climate data analysis and visualization

The CBE Clima Tool is a web-based application built to support climate analysis specifically designed to support the need of architects and engineers interested in climate-adapted design. It allows users to analyze the climate data of more than 27,500 locations worldwide from both [Energy Plus](https://energyplus.net/weather) and [Climate.One.Building.org](http://climate.onebuilding.org/). You can, however, also choose to upload your own EPW weather file. Our tool can be used to analyze and visualize data contained in EnergyPlus Weather (EPW) files. It furthermore calculates a number of climate-related values (i.e. solar azimuth and altitude, Universal Thermal Climate Index (UTCI), comfort indices, etc.) that are not contained in the EPW files but can be derived from the information therein contained. It can be freely accessed at [clima.cbe.berkeley.edu](http://clima.cbe.berkeley.edu)

If you use this tool please consider citing us.
> If you use this tool please consider citing us. Betti, G., Tartarini, F., Nguyen, C, Schiavon, S. CBE Clima Tool:
> A free and open-source web application for climate analysis tailored to sustainable building design.
> Build. Simul. (2023). [https://doi.org/10.1007/s12273-023-1090-5](https://doi.org/10.1007/s12273-023-1090-5).
The CBE Clima Tool is open source. We have released the source code on a [public repository](https://github.com/CenterForTheBuiltEnvironment/clima). We welcome contributions from the community ([more info here](contributing/contributing.md)).

Expand Down
16 changes: 8 additions & 8 deletions my_project/extract_df.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import io
import re
import json
import math
import re
import zipfile
from datetime import timedelta
from urllib.request import Request, urlopen

import pandas as pd
import numpy as np
import pandas as pd
import requests
from my_project.utils import code_timer
from pvlib import solarposition
from pythermalcomfort.models import utci
from pythermalcomfort.models import solar_gain
from pythermalcomfort import psychrometrics as psy
import math
from my_project.global_scheme import month_lst
from my_project.global_scheme import mapping_dictionary
from pythermalcomfort.models import adaptive_ashrae
from pythermalcomfort.models import solar_gain
from pythermalcomfort.models import utci
from pythermalcomfort.utilities import running_mean_outdoor_temperature

from my_project.global_scheme import month_lst
from my_project.utils import code_timer


@code_timer
def get_data(source_url):
Expand Down
6 changes: 4 additions & 2 deletions my_project/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ def footer():
dcc.Markdown(
"""
Please cite us:
Betti G., Tartarini F., Nguyen C., Schiavon S. (2022). CBE Clima Tool: a free and open-source web application for climate analysis tailored to sustainable building design.
[Version: 0.8.12](https://center-for-the-built-environment.gitbook.io/clima/version/changelog) https://doi.org/10.48550/arxiv.2212.04609
Betti, G., Tartarini, F., Nguyen, C, Schiavon, S. CBE Clima Tool:
A free and open-source web application for climate analysis tailored to sustainable building design.
Build. Simul. (2023). [https://doi.org/10.1007/s12273-023-1090-5](https://doi.org/10.1007/s12273-023-1090-5).
[Version: 0.8.13](https://center-for-the-built-environment.gitbook.io/clima/version/changelog)
"""
),
dcc.Markdown(
Expand Down
50 changes: 29 additions & 21 deletions my_project/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import dash_bootstrap_components as dbc
import plotly.express as px
import copy
import requests


def code_timer(func):
Expand Down Expand Up @@ -202,9 +203,7 @@ def plot_location_epw_files():
df["lat"] += 0.005
df = df.rename(columns={"properties.epw": "Source"})

df_one_building = pd.read_csv("./assets/data/one_building.csv", compression="gzip")

fig2 = px.scatter_mapbox(
fig = px.scatter_mapbox(
df.head(2585),
lat="lat",
lon="lon",
Expand All @@ -214,24 +213,33 @@ def plot_location_epw_files():
zoom=2,
height=500,
)
fig = px.scatter_mapbox(
df_one_building,
lat="lat",
lon="lon",
hover_name=df_one_building["name"],
color_discrete_sequence=["#4895ef"],
hover_data=[
"period",
"elevation (m)",
"time zone (GMT)",
"99% Heating DB",
"1% Cooling DB ",
"Source",
],
zoom=2,
height=500,
)
fig.add_trace(fig2.data[0])
try:
print(requests.get("https://climate.onebuilding.org", timeout=2))

df_one_building = pd.read_csv(
"./assets/data/one_building.csv", compression="gzip"
)

fig2 = px.scatter_mapbox(
df_one_building,
lat="lat",
lon="lon",
hover_name=df_one_building["name"],
color_discrete_sequence=["#4895ef"],
hover_data=[
"period",
"elevation (m)",
"time zone (GMT)",
"99% Heating DB",
"1% Cooling DB ",
"Source",
],
zoom=2,
height=500,
)
fig.add_trace(fig2.data[0])
except requests.exceptions.ConnectTimeout:
pass
fig.update_layout(mapbox_style="carto-positron")
fig.update_layout(margin={"r": 0, "t": 0, "l": 0, "b": 0})

Expand Down

0 comments on commit a3b2403

Please sign in to comment.