Skip to content

Commit

Permalink
Merge pull request #2481 from architecture-building-systems/2393-show…
Browse files Browse the repository at this point in the history
…-plot-input-files

Show plot input files
  • Loading branch information
jimenofonseca committed Dec 6, 2019
2 parents 7e5bf01 + 282008b commit 45a8ab3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cea/interfaces/dashboard/api/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,19 @@ def get(self, dashboard_index, plot_index):
plot = dashboard.plots[plot_index]

return get_plot_parameters(config, plot)


@api.route('/<int:dashboard_index>/plots/<int:plot_index>/input-files')
class DashboardPlotInputFiles(Resource):
def get(self, dashboard_index, plot_index):
"""
Get input files of Plot
"""
config = current_app.cea_config
plot_cache = cea.plots.cache.PlotCache(config)
dashboards = cea.plots.read_dashboards(config, plot_cache)

dashboard = dashboards[dashboard_index]
plot = dashboard.plots[plot_index]

return [locator_method(*args) for locator_method, args in plot.input_files]
3 changes: 3 additions & 0 deletions cea/plots/demand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def __init__(self, project, parameters, cache):
'E_cre_kWh']

self.input_files = [(self.locator.get_total_demand, [])] # all these scripts depend on demand
# Add building to input files if buildings are selected
if self.buildings:
self.input_files += [(self.locator.get_demand_results_file, [building]) for building in self.buildings]

@property
def hourly_loads(self):
Expand Down

0 comments on commit 45a8ab3

Please sign in to comment.