Skip to content

Commit

Permalink
Platform v2 (#132)
Browse files Browse the repository at this point in the history
* clean project

* first commit

* fix login

* switch for docker compose

* load all data directly

* fix past_ndays_api_events

* ignore notebooks

* fix dash-leaflet to fix zoom update

* add images

* remove background

* add markers

* remove button

* button style

* remove useless

* rename

* update python version

* fix auto move

* keep same style

* fix test

* fix bandit

* fix codacy

* fix import

* fix mypy

* remove useless as

* missing )

* add init

* fix init style

* do not track site file

* max 30 mn

* use apply

* remove comented code

* merge lines

* use per envent

* remove debug print

* style

* wrong name

* use per

* use merge instead

* docstring

* fix sites call

* remove debug

* fix call

* header

* update comment
  • Loading branch information
MateoLostanlen authored Jan 6, 2024
1 parent d3953ad commit d6c178c
Show file tree
Hide file tree
Showing 43 changed files with 1,556 additions and 3,582 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: [3.8]
python: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
API_LOGIN: ${{ secrets.API_LOGIN }}
API_PWD: ${{ secrets.API_PWD }}
run: |
screen -dm python app/main.py
screen -dm python app/index.py
sleep 200
curl http://localhost:8050/
docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: [3.8]
python: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ipython_config.py

# pyenv
.python-version

*.ipynb
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down Expand Up @@ -147,3 +147,6 @@ app/data/login_correspondences.csv
# Poetry
requirements.txt
poetry.lock

#project files
site_devices.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim
FROM python:3.9-slim

# set work directory
WORKDIR /usr/src/app
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ style:
# Build the docker
build:
poetry export -f requirements.txt --without-hashes --output requirements.txt
docker build . -t pyronear/pyro-platform:python3.8-slim
docker build . -t pyronear/pyro-platform:python3.9-slim

# Run the docker for production
run:
poetry export -f requirements.txt --without-hashes --output requirements.txt
docker-compose -f docker-compose.yml up -d --build
docker compose -f docker-compose.yml up -d --build

# Run the docker for dev purposes
run_dev:
poetry export -f requirements.txt --without-hashes --output requirements.txt
docker-compose -f docker-compose-dev.yml up -d --build
docker compose -f docker-compose-dev.yml up -d --build

# Run the docker
stop:
docker-compose down
docker compose down

# Pin the dependencies
lock:
Expand Down
Empty file removed acme.json
Empty file.
6 changes: 6 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2020-2023, Pyronear.

# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0> for full license details.

# This file makes the app directory a Python package
15 changes: 15 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2020-2024, Pyronear.

# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0> for full license details.

import dash
import dash_bootstrap_components as dbc

# We start by instantiating the app
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.UNITED])

# We define a few attributes of the app object
app.title = "Pyronear - Monitoring platform"
app.config.suppress_callback_exceptions = True
server = app.server # Gunicorn will be looking for the server attribute of this module
16 changes: 16 additions & 0 deletions app/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* Style the scrollbar itself (width, color) */
::-webkit-scrollbar {
width: 10px; /* Scrollbar width */
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #FEBA6A; /* Scrollbar handle color */
border-radius: 5px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}

131 changes: 0 additions & 131 deletions app/assets/css/styles.css

This file was deleted.

7 changes: 0 additions & 7 deletions app/assets/data/group_correspondences.json

This file was deleted.

Binary file removed app/assets/images/background.png
Binary file not shown.
Binary file removed app/assets/images/pyro_alert_icon.png
Binary file not shown.
Binary file removed app/assets/images/pyro_alert_off.png
Binary file not shown.
Binary file removed app/assets/images/pyro_alert_on.png
Binary file not shown.
Binary file removed app/assets/images/pyro_fire_logo.png
Binary file not shown.
Binary file removed app/assets/images/pyro_oldfire_icon.png
Binary file not shown.
Binary file removed app/assets/images/up_arrow_png.png
Binary file not shown.
Loading

0 comments on commit d6c178c

Please sign in to comment.