Skip to content

Commit

Permalink
Migrate explorer to streamlit
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Mar 24, 2024
1 parent 2878d4e commit c6deea1
Show file tree
Hide file tree
Showing 25 changed files with 769 additions and 2,402 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
Development
***********

- Migrate explorer to streamlit

0.79.0 (21.03.2024)
*******************

Expand Down
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,12 @@ Features
- Define general settings in Settings context
- Command line interface
- Web-API via FastAPI
- Rich UI features like wetterdienst explorer and `streamlit app`_
- Rich UI features like `wetterdienst explorer <https://wetterdienst.streamlit.app>`_
- Run SQL queries on the results
- Export results to databases and other data sinks
- Public Docker image
- Interpolation and Summary of station values

.. _streamlit app: https://wetterdienst.streamlit.app

Setup
*****

Expand Down
Binary file modified docs/img/wetterdienst_explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 5 additions & 33 deletions docs/usage/explorer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ Navigator for wetterdienst provided open data.
Introduction
************

Welcome to Wetterdienst Explorer, your friendly web-based GUI for the
Wetterdienst weather service library for Python. This web UI can easily be
self-hosted.

The implementation is still in its infancy, so we are happy about further
contributions.

Welcome to Wetterdienst Explorer, your friendly web-based GUI for the Wetterdienst library for Python. This web UI can
easily be self-hosted. A hosted version is available `here <https://wetterdienst.streamlit.app/>`_.

Screenshot
**********
Expand All @@ -31,10 +26,7 @@ Features
Coverage
========

Wetterdienst Explorer currently covers access to:

- Weather observation data from all providers that are implemented. Historical, recent and near real time.

Wetterdienst Explorer currently covers access to the entire Wetterdienst API. High resolution data may be slow to load.

Usage
*****
Expand All @@ -51,33 +43,13 @@ Install Wetterdienst and invoke the user interface::
wetterdienst explorer

# Navigate to web UI
open http://localhost:7891
open http://localhost:8501


Invoke using Docker
===================

Run the Wetterdienst user interface using Docker::

docker run -it --rm --publish=7891:7891 ghcr.io/earthobservations/wetterdienst wetterdienst explorer --listen 0.0.0.0:7891


Serve Wetterdienst Explorer at non-root URL
===========================================

If you are wrapping up Wetterdienst behind a reverse HTTP proxy, use the
``DASH_URL_BASE_PATHNAME`` environment variable to configure the HTTP base URL
the service is mounted on::

export DASH_URL_BASE_PATHNAME=/explorer/
wetterdienst explorer --listen=localhost:8891

The gist of a corresponding Nginx configuration snippet is::
docker run -it --rm --publish=7891:7891 ghcr.io/earthobservations/wetterdienst wetterdienst explorer --listen 0.0.0.0:8501

server {
server_name wetterdienst.example.org;
location ~ ^/explorer {
proxy_set_header Host $host;
proxy_pass http://localhost:8891;
}
}
1 change: 0 additions & 1 deletion docs/usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ Usage
restapi
explorer
docker
streamlit
settings
5 changes: 0 additions & 5 deletions docs/usage/streamlit.rst

This file was deleted.

1,309 changes: 439 additions & 870 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 5 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,9 @@ tqdm = ">=4,<5"
tzfpy = ">=0.15.2,<1"

crate = { version = ">=0.30.1,<1", optional = true } # Export feature.
dash = { version = ">=2.10,<2.16", optional = true } # Explorer UI feature.
dash-bootstrap-components = { version = ">=1.4,<2", optional = true } # Explorer UI feature.
dash-leaflet = { version = ">=1.0.8,<2", optional = true } # Explorer UI feature.
duckdb = { version = ">=0.9", optional = true } # Export feature.
duckdb = { version = ">=0.9", optional = true } # Export feature, Explorer UI feature.
eccodes = { version = ">=1.5.2,<1.7", optional = true }
fastapi = { version = ">=0.95.1,<0.111", optional = true } # HTTP REST API feature.
geojson = { version = ">=3,<4", optional = true } # Explorer UI feature.
httpx = { version = ">=0.24,<0.28", optional = true}
h5py = { version = ">=3.1,<4", optional = true } # Radar feature.
influxdb = { version = ">=5.3,<6", optional = true } # Export feature.
Expand All @@ -148,7 +144,8 @@ psycopg2-binary = { version = ">=2.8,<3", optional = true } # E
scipy = { version = ">=1.9,<1.13", optional = true } # Interpolation feature.
shapely = { version = ">=2,<3", optional = true } # Interpolation feature.
sqlalchemy = { version = ">=2,<2.1", optional = true } # Export feature.
streamlit = { version = ">=1.27,<2", optional = true, markers = "python_version != '3.9.7'" } # Streamlit app
statsmodels = { version = ">=0.14.1", optional = true } # Explorer UI feature.
streamlit = { version = ">=1.27,<2", optional = true, markers = "python_version != '3.9.7'" } # Explorer UI feature.
utm = { version = ">=0.7,<1", optional = true } # Interpolation feature.
uvicorn = { version = ">=0.14,<1", optional = true } # HTTP REST API feature.
wradlib = { version = ">=2.0.1,<3", optional = true } # Radar feature.
Expand All @@ -173,7 +170,6 @@ optional = true

[tool.poetry.group.test.dependencies]
coverage = { version = ">=7.3,<8", extras = ["toml"] }
dash = { version = ">=2.10,<2.16", extras = ["testing"] }
dirty-equals = ">=0.5.0,<1"
freezegun = ">=1.2,<2"
h5py = { version = ">=3.1,<3.11", optional = true}
Expand All @@ -188,9 +184,7 @@ pytest-dictsdiff = ">=0.5,<0.6"
pytest-notebook = ">=0.10"
pytest-rerunfailures = "<14"
pytest-xdist = ">=3,<4"
selenium = ">=4,<5"
surrogate = "==0.1"
webdriver-manager = ">=4,<5"

[tool.poetry.group.docs]
optional = true
Expand All @@ -213,7 +207,7 @@ cratedb = ["pandas", "crate"]
duckdb = ["pandas", "duckdb"]
eccodes = ["eccodes"]
excel = ["xlsxwriter"]
explorer = ["dash", "dash-bootstrap-components", "dash-leaflet", "geojson", "plotly"]
explorer = ["duckdb", "statsmodels", "streamlit", "plotly"]
export = ["pandas", "sqlalchemy", "xarray", "xlsxwriter", "zarr"]
import = ["xlsx2csv"]
influxdb = ["influxdb", "influxdb-client", "influxdb3-python"]
Expand All @@ -226,7 +220,6 @@ radar = ["h5py"]
radarplus = ["pybufrkit", "wradlib", "xradar"]
restapi = ["fastapi", "httpx", "uvicorn"]
sql = ["duckdb"]
streamlit = ["streamlit"]

[tool.poetry.scripts]
wetterdienst = 'wetterdienst.ui.cli:cli'
Expand Down Expand Up @@ -290,7 +283,7 @@ unfixable = ["ERA", "F401", "F841", "T20", "ERA001"]
"wetterdienst/ui/restapi.py" = ["B008", "UP007"]

[tool.pytest.ini_options]
addopts = "-rsfEX -p pytester --strict-markers --verbosity=3 --webdriver=Firefox --headless"
addopts = "-rsfEX -p pytester --strict-markers --verbosity=3"
#log_cli = true
#log_cli_level = "DEBUG"
log_date_format = "%Y-%m-%dT%H:%M:%S"
Expand Down Expand Up @@ -350,7 +343,6 @@ coverage = "pytest --cov=wetterdienst"
coverage-parallel = "pytest --cov=wetterdienst --numprocesses=auto -m 'not (explorer or cflake)'"
update = "poetry update"
citation = "python -m tools.citation"
streamlit = "streamlit run ./wetterdienst/ui/streamlit/app.py"

[build-system]
build-backend = "poetry.core.masonry.api"
Expand Down
Empty file removed tests/ui/explorer/__init__.py
Empty file.
54 changes: 0 additions & 54 deletions tests/ui/explorer/conftest.py

This file was deleted.

Loading

0 comments on commit c6deea1

Please sign in to comment.