GithubHelp home page GithubHelp logo

epfl-enac / bpe-sesvc Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 0.0 12.05 MB

Home Page: https://sesvc.epfl.ch

License: GNU General Public License v3.0

Shell 0.43% Makefile 0.61% Dockerfile 0.10% JavaScript 7.35% Python 1.16% TypeScript 31.67% HTML 0.31% Vue 58.02% SCSS 0.34%

bpe-sesvc's Introduction

bpe-sesvc

UNHCR GTH - Energy Planning tool

Status

Currently under development.

Development

Prerequisites

Prerequisites:

Run for development

Create .env file to hold your Secrets

An environment file should be created; you may copy paste the following code, don't forget to replace by the appropriate bucket name and HOSTNAME

tee -a .env << EOF
COUCHDB_USER=admin
COUCHDB_PASSWORD=couchdb
COUCHDB_HOST=localhost
# EPFL DNS
DNS=128.178.15.8

EOF

Installation

make install

CLI

make run-database;
make setup-database;
make run-frontend;
# http://127.0.0.1:8080

Visual Studio Code

Run configurations are in .vscode: https://code.visualstudio.com/docs/editor/debugging

Deployment

Local build with Docker Compose

make run # will build with docker-compose and run docker-compose up -d

Server

We use enacit-ansible to automate our process

Just run the following command and it will install the latest commit from the main branch

ansible-playbook -v -i inventory/sesvc.epfl.ch.yml  playbooks/deploy-app.yml
  • If you change couchdb-setup/etc/config.ini file
    • You'll need to do the following:
      ssh sesvc.epfl.ch
      # wait to be connected
      cd /opt/sesvc;
      docker-compose restart couchdb;
      

Deployment process

  • monthly (by the 1st) releases onto the production environment http://sesvc.epfl.ch/ including only features validated.
  • intermediate releases may happen occasionally for hot fixes

Releases number follow [semantic versioning conventions](https://semver.org/\).

Create a new user

There is two way of doing this: first one using curl; second one using couchdb-bootstrap

Using curl

  1. Follow: https://docs.couchdb.org/en/stable/intro/security.html#creating-a-new-user
curl -X PUT http://localhost:5984/_users/org.couchdb.user:[email protected] \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -d '{"name": "[email protected]", "password": "plain_text_password_that_will_be_encrypted", "roles": [], "type": "user"}'
  1. retrieve the inserted documented
 curl -X GET http://admin:couchdb@localhost:5984/_users/org.couchdb.user:[email protected] \
     -H "Accept: application/json" \
     -H "Content-Type: application/json"

{"_id":"org.couchdb.user:[email protected]","_rev":"1-xxxx","name":"[email protected]","roles":[],"type":"user","password_scheme":"pbkdf2","iterations":10,"derived_key":"917a923abd865bc82feadd5659a1d0d55318ca49","salt":"83f9a989d48e31b7a5e99c28df8a989c"}
  1. add the result json from above inside add the above json result as new file in couchdb-setup/bootstrap/_users/[email protected] : 3.a you can remove the _rev field
{
  "_id": "org.couchdb.user:[email protected]",
  "name": "[email protected]",
  "roles": [],
  "type": "user",
  "password_scheme": "pbkdf2",
  "iterations": 10,
  "derived_key": "917a923abd865bc82feadd5659a1d0d55318ca49",
  "salt": "83f9a989d48e31b7a5e99c28df8a989c"
}

Using couchdb bootstrap

  • add a new file inside couchdb-setup/bootstrap/_users with
{
  "_id": "org.couchdb.user:[email protected]",
  "name": "[email protected]",
  "roles": [],
  "type": "user",
  "password": "plain_text_that_will_be_hash_by_couchdb",
}
  • run the following command:
make setup-database

Update public keys for unhcr azure server

  • run make azure
make azure
  • then copy the content of the json azure/jwt_keys.json at the proper place inside couchdb-setup/bootstrap/_config.json
  • verify that the json is valid

Collaborators

EPFL Essential Tech Center ENAC FAR ENAC-IT4R

bpe-sesvc's People

Contributors

andreullal avatar blueur avatar charlottegiseleweil avatar github-actions[bot] avatar guilbep avatar sbancal avatar ymarcon avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bpe-sesvc's Issues

[FEATURE] Energy interventions : Cash-based interventions implementation

  • Confirm contents and equations - Inputs:
  1. Name of intervention
  2. First year of intervention (must be higher or equal to the first year of the planning
    period)
  3. Last year of intervention (must be lower or equal to the last year of the planning period)
  4. Targeted QLLs -- multiselect (Quality of life levels)
  5. Cost affordability yearly objective:
  • QLL 1 [%] -- if selected in (4)
  • QLL 2 [%] -- if selected in (4)
  • QLL 3 [%] -- if selected in (4)
  • QLL 4 [%] -- if selected in (4)
  • QLL 5 [%] -- if selected in (4)

5a. "Cost affordability objective differ each year" -- opens a pop up with a table of all year, all QLL to put different objectives? /!/!\ /!\

[FEATURE] Energy planning second baseline comparison

Hi Charlie, looking forward to meeting you tomorrow. We added a second baseline ( called Min BAU Kebri beyah) with its own affiliated inputs, but the results do not match the tool this time. For our reference case, as mentioned, it looks good. Yet I cannot see the reason of the discrepancy. I let you take a look at the excel, and maybe we also talk tomorrow on this when we meet.

Hi @charlie Weil, thank you for the great updates on the tool. I have checked the third scenario, OK Max Baseline (excel file attached), and made a third administrator template on the app. The exact same problem there is as it was for the OK Min Baseline. I suggest the discrepancies are rooted in the rounded number of proportion (%), but to be checked. Thanks!

OK Min_Baseline1.1_v1.xlsx

OK Max_BAU.xlsx

[FEATURE] Energy planning info tab

  • Rename “Shelters Types” by “housing Types” and have it viewed as a treemap by default if values are filled - with these values (and an “Edit ” button that changes to displaying the fields to fill).

[FEATURE] Cookstoves table UX improvements

  • mprove UI/UX for Cookstove selection

    • In the full version of cookstove : add cookstove photos
    • (+Add cooking technoology) button : Select stove, then select fuel
    • Add cookstoves per years (by default, paste the data from Year 0)
  • Simplified view (for the HHCooking expandable section) should only have the following columns: (Keep the per-year view with the menu)

  • Photo

  • Cookstove

  • Fuel

  • Total #

    • Upon hovering on the row of a given cookstove, you see a pie plot of the distribution of cookstoves “count per hh” for each SES cateogory.
  • [COOKSTOVES LIST](https://docs.google.com/spreadsheets/d/1WfFT5zLI8q9lZnfJz915MiEEQN1womr6/edit#gid=1172786498) should appear in the Reference Data tab!

  • Ability to add a custom cookstove to the DB /canceled

[BUG] Page is refreshed automatically

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When editing a form, after a while the page is refreshed and data are lost

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

[FEATURE] Energy planning summary tab


From @charlottegiseleweil to @prof. Edgard Gnansounou

thank you for the fruitful discussion today. I will be off tomorrow and Friday, but I have convened the specs to David who will keep working on implementation.

Now that the results/graphs are integrated within each module - I propose to keep the main “Results” tab and turn it into “SUmmary”. We still need to design this tab - could you tell us what kind of information you would like to eventually see in this final “Summary” tab with the key results of each module for example ?


Response from Prof.

@charlie Weil : Dear Charlie - Thank you for your message. regarding your question, I have already answer it in my excel files where a summary of the results is presented.

[FEATURE] Data Export

Describe the solution you'd like

HH Cooking Data export functionalities:

  • Export Outputs Results table (with given selection of interventions/not) . Verify that it contains all variables described in Part II + III described in doc Energy Planning Tool data to export.docx

  • Integrate key KPIs in the Outputs export. (August)

  • Export of Inputs (Part I. A+B+C) (August)

[FEATURE] Energy Interventions (i) hover

  • On HH Cooking screen, add 3 (i) buttons (for each intervention type) with explanations of the interventions upon hover. The following texts should be displayed:
  1. Energy substitution
    Through an energy substitution, a conventional or improved technology of the reference system is replaced by a clean or specific technology including solar cookers.
  2. Energy efficiency improvement
    With this type of basic intervention, a conventional technology of the reference system is replaced by an improved one that uses the same fuel but with an improved efficiency.
  3. Cash-based interventions
    The aim is to provide poor households with subsidies to improve their energy cost affordability.

[FEATURE] Energy Interventions - Energy subsitution (fixes)

Fixes based on latest specs - Energy Planning Tool - New modeling of interventions.pdf
Input lists and equations to be confirmed still.

  • Rename/list of inputs for Energy substitution intervention as follow :
  • Name of intervention -- text
  • New cookstove to diffuse -- dropdown: select cookstove
  • First year of intervention -- must be higher or equal to the first year of the planning
    period
  • Last year of intervention -- must be lower or equal to the last year of the planning period
  • Technologies to replace (in order) -- multiselect
  • Target QLL groups -- multiselect
  • Number of cookstoves per year (count per 10 hh)-- int
  • Total cost per year -- float (TO BE REMOVED? EDGARD?)
  • Share of subsidies:
    • Quality of Life Level 1 :
    • Quality of Life Level 2 :
    • Quality of Life Level 3 :
    • Quality of Life Level 4 :
    • Quality of Life Level 5 :

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.