Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Default Reports and Analyses #4887

Merged
merged 18 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
10 changes: 8 additions & 2 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ msgid "ANALYSIS_DESCRIPTION_BSyncr"
msgstr "The BSyncr analysis leverages the Normalized Metered Energy Consumption (NMEC) analysis to calculate a change point model. The data are passed to the analysis using BuildingSync. The result of the analysis are the coefficients of the change point model."

msgid "ANALYSIS_DESCRIPTION_BuildingUpgradeRecommendation"
msgstr "The Building Upgrade Recommendation analysis implements a workflow to identify buildings that may need a deep energy retrofit, equipment replaced or re-tuning based on building attributes such as energy use, year built, and square footage."
msgstr "The Building Upgrade Recommendation analysis implements a workflow to identify buildings that may need a deep energy retrofit, equipment replaced or re-tuning based on building attributes such as energy use, year built, and square footage. If your organization contains elements, the Element Statistics Analysis should be run prior to running this analysis."

msgid "ANALYSIS_DESCRIPTION_CO2"
msgstr "This analysis calculates the average annual CO2 emissions for the property's meter data. The analysis requires an eGRID Subregion to be defined in order to accurately determine the emission rates."
Expand All @@ -132,7 +132,7 @@ msgid "ANALYSIS_DESCRIPTION_EUI"
msgstr "The EUI analysis will sum the property's meter readings for the last twelve months to calculate the energy use per square footage per year. If there are missing meter readings, then the analysis will return a less that 100% coverage to alert the user that there is a missing meter reading."

msgid "ANALYSIS_DESCRIPTION_ElementStatistics"
msgstr "The Element Statistics analysis looks through a property's element data (if any) to count the number of elements of type 'D.D.C. Control Panel' and saves that quantity to the property"
msgstr "The Element Statistics analysis looks through a property's element data (if any) to count the number of elements of type 'D.D.C. Control Panel'. It also generates the aggregated (average) condition index values for scope 1 emission elements and saves those quantities to the property."

msgid "AND"
msgstr "AND"
Expand Down Expand Up @@ -517,6 +517,9 @@ msgstr "Building Performance Standard (BPS) Compliance Pathway Support"
msgid "Building Square Footage Threshold"
msgstr "Building Square Footage Threshold"

msgid "Building has BAS field"
msgstr "Building has BAS field"

msgid "BuildingSync Recommended Measures"
msgstr "BuildingSync Recommended Measures"

Expand Down Expand Up @@ -1814,6 +1817,9 @@ msgstr "Goal Setup"
msgid "Gross Floor Area"
msgstr "Gross Floor Area"

msgid "HAS_BAS_HELP"
msgstr "Select the field that indicates whether or not the building has a Building Automation System (BAS). This analysis expects a boolean field."

msgid "HOW THE SYSTEM AUTO-MATCHES YOUR PROPERTIES AND TAX LOTS:"
msgstr "HOW THE SYSTEM AUTO-MATCHES YOUR PROPERTIES AND TAX LOTS:"

Expand Down
Binary file modified locale/es/LC_MESSAGES/django.mo
Binary file not shown.
14 changes: 9 additions & 5 deletions locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: lokalise.com\n"
"Project-Id-Version: SEED Platform\n"
"PO-Revision-Date: 2024-11-14 21:09\n"
"PO-Revision-Date: 2024-11-25 06:35\n"
"Last-Translator: lokalise.com\n"
"Language-Team: lokalise.com\n\n"
"Language: es\n"
Expand Down Expand Up @@ -153,9 +153,8 @@ msgstr "El análisis BETTER aprovecha better.lbl.gov para calcular el ahorro de
msgid "ANALYSIS_DESCRIPTION_BSyncr"
msgstr "El análisis BSyncr aprovecha el análisis de consumo energético medido normalizado (NMEC) para calcular un modelo de punto de cambio. Los datos se transmiten al análisis mediante BuildingSync. El resultado del análisis son los coeficientes del modelo de punto de cambio."

#, fuzzy
msgid "ANALYSIS_DESCRIPTION_BuildingUpgradeRecommendation"
msgstr "El análisis de recomendaciones de mejora de edificios implementa un flujo de trabajo para identificar los edificios que pueden necesitar una profunda modernización energética, la sustitución de equipos o una nueva puesta a punto basada en atributos del edificio como el uso de la energía, el año de construcción y los metros cuadrados."
msgstr "El análisis de recomendación de mejora de edificios implementa un flujo de trabajo para identificar los edificios que pueden necesitar una renovación energética profunda, el reemplazo o la puesta a punto de equipos en función de los atributos del edificio, como el uso de energía, el año de construcción y la superficie en metros cuadrados. Si su organización contiene elementos, se debe ejecutar el análisis de estadísticas de elementos antes de ejecutar este análisis."

#, fuzzy
msgid "ANALYSIS_DESCRIPTION_CO2"
Expand All @@ -169,9 +168,8 @@ msgstr "El análisis EEEJ utiliza la dirección de cada propiedad para identific
msgid "ANALYSIS_DESCRIPTION_EUI"
msgstr "El análisis EUI sumará las lecturas de los contadores de la propiedad de los últimos doce meses para calcular el consumo de energía por metro cuadrado al año. Si faltan lecturas de contadores, el análisis devolverá una cobertura inferior al 100% para alertar al usuario de que falta una lectura de contador."

#, fuzzy
msgid "ANALYSIS_DESCRIPTION_ElementStatistics"
msgstr "El análisis de estadísticas de elementos examina los datos de los elementos de una propiedad (si los hay) para contar el número de elementos de tipo \"Panel de control D.D.C.\" y guarda esa cantidad en la propiedad"
msgstr "El análisis de estadísticas de elementos analiza los datos de elementos de una propiedad (si los hay) para contar la cantidad de elementos del tipo \"Panel de control DDC\". También genera los valores de índice de condición agregados (promedio) para los elementos de emisión de alcance 1 y guarda esas cantidades en la propiedad."

#, fuzzy
msgid "AND"
Expand Down Expand Up @@ -672,6 +670,9 @@ msgstr "Apoyo para el cumplimiento de las normas de rendimiento de edificios (BP
msgid "Building Square Footage Threshold"
msgstr "Umbral de metros cuadrados del edificio"

msgid "Building has BAS field"
msgstr "El edificio tiene campo BAS"

#, fuzzy
msgid "BuildingSync Recommended Measures"
msgstr "BuildingSync Medidas recomendadas"
Expand Down Expand Up @@ -2370,6 +2371,9 @@ msgstr "Configuración de la meta"
msgid "Gross Floor Area"
msgstr "Superficie bruta"

msgid "HAS_BAS_HELP"
msgstr "Seleccione el campo que indica si el edificio tiene o no un sistema de automatización de edificios (BAS). Este análisis espera un campo booleano."

#, fuzzy
msgid "HOW THE SYSTEM AUTO-MATCHES YOUR PROPERTIES AND TAX LOTS:"
msgstr "CÓMO EL SISTEMA EMPAREJA AUTOMÁTICAMENTE SUS PROPIEDADES Y LOTES FISCALES:"
Expand Down
Binary file modified locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
11 changes: 8 additions & 3 deletions locale/fr_CA/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ msgstr "L'analyse BETTER s'appuie sur better.lbl.gov pour calculer les économie
msgid "ANALYSIS_DESCRIPTION_BSyncr"
msgstr "L'analyse BSyncr exploite l'analyse de consommation d'énergie normalisée mesurée (NMEC) pour calculer un modèle de point de changement. Les données sont transmises à l'analyse à l'aide de BuildingSync. Le résultat de l'analyse sont les coefficients du modèle de point de changement."

#, fuzzy
msgid "ANALYSIS_DESCRIPTION_BuildingUpgradeRecommendation"
msgstr "Cette analyse met en œuvre un flux de travail pour identifier les bâtiments qui peuvent nécessiter une rénovation énergétique en profondeur, un remplacement ou un réajustement de l'équipement en fonction des attributs du bâtiment tels que la consommation d'énergie, l'année de construction et la superficie en pieds carrés."
msgstr "L'analyse des recommandations de mise à niveau des bâtiments met en œuvre un flux de travail pour identifier les bâtiments qui peuvent nécessiter une rénovation énergétique approfondie, un remplacement de l'équipement ou un réajustement en fonction des attributs du bâtiment tels que la consommation d'énergie, l'année de construction et la superficie en pieds carrés. Si votre organisation contient des éléments, l'analyse des statistiques des éléments doit être exécutée avant d'exécuter cette analyse."

msgid "ANALYSIS_DESCRIPTION_CO2"
msgstr "Cette analyse calcule les émissions annuelles moyennes de CO2 pour les données des compteurs de la propriété. L’analyse nécessite la définition d’une sous-région eGRID afin de déterminer avec précision les taux d’émission."
Expand All @@ -135,7 +134,7 @@ msgid "ANALYSIS_DESCRIPTION_EUI"
msgstr "L'analyse EUI additionnera les relevés de compteurs de la propriété au cours des douze derniers mois pour calculer la consommation d'énergie par pied carré et par an. S'il manque des relevés de compteur, l'analyse renvoie une couverture inférieure à 100 % pour alerter l'utilisateur qu'il manque un relevé de compteur."

msgid "ANALYSIS_DESCRIPTION_ElementStatistics"
msgstr "Cette analyse examine les données des éléments d'une propriété (le cas échéant) pour compter le nombre d'éléments de type « Panneau de configuration DDC » et enregistre cette quantité dans la propriété"
msgstr "L'analyse des statistiques des éléments examine les données des éléments d'une propriété (le cas échéant) pour compter le nombre d'éléments de type « Panneau de contrôle DDC ». Elle génère également les valeurs d'indice de condition agrégées (moyennes) pour les éléments d'émission de portée 1 et enregistre ces quantités dans la propriété."

msgid "AND"
msgstr "ET"
Expand Down Expand Up @@ -523,6 +522,9 @@ msgstr "Assistance au parcours de conformité aux normes de performance des bât
msgid "Building Square Footage Threshold"
msgstr "Seuil de superficie en pieds carrés du bâtiment"

msgid "Building has BAS field"
msgstr "Le bâtiment dispose d'un champ SAB"

msgid "BuildingSync Recommended Measures"
msgstr "Mesures recommandées par BuildingSync"

Expand Down Expand Up @@ -1830,6 +1832,9 @@ msgstr "Configuration des objectifs"
msgid "Gross Floor Area"
msgstr "Surface brute"

msgid "HAS_BAS_HELP"
msgstr "Sélectionnez le champ qui indique si le bâtiment est équipé ou non d'un système d'automatisation de bâtiment (SAB). Cette analyse attend un champ booléen."

msgid "HOW THE SYSTEM AUTO-MATCHES YOUR PROPERTIES AND TAX LOTS:"
msgstr "COMMENT LE SYSTÈME ADAPTE AUTOMATIQUEMENT VOS PROPRIETES ET LOTS D'IMPÔT:"

Expand Down
18 changes: 10 additions & 8 deletions seed/analysis_pipelines/element_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from celery import chain, shared_task
from django.db import connection
from django.db.models import Count, Q
from django.db.models import BooleanField, Count, Q

from seed.analysis_pipelines.pipeline import (
AnalysisPipeline,
Expand Down Expand Up @@ -115,9 +115,10 @@ def _run_analysis(self, analysis_property_view_ids, analysis_id):
# add ddc count by property id
if ddc_count_column:
ddc_count = ddc_count_by_property_id.get(property_view.property_id, 0)
property_view.state.extra_data[ddc_count_column.column_name] = ddc_count
if ddc_count:
analysis_property_view.parsed_results[ddc_count_column.column_name] = ddc_count
# convert to true/false
has_ddc = bool(ddc_count > 0)
property_view.state.extra_data[ddc_count_column.column_name] = has_ddc
analysis_property_view.parsed_results[ddc_count_column.column_name] = has_ddc

# add mean condition index by code
for code, col in existing_columns_names_by_code.items():
Expand Down Expand Up @@ -172,7 +173,7 @@ def _create_element_columns(analysis):
def _create_ddc_count_column(analysis):
try:
return Column.objects.get(
column_name="Number of D.D.C Control Panels",
column_name="Has D.D.C Control Panels",
organization=analysis.organization,
table_name="PropertyState",
)
Expand All @@ -181,12 +182,13 @@ def _create_ddc_count_column(analysis):
if analysis.can_create():
column = Column.objects.create(
is_extra_data=True,
column_name="Number of D.D.C Control Panels",
column_name="Has D.D.C Control Panels",
organization=analysis.organization,
table_name="PropertyState",
data_type=BooleanField,
)
column.display_name = "Number of D.D.C Control Panels"
column.column_description = "Number of D.D.C Control Panels"
column.display_name = "Has D.D.C Control Panels"
column.column_description = "Has D.D.C Control Panels"
column.save()

return column
Expand Down
17 changes: 9 additions & 8 deletions seed/analysis_pipelines/upgrade_recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import logging

from celery import chain, shared_task
from django.db.models import Count, Q
from pint import Quantity

from seed.analysis_pipelines.pipeline import (
Expand Down Expand Up @@ -91,6 +90,7 @@ def get_value(name):
target_gas_eui = get_value("target_gas_eui")
target_electric_eui = get_value("target_electric_eui")
condition_index = get_value("condition_index")
has_bas = get_value("has_bas")
year_built = property_view.state.year_built
gross_floor_area = property_view.state.gross_floor_area
elements = Element.objects.filter(property=property_view.property_id)
Expand Down Expand Up @@ -124,16 +124,17 @@ def get_value(name):
# if young building:
retrofit_threshold_year = config.get("year_built_threshold")
if year_built > retrofit_threshold_year:
# comment this out: switched to a boolean field instead of a count
# if has BAS and actual to benchmark eui ratio is "fair"
ddc_control_panel_count = elements.annotate(
ddc_control_panel_count=Count("id", filter=Q(extra_data__Component_SubType="D.D.C. Control Panel"))
)
has_bas = False
if ddc_control_panel_count:
has_bas = ddc_control_panel_count.order_by("ddc_control_panel_count").first().ddc_control_panel_count > 0
# ddc_control_panel_count = elements.annotate(
# ddc_control_panel_count=Count("id", filter=Q(extra_data__Component_SubType="D.D.C. Control Panel"))
# )
# has_bas = False
# if ddc_control_panel_count:
# has_bas = ddc_control_panel_count.order_by("ddc_control_panel_count").first().ddc_control_panel_count > 0

fair_actual_to_benchmark_eui_ratio = config.get("fair_actual_to_benchmark_eui_ratio")
if ((eui / benchmark) > fair_actual_to_benchmark_eui_ratio) and has_bas:
if ((eui / benchmark) > fair_actual_to_benchmark_eui_ratio) and has_bas is True:
return "Re-tuning"
else:
return "NO DER project recommended"
Expand Down
8 changes: 7 additions & 1 deletion seed/models/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ def get_highlights(self, property_id=None):

# Element Statistics
elif self.service == self.ELEMENTSTATISTICS:
return [{"name": k, "value": round(v, 2)} for k, v in results.items()]
res = []
for k, v in results.items():
if isinstance(v, str):
res.append({"name": k, "value": v})
else:
res.append({"name": k, "value": round(v, 2)})
return res
# Building Upgrade Recommendation
elif self.service == self.UPGRADERECOMMENDATION:
recommendation = results.get("Building Upgrade Recommendation")
Expand Down
8 changes: 3 additions & 5 deletions seed/models/filter_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ def views(self, views, columns=[]):
)
if not columns:
columns = Column.retrieve_all(org_id=self.organization_id, inventory_type=related_model, only_used=False, include_related=False)

if self.query_dict:
qd = QueryDict(mutable=True)
qd.update(self.query_dict)

filters, _annotations, _order_by = build_view_filters_and_sorts(
qd, columns, related_model, self.organization.access_level_names
)
filtered_views = views.filter(filters)
filters, annotations, _order_by = build_view_filters_and_sorts(qd, columns, related_model, self.organization.access_level_names)

filtered_views = views.annotate(**annotations).filter(filters)
else:
filtered_views = views

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ angular.module('SEED.controller.inventory_detail_analyses', []).controller('inve
'Notification',
'uploader_service',
'cycle_service',
'columns',
// eslint-disable-next-line func-names
function (
$state,
Expand All @@ -34,7 +35,8 @@ angular.module('SEED.controller.inventory_detail_analyses', []).controller('inve
analyses_service,
Notification,
uploader_service,
cycle_service
cycle_service,
columns
) {
$scope.item_state = inventory_payload.state;
$scope.inventory_type = $stateParams.inventory_type;
Expand Down Expand Up @@ -139,8 +141,9 @@ angular.module('SEED.controller.inventory_detail_analyses', []).controller('inve
controller: 'inventory_detail_analyses_modal_controller',
resolve: {
inventory_ids: () => [$scope.inventory.view_id],
cycles: () => cycle_service.get_cycles().then((result) => result.cycles),
property_columns: () => columns.filter((x) => x.table_name === 'PropertyState'),
current_cycle: () => $scope.cycle,
cycles: () => cycle_service.get_cycles().then((result) => result.cycles),
user: () => $scope.menu.user
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ angular.module('SEED.controller.inventory_detail_analyses_modal', []).controller
'Notification',
'analyses_service',
'inventory_ids',
'all_columns',
'property_columns',
'current_cycle',
'cycles',
'user',
// eslint-disable-next-line func-names
function ($scope, $sce, $log, $uibModalInstance, Notification, analyses_service, inventory_ids, all_columns, current_cycle, cycles, user) {
function ($scope, $sce, $log, $uibModalInstance, Notification, analyses_service, inventory_ids, property_columns, current_cycle, cycles, user) {
$scope.inventory_count = inventory_ids.length;
// used to disable buttons on submit
$scope.waiting_for_server = false;
$scope.cycles = cycles;
$scope.user = user;
$scope.all_columns = all_columns;
$scope.eui_columns = $scope.all_columns.filter((o) => o.data_type === 'eui');
$scope.property_columns = property_columns;
$scope.eui_columns = $scope.property_columns.filter((o) => o.data_type === 'eui');

$scope.new_analysis = {
name: null,
Expand Down Expand Up @@ -125,7 +125,8 @@ angular.module('SEED.controller.inventory_detail_analyses_modal', []).controller
electric_eui: null,
target_gas_eui: null,
target_electric_eui: null,
condition_index: null
condition_index: null,
has_bas: null
},
total_eui_goal: null,
ff_eui_goal: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ angular.module('SEED.controller.inventory_detail', []).controller('inventory_det
controller: 'inventory_detail_analyses_modal_controller',
resolve: {
inventory_ids: () => [$scope.inventory.view_id],
property_columns: () => columns.filter((x) => x.table_name === 'PropertyState'),
current_cycle: () => $scope.cycle,
cycles: () => cycle_service.get_cycles().then((result) => result.cycles),
user: () => $scope.menu.user
Expand Down
4 changes: 2 additions & 2 deletions seed/static/seed/js/controllers/inventory_list_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1643,9 +1643,9 @@ angular.module('SEED.controller.inventory_list', []).controller('inventory_list_
controller: 'inventory_detail_analyses_modal_controller',
resolve: {
inventory_ids: () => ($scope.inventory_type === 'properties' ? selectedViewIds : []),
all_columns: () => all_columns.filter((x) => x.table_name === 'PropertyState'),
cycles: () => cycles.cycles,
property_columns: () => all_columns.filter((x) => x.table_name === 'PropertyState'),
current_cycle: () => $scope.cycle.selected_cycle,
cycles: () => cycles.cycles,
user: () => $scope.menu.user
}
});
Expand Down
Loading
Loading