Skip to content

Commit

Permalink
Export CTS facility upload template for Federal BPS (#4792)
Browse files Browse the repository at this point in the history
* Fix extra data

* Fixed CTS export on Windows

* Updated CTS export modal to allow both options, fixed several other bugs

* renamed CTS exports, moved both to property views file, updated wording

* Fixed CTS export on Windows
Updated CTS export modal to allow both options, fixed several other bugs
Renamed CTS exports, moved both to property views file, updated wording
Cleanup
Updated translations

* Fixed conflict

---------

Co-authored-by: Alex Swindler <[email protected]>
  • Loading branch information
kflemin and axelstudios authored Sep 13, 2024
1 parent 27a9486 commit c528a51
Show file tree
Hide file tree
Showing 16 changed files with 325 additions and 125 deletions.
Binary file modified locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
32 changes: 31 additions & 1 deletion locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ msgstr "Also delete {num,plural, one{1 associated batch analysis} other{# associ
msgid "ANALYSIS_DESCRIPTION_BETTER"
msgstr "The BETTER analysis leverages better.lbl.gov to calculate energy, cost, and GHG emission savings by comparing the property's change point model with a benchmarked model. The results include saving potential and a list of recommended high-level energy conservation measures."

msgid "ANALYSIS_DESCRIPTION_BSYNCR"
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."

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 @@ -128,6 +131,9 @@ msgstr "The EEEJ Analysis uses each property's address to identify the 2010 cens
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"

msgid "AND"
msgstr "AND"

Expand Down Expand Up @@ -541,6 +547,9 @@ msgstr "Normally when an imported record is merged into another record the newes
msgid "COMPLETE_AND_REFRESH"
msgstr "Complete and Refresh Page"

msgid "CONDITION_INDEX_THRESHOLD_HELP"
msgstr "The condition index to use as a comparison threshold in the calculations."

msgid "CONFIGURE_CYCLES"
msgstr "Select one or more cycles from the dropdown above to visualize in the charts below."

Expand Down Expand Up @@ -1414,9 +1423,15 @@ msgstr "Geocoding failed - Your MapQuest API Key is invalid. Update your MapQues
msgid "FAILED_GEOCODE_MAPQUEST_API_KEY_ERROR"
msgstr "Geocoding failed - Your MapQuest API Key is either invalid or at its limit. Update your MapQuest API Key or disable geocoding in Organization Settings."

msgid "FAIR_BENCHMARK_RATIO_HELP"
msgstr "The fair ratio of Total EUI to Benchmark Total EUI value to use. Ratio = Total EUI/Benchmark EUI"

msgid "FEMP CTS Reporting Export"
msgstr "FEMP CTS Reporting Export"

msgid "FF_RSL_THRESHOLD_HELP"
msgstr "The remaining service life value to use for your fossil fuel-fired equipment as a comparison threshold in the calculations. For instance, perhaps your remaining service life threshold is 0 years and your gas boiler has a remaining service life of -1 year, therefore not meeting the threshold."

msgid "FIELDS NEEDED TO MAKE MATCHES:"
msgstr "FIELDS NEEDED TO MAKE MATCHES:"

Expand All @@ -1432,6 +1447,9 @@ msgstr "Field names for matching"
msgid "FILE_TYPES_SUPPORTED"
msgstr "File types supported: <strong>.csv</strong>, <strong>.xls</strong>, <strong>.xlsx</strong>, <strong>.xml</strong>, <strong>.zip</strong>, <strong>.geojson</strong>, and <strong>.json</strong>."

msgid "FOSSIL_FUEL_EUI_HELP"
msgstr "Fossil Fuel EUI Goal for the building (includes Gas, Etc.)"

msgid "Failed to delete inventory"
msgstr "Failed to delete inventory"

Expand Down Expand Up @@ -2492,6 +2510,9 @@ msgstr "Portfolio Manager Meter Import Results"
msgid "PM_PROPERTY_ID_MATCHING_CRITERIA_WARNING"
msgstr "Removing PM Property ID from matching criteria can cause unexpected issues for Portfolio Manager Meter imports."

msgid "POOR_BENCHMARK_RATIO_HELP"
msgstr "The poor ratio of Total EUI to Benchmark Total EUI value to use. Ratio = Total EUI/Benchmark EUI"

msgid "PORTFOLIO_SUMMARY_HEADER_TEXT"
msgstr "The portfolio summary page compares 2 cycles to calculate progress toward an Energy Use Intensity reduction goal. Cycle selection and goal details can be customized by clicking the Configure Goals button below."

Expand Down Expand Up @@ -3174,6 +3195,9 @@ msgstr "Showing {start} to {end} of {total} properties"
msgid "SHOWING_UNFILTERED_TAXLOTS"
msgstr "Showing {start} to {end} of {total} tax lots"

msgid "SQUARE_FOOTAGE_THRESHOLD_HELP"
msgstr "The gross square footage to use as a comparison threshold in the calculations"

msgid "STEP 1: Map Your Data"
msgstr "STEP 1: Map Your Data"

Expand Down Expand Up @@ -3484,6 +3508,9 @@ msgstr "At least one of the following Tax Lot fields is required"
msgid "THERMAL_CONV_ASSUMPTION_TITLE"
msgstr "Thermal Conversion Assumption"

msgid "TOTAL_EUI_HELP"
msgstr "Total EUI Goal for the building (includes Electricity, Gas, etc.)"

msgid "TWO_FACTOR_DISABLED_TEXT"
msgstr "Choosing this option will disable two-factor authentication for your account, making it less secure."

Expand Down Expand Up @@ -4105,6 +4132,9 @@ msgstr "{x_axis_label} vs. {y_axis_label} (Aggregated)"
msgid "Y Axis"
msgstr "Y Axis"

msgid "YEAR_BUILT_THRESHOLD_HELP"
msgstr "The year built to use as a comparison threshold in the calculations"

msgid "Year"
msgstr "Year"

Expand Down
Binary file modified locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
33 changes: 32 additions & 1 deletion locale/fr_CA/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ msgstr "Supprimez également {num,plural, one{ 1 analyse de lot associée } othe
msgid "ANALYSIS_DESCRIPTION_BETTER"
msgstr "L'analyse BETTER s'appuie sur better.lbl.gov pour calculer les économies d'énergie, de coûts et d'émissions de GES en comparant le modèle de point de changement de la propriété avec un modèle de référence. Les résultats comprennent un potentiel d'économie et une liste de mesures d'économie d'énergie de haut niveau recommandées."

msgid "ANALYSIS_DESCRIPTION_BSYNCR"
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."

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 @@ -130,6 +134,9 @@ msgstr "L'analyse EEEJ utilise l'adresse de chaque propriété pour identifier l
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é"

msgid "AND"
msgstr "ET"

Expand Down Expand Up @@ -549,6 +556,9 @@ msgstr "Normalement, lorsqu'un enregistrement importé est fusionné dans un aut
msgid "COMPLETE_AND_REFRESH"
msgstr "Complétez et Actualisez la Page"

msgid "CONDITION_INDEX_THRESHOLD_HELP"
msgstr "L'indice de condition à utiliser comme seuil de comparaison dans les calculs."

msgid "CONFIGURE_CYCLES"
msgstr "Sélectionnez un ou plusieurs cycles dans la liste déroulante ci-dessus pour visualiser dans les graphiques ci-dessous."

Expand Down Expand Up @@ -1427,9 +1437,15 @@ msgstr "Échec du géocodage : votre clé API MapQuest n'est pas valide. Mettez
msgid "FAILED_GEOCODE_MAPQUEST_API_KEY_ERROR"
msgstr "Échec du géocodage : votre clé API MapQuest n'est pas valide ou a atteint sa limite. Mettez à jour votre clé API MapQuest ou désactivez le géocodage dans les paramètres de l'organisation."

msgid "FAIR_BENCHMARK_RATIO_HELP"
msgstr "Le ratio équitable entre le total de l'IUE et la valeur totale de référence de l'IUE à utiliser. Ratio = Total de l'IUE/Indice de référence de l'IUE"

msgid "FEMP CTS Reporting Export"
msgstr "Export pour FEMP CTS"

msgid "FF_RSL_THRESHOLD_HELP"
msgstr "La valeur de la durée de vie restante à utiliser pour votre équipement alimenté au combustible fossile comme seuil de comparaison dans les calculs. Par exemple, votre seuil de durée de vie restante est peut-être de 0 an et votre chaudière à gaz a une durée de vie restante de -1 an, ce qui ne correspond donc pas au seuil."

msgid "FIELDS NEEDED TO MAKE MATCHES:"
msgstr "CHAMPS NÉCESSAIRES POUR ÉTABLIR DES CORRESPONDANCES:"

Expand All @@ -1445,6 +1461,9 @@ msgstr "Noms de zone pour l'appariement"
msgid "FILE_TYPES_SUPPORTED"
msgstr "Types de fichiers pris en charge: <strong>.csv</strong>, <strong>.xls</strong>, <strong>.xlsx</strong>, <strong>.xml</strong>, <strong>.zip</strong>, <strong>.geojson</strong>, et <strong>.json</strong>."

msgid "FOSSIL_FUEL_EUI_HELP"
msgstr "Objectif d'IEC en matière de combustibles fossiles pour le bâtiment (y compris le gaz, etc.)"

msgid "Failed to delete inventory"
msgstr "Échec de la suppression de l'inventaire"

Expand Down Expand Up @@ -2510,6 +2529,9 @@ msgstr "Résultats d'importation de Portfolio Manager"
msgid "PM_PROPERTY_ID_MATCHING_CRITERIA_WARNING"
msgstr "La suppression de l'ID de propriété PM des critères de correspondance peut entraîner des problèmes inattendus pour les importations de compteurs Portfolio Manager."

msgid "POOR_BENCHMARK_RATIO_HELP"
msgstr "Le ratio entre l'IUE total et la valeur de l'IUE total de référence est faible. Ratio = IUE total/IUE de référence"

msgid "PORTFOLIO_SUMMARY_HEADER_TEXT"
msgstr "La page de résumé du portefeuille compare 2 cycles pour calculer les progrès vers un objectif de réduction de l'intensité de l'utilisation d'énergie. La sélection du cycle et les détails des objectifs peuvent être personnalisés en cliquant sur le bouton Configurer les Objectifs ci-dessous."

Expand Down Expand Up @@ -3202,6 +3224,9 @@ msgstr "Affichage {start} à {end} des {total} propriétés en tout"
msgid "SHOWING_UNFILTERED_TAXLOTS"
msgstr "Affichage {start} à {end} des {total} lots d'impôt en tout"

msgid "SQUARE_FOOTAGE_THRESHOLD_HELP"
msgstr "La superficie brute à utiliser comme seuil de comparaison dans les calculs"

msgid "STEP 1: Map Your Data"
msgstr "ÉTAPE 1: Mappez vos données"

Expand Down Expand Up @@ -3513,6 +3538,9 @@ msgstr "Au moins l'un des domaines fiscal Lot suivants est requis"
msgid "THERMAL_CONV_ASSUMPTION_TITLE"
msgstr "Choix de Conversion Thermique"

msgid "TOTAL_EUI_HELP"
msgstr "Objectif EUI total pour le bâtiment (comprend l'électricité, le gaz, etc.)"

msgid "TWO_FACTOR_DISABLED_TEXT"
msgstr "Choisir cette option désactivera l’authentification à deux facteurs pour votre compte, le rendant moins sécurisé."

Expand Down Expand Up @@ -4139,6 +4167,9 @@ msgstr "{x_axis_label} contre {y_axis_label} (agrégé)"
msgid "Y Axis"
msgstr "Axe Y"

msgid "YEAR_BUILT_THRESHOLD_HELP"
msgstr "L'année de construction à utiliser comme seuil de comparaison dans les calculs"

msgid "Year"
msgstr "An"

Expand Down
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ requests==2.32.0
probablepeople==0.5.4
xmlschema==1.1.1
lark==0.11.3
pandas==2.2.2

# Parsing and managing geojson data (this is only used in managed tasks at the moment)
geojson==2.5.0
Expand Down
51 changes: 27 additions & 24 deletions seed/static/seed/js/controllers/export_to_cts_modal_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,42 @@ angular.module('SEED.controller.export_to_cts_modal', []).controller('export_to_
'ids',
'org_id',
'inventory_service',
'uploader_service',
// eslint-disable-next-line func-names
function ($http, $scope, $state, $uibModalInstance, user_service, ids, org_id, inventory_service, uploader_service) {
$scope.ids = ids;
$scope.org_id = org_id;
function ($http, $scope, $state, $uibModalInstance, user_service, ids, org_id, inventory_service) {
$scope.exporting = false;

/**
* @type {'evaluation_template' | 'facility_bps_template' | null}
*/
$scope.export_selection = null;
$scope.set_selection = (selection) => {
$scope.export_selection = selection;
};

$scope.set_name = (name) => {
$scope.export_name = name;
};

$scope.export = () => {
let filename = $scope.export_name;
if (!filename.endsWith('.xlsx')) filename += '.xlsx';
$scope.exporting = true;

$http.get('/api/v3/tax_lot_properties/start_export_to_cts/', {
params: {
organization_id: user_service.get_organization().id
}
})
.then((data) => {
uploader_service.check_progress_loop(
data.data.progress_key,
0,
1,
() => {},
() => {},
$scope.exporter_progress
);
return inventory_service.export_to_cts(ids).then((data) => {
const blob_type = data.headers()['content-type'];
const blob = new Blob([data.data], { type: blob_type });
saveAs(blob, filename);
$scope.close();
});
if ($scope.export_selection === 'evaluation_template') {
inventory_service.evaluation_export_to_cts(ids).then((data) => {
const blob_type = data.headers()['content-type'];
const blob = new Blob([data.data], { type: blob_type });
saveAs(blob, filename);
$scope.close();
});
} else if ($scope.export_selection === 'facility_bps_template') {
inventory_service.facility_bps_export_to_cts(org_id, { property_view_ids: ids }).then((data) => {
const blob_type = data.headers()['content-type'];
const blob = new Blob([data.data], { type: blob_type });
saveAs(blob, filename);
$scope.close();
});
}
};

$scope.cancel = () => {
Expand Down
15 changes: 13 additions & 2 deletions seed/static/seed/js/services/inventory_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,10 @@ angular.module('SEED.service.inventory', []).factory('inventory_service', [
organization_id: user_service.get_organization().id
});

inventory_service.export_to_cts = (property_view_ids, filename = 'test.xlsx') => $http.post(
`/api/v3/tax_lot_properties/export_to_cts/?organization_id=${user_service.get_organization().id}`,
// this is the CTS Comprehensive Evaluation Upload Template
// which uses the BAE/BuildingSync workflow
inventory_service.evaluation_export_to_cts = (property_view_ids, filename = 'test.xlsx') => $http.post(
`/api/v3/properties/evaluation_export_to_cts/?organization_id=${user_service.get_organization().id}`,
{
filename,
property_view_ids
Expand All @@ -1223,6 +1225,15 @@ angular.module('SEED.service.inventory', []).factory('inventory_service', [
}
);

// this is the CTS Facility Upload Template for Federal BPS
// which uses the SEED-based workflow (not buildingsync)
inventory_service.facility_bps_export_to_cts = (org_id, property_view_ids) => $http
.post(
`/api/v3/properties/facility_bps_export_to_cts/?organization_id=${org_id}`,
property_view_ids,
{ responseType: 'arraybuffer' }
);

inventory_service.filter_by_property = (cycle_id, property_ids) => $http.post('/api/v3/properties/filter_by_property/', {
organization_id: user_service.get_organization().id,
cycle: cycle_id,
Expand Down
Loading

0 comments on commit c528a51

Please sign in to comment.