Skip to content
Open
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using BH.Engine.Adapter;
using BH.Engine.Base;
using BH.oM.Adapter;
using BH.oM.Base;
using BH.oM.LadybugTools;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BH.Adapter.LadybugTools
{
public partial class LadybugToolsAdapter : BHoMAdapter
{
private List<object> RunCommand(CompareEPWKeyPlotCommand command, ActionConfig actionConfig)
{
bool ignoreEPWCheck = false;
if (actionConfig is LadybugConfig config)
ignoreEPWCheck = config.SkipEPWCheck;

if (command.EPWFile == null)
{
BH.Engine.Base.Compute.RecordError($"{nameof(command.EPWFile)} input cannot be null.");
return null;
}

if (!ignoreEPWCheck)
{
foreach (FileSettings epwFile1 in command.EPWCompareFiles)
{
if (!System.IO.File.Exists(epwFile1.GetFullFileName()))
{
BH.Engine.Base.Compute.RecordError($"File '{epwFile1.GetFullFileName()}' does not exist.");
return null;
}
}

if (!System.IO.File.Exists(command.EPWFile.GetFullFileName()))
{
BH.Engine.Base.Compute.RecordError($"File '{command.EPWFile.GetFullFileName()}' does not exist.");
return null;
}
}

if (command.EPWKey == EPWKey.Undefined)
{
BH.Engine.Base.Compute.RecordError("Please provide a valid EPW key.");
return null;
}

string epwFile = System.IO.Path.GetFullPath(command.EPWFile.GetFullFileName()).Replace('\\', '/');
List<string> epwFileList = command.EPWCompareFiles.Select(e => e.GetFullFileName().Replace('\\', '/')).ToList();

// run the process
List<string> args = new List<string>
{
"--command", "plot/epw_comparison",
"-e", epwFile,
"-dtk", command.EPWKey.ToText(),
"-p", command.OutputLocation.Replace('\\', '/'),
"-el" //append compare epw file list here
};
args.AddRange(epwFileList);

if (command.PlotTimeseries)
args.Add("-l");

string result = "";
bool success;

if (m_httpClient != null)
{
Task<(string, bool)> task = Compute.SendHttp(m_httpClient, args);
task.Wait();
(result, success) = task.Result;
}
else
{
//if the server was not running or some other error happened, try running the python directly.
string script = Path.Combine(Engine.LadybugTools.Query.PythonCodeDirectory(), "LadybugTools_Toolkit\\src\\ladybugtools_toolkit\\bhom", "run_wrapped.py");
string cmdCommand = $"{m_environment.Executable} {script} {args.Select(x => x.Contains(' ') || string.IsNullOrEmpty(x) ? '"' + x + '"' : x).Aggregate((a, b) => a + " " + b)}";

result = Engine.Python.Compute.RunCommandStdout(command: cmdCommand, hideWindows: true).Split('\n').Last();
}

try
{
CustomObject obj = (CustomObject)BH.Engine.Serialiser.Convert.FromJson(result);
PlotInformation info = Convert.ToPlotInformation(obj, new NoData()); //this plot type doesn't have collection metadata yet...
m_executeSuccess = true;
return new List<object>() { info };
}
catch (Exception ex)
{
BH.Engine.Base.Compute.RecordError(ex, $"An error occurred when deserialising the output from the script.\n Python output: {result}");
return new List<object>();
}
}
}
}
21 changes: 20 additions & 1 deletion LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@

plotInformation.Image = oldObject.CustomData["figure"].ToString();

plotInformation.OtherData = ToSimulationData((oldObject.CustomData["data"] as CustomObject).CustomData, toUpdate as dynamic);
Dictionary<string, object> data = (oldObject.CustomData["data"] as CustomObject)?.CustomData;

Check warning on line 46 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L46

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (data == null)
{
plotInformation.OtherData = toUpdate;
return plotInformation;
}

plotInformation.OtherData = ToSimulationData(data, toUpdate as dynamic);

return plotInformation;

Expand Down Expand Up @@ -159,11 +167,11 @@

private static SunPathData ToSimulationData(this Dictionary<string, object> oldData, SunPathData toUpdate)
{
try
{
Dictionary<string, object> decemberObject = (oldData["december_solstice"] as CustomObject).CustomData;

Check warning on line 172 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L172

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

Dictionary<string, object> sunset = (decemberObject["sunset"] as CustomObject).CustomData;

Check warning on line 174 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L174

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunset["azimuth"].ToString(), out double result))
result = double.NaN;
Expand All @@ -173,7 +181,7 @@
date = DateTime.MinValue;
toUpdate.DecemberSolstice.SunsetTime = date;

Dictionary<string, object> sunrise = (decemberObject["sunrise"] as CustomObject).CustomData;

Check warning on line 184 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L184

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunrise["azimuth"].ToString(), out result))
result = double.NaN;
Expand All @@ -183,7 +191,7 @@
date = DateTime.MinValue;
toUpdate.DecemberSolstice.SunriseTime = date;

Dictionary<string, object> noon = (decemberObject["noon"] as CustomObject).CustomData;

Check warning on line 194 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L194

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(noon["altitude"].ToString(), out result))
result = double.NaN;
Expand All @@ -198,11 +206,11 @@
BH.Engine.Base.Compute.RecordError(ex, "An error occurred while deserialising the December solstice:");
}

Check warning on line 207 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L170-L207

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

try
{
Dictionary<string, object> marchObject = (oldData["march_equinox"] as CustomObject).CustomData;

Check warning on line 211 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L211

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

Dictionary<string, object> sunset = (marchObject["sunset"] as CustomObject).CustomData;

Check warning on line 213 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L213

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunset["azimuth"].ToString(), out double result))
result = double.NaN;
Expand All @@ -212,7 +220,7 @@
date = DateTime.MinValue;
toUpdate.MarchEquinox.SunsetTime = date;

Dictionary<string, object> sunrise = (marchObject["sunrise"] as CustomObject).CustomData;

Check warning on line 223 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L223

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunrise["azimuth"].ToString(), out result))
result = double.NaN;
Expand All @@ -222,7 +230,7 @@
date = DateTime.MinValue;
toUpdate.MarchEquinox.SunriseTime = date;

Dictionary<string, object> noon = (marchObject["noon"] as CustomObject).CustomData;

Check warning on line 233 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L233

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(noon["altitude"].ToString(), out result))
result = double.NaN;
Expand All @@ -237,11 +245,11 @@
BH.Engine.Base.Compute.RecordError(ex, "An error occurred while deserialising the March equinox:");
}

Check warning on line 246 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L209-L246

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

try
{
Dictionary<string, object> juneObject = (oldData["june_solstice"] as CustomObject).CustomData;

Check warning on line 250 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L250

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

Dictionary<string, object> sunset = (juneObject["sunset"] as CustomObject).CustomData;

Check warning on line 252 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L252

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunset["azimuth"].ToString(), out double result))
result = double.NaN;
Expand All @@ -251,7 +259,7 @@
date = DateTime.MinValue;
toUpdate.JuneSolstice.SunsetTime = date;

Dictionary<string, object> sunrise = (juneObject["sunrise"] as CustomObject).CustomData;

Check warning on line 262 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L262

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunrise["azimuth"].ToString(), out result))
result = double.NaN;
Expand All @@ -261,7 +269,7 @@
date = DateTime.MinValue;
toUpdate.JuneSolstice.SunriseTime = date;

Dictionary<string, object> noon = (juneObject["noon"] as CustomObject).CustomData;

Check warning on line 272 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L272

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(noon["altitude"].ToString(), out result))
result = double.NaN;
Expand All @@ -276,11 +284,11 @@
BH.Engine.Base.Compute.RecordError(ex, "An error occurred while deserialising the June solstice:");
}

Check warning on line 285 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L248-L285

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

try
{
Dictionary<string, object> septemberObject = (oldData["september_equinox"] as CustomObject).CustomData;

Check warning on line 289 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L289

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

Dictionary<string, object> sunset = (septemberObject["sunset"] as CustomObject).CustomData;

Check warning on line 291 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L291

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunset["azimuth"].ToString(), out double result))
result = double.NaN;
Expand All @@ -290,7 +298,7 @@
date = DateTime.MinValue;
toUpdate.SeptemberEquinox.SunsetTime = date;

Dictionary<string, object> sunrise = (septemberObject["sunrise"] as CustomObject).CustomData;

Check warning on line 301 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L301

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(sunrise["azimuth"].ToString(), out result))
result = double.NaN;
Expand All @@ -300,7 +308,7 @@
date = DateTime.MinValue;
toUpdate.SeptemberEquinox.SunriseTime = date;

Dictionary<string, object> noon = (septemberObject["noon"] as CustomObject).CustomData;

Check warning on line 311 in LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs

View check run for this annotation

BHoMBot-CI / code-compliance

LadybugTools_Adapter/Convert/MetaData/PlotInformation.cs#L311

The use of CustomData within the code is discouraged except in circumstances where volatile data is being used. - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/IsUsingCustomData

if (!double.TryParse(noon["altitude"].ToString(), out result))
result = double.NaN;
Expand Down Expand Up @@ -380,6 +388,17 @@
return toUpdate;
}

private static ISimulationData ToSimulationData(Dictionary<string, object> oldObject, NoData toUpdate)
{
if (oldObject != null)
if (oldObject.TryGetValue("description", out object description))
{
toUpdate.Description = description.ToString();
}

return toUpdate;
}

/**************************************************/
/**** Private Methods: Fallback ****/
/**************************************************/
Expand Down
12 changes: 6 additions & 6 deletions LadybugTools_Engine/Python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ dependencies = [
"ladybug-radiance",
"ladybug-rhino",
"ladybug-vtk",
"lbt-dragonfly",
"lbt-honeybee",
"lbt-ladybug",
"lbt-recipes",
"lbt-dragonfly==0.12.99",
"lbt-honeybee==0.9.95",
"lbt-ladybug==0.27.150",
"lbt-recipes==0.26.23",
"lockfile",
"luigi",
"matplotlib",
Expand All @@ -82,8 +82,8 @@ dependencies = [
"py7zr",
"pybcj",
"pycryptodomex",
"pydantic",
"pydantic-openapi-helper",
"pydantic==1.10.22",
"pydantic-openapi-helper==0.2.11",
"pyparsing",
"pyppmd",
"python-daemon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#import methods and parsers
from ladybugtools_toolkit.bhom.wrapped.plot.walkability_heatmap import PARSER as walkability_heatmap_parser, walkability_heatmap
from ladybugtools_toolkit.bhom.wrapped.plot.epw_comparison import PARSER as epw_comparison_parser, epw_comparison
from ladybugtools_toolkit.bhom.wrapped.plot.windrose import PARSER as windrose_parser, windrose
from ladybugtools_toolkit.bhom.wrapped.plot.directional_solar_radiation import PARSER as directional_solar_radiation_parser, directional_solar_radiation
from ladybugtools_toolkit.bhom.wrapped.plot.diurnal import PARSER as diurnal_parser, diurnal
Expand All @@ -37,6 +38,7 @@
#dictionary containing all the parsers for bhom/wrapped commands
PARSERS = {
"plot/walkability_heatmap": (walkability_heatmap_parser, walkability_heatmap),
"plot/epw_comparison": (epw_comparison_parser, epw_comparison),
"plot/windrose": (windrose_parser, windrose),
"plot/directional_solar_radiation": (directional_solar_radiation_parser, directional_solar_radiation),
"plot/diurnal": (diurnal_parser, diurnal),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
"""Method to wrap for conversion of EPW to CSV file."""
# pylint: disable=C0415,E0401,W0703
import argparse
import os
import json
import sys
import traceback
import matplotlib
import matplotlib.figure
from ladybug.epw import EPW
from ladybugtools_toolkit.plot.compare import compare_epw_key_line, compare_epw_key_hist
from ladybugtools_toolkit.plot.utilities import figure_to_base64
import matplotlib.pyplot as plt
from ...logger import CONSOLE_LOGGER
from typing import List

PARSER = argparse.ArgumentParser(
description=(
"Given an EPW file path, and a list of epws to compare to, construct a line chart for a specific epw key."
)
)
PARSER.add_argument(
"-e",
"--epw_file",
help="The EPW file to compare from",
type=str,
required=True,
)
PARSER.add_argument(
"-el",
"--epw_list",
help="List of EPW files to compare with the base",
type=str,
nargs='*',
action="extend",
required=True,
)
PARSER.add_argument(
"-dtk",
"--data_type_key",
help="Key to compare.",
type=str,
required=True,
)
PARSER.add_argument(
"-p",
"--save_path",
help="Path where to save the output image.",
type=str,
required=False,
)
PARSER.add_argument(
"-l",
"--line",
help="Produce a line plot instead of a histogram",
action="store_true",
default=False
)

def epw_comparison(epw_file: str, epw_list: List[str], data_type_key: str, line:bool, save_path:str = None) -> str:
"""Create a timeseries plot with a line for each epw file for the specified data key and return it in a format readable by the LadybugToolsAdapter."""
try:
style = os.environ.get("BHOM_style_context", "python_toolkit.bhom")

with plt.style.context(style):
fig, ax = plt.subplots()

epws = [EPW(epw_file)]
epws.extend([EPW(f) for f in epw_list])

if line:
compare_epw_key_line(epws, key=data_type_key.lower().strip().replace(" ", "_"), style_context=style, ax=ax)
else:
compare_epw_key_hist(epws, key=data_type_key.lower().strip().replace(" ", "_"), style_context=style, ax=ax)

return_dict = {}

if save_path == None or save_path == "":
base64 = figure_to_base64(fig,html=False)
return_dict["figure"] = base64
else:
fig.savefig(save_path, dpi=150, transparent=True)
return_dict["figure"] = save_path

plt.close(fig)

return_dict["data"] = None #Unsure of how to create representative collection metadata for a comparison plot type that doesn't simply list every epw file compared

return json.dumps(return_dict, default=str)

except Exception:
CONSOLE_LOGGER.error("Timeseries comparison could not be created.", exc_info=1)
return traceback.format_exc()

if __name__ == "__main__":

args = PARSER.parse_args()
matplotlib.use("Agg")

epw_comparison(args.epw_file, args.epw_list, args.data_type_key, args.line, args.save_path)
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,38 @@
from .location import average_location, location_to_string

# pylint: enable=E0401

EPW_PROPERTIES = [
"aerosol_optical_depth",
"albedo",
"atmospheric_station_pressure",
"ceiling_height",
"days_since_last_snowfall",
"dew_point_temperature",
"diffuse_horizontal_illuminance",
"diffuse_horizontal_radiation",
"direct_normal_illuminance",
"direct_normal_radiation",
"dry_bulb_temperature",
"extraterrestrial_direct_normal_radiation",
"extraterrestrial_horizontal_radiation",
"global_horizontal_illuminance",
"global_horizontal_radiation",
"horizontal_infrared_radiation_intensity",
"liquid_precipitation_depth",
"liquid_precipitation_quantity",
"opaque_sky_cover",
"precipitable_water",
"present_weather_codes",
"present_weather_observation",
"relative_humidity",
"snow_depth",
"total_sky_cover",
"visibility",
"wind_direction",
"wind_speed",
"years",
"zenith_luminance",
]



Expand All @@ -66,41 +97,8 @@ def epw_to_dataframe(
A Pandas DataFrame containing the source EPW data.
"""

properties = [
"aerosol_optical_depth",
"albedo",
"atmospheric_station_pressure",
"ceiling_height",
"days_since_last_snowfall",
"dew_point_temperature",
"diffuse_horizontal_illuminance",
"diffuse_horizontal_radiation",
"direct_normal_illuminance",
"direct_normal_radiation",
"dry_bulb_temperature",
"extraterrestrial_direct_normal_radiation",
"extraterrestrial_horizontal_radiation",
"global_horizontal_illuminance",
"global_horizontal_radiation",
"horizontal_infrared_radiation_intensity",
"liquid_precipitation_depth",
"liquid_precipitation_quantity",
"opaque_sky_cover",
"precipitable_water",
"present_weather_codes",
"present_weather_observation",
"relative_humidity",
"snow_depth",
"total_sky_cover",
"visibility",
"wind_direction",
"wind_speed",
"years",
"zenith_luminance",
]

all_series = []
for prop in properties:
for prop in EPW_PROPERTIES:
try:
s = collection_to_series(getattr(epw, prop))
# s.rename((Path(epw.file_path).stem, "EPW", s.name), inplace=True)
Expand Down
Loading