Skip to main content

openvisuspy

Project description

Instructions

Preliminary setup:

set PYTHONPATH=C:\projects\OpenVisus\build\RelWithDebInfo;C:\projects\openvisuspy\src

# this is needed for SealStorage (https://www.sealstorage.io/). The key is meant for public read-only access 
set AWS_ACCESS_KEY_ID=any
set AWS_SECRET_ACCESS_KEY=any
set AWS_ENDPOINT_URL=https://maritime.sealstorage.io/api/v0/s3

# in case you want verbose logs
set VISUS_CPP_VERBOSE=1
set VISUS_NETSERVICE_VERBOSE=0

# dangerous for debugging-only settings
set BOKEH_ALLOW_WS_ORIGIN=*
set BOKEH_LOG_LEVEL=debug

Bokeh (cpp or py)

# [OK] cpp-bokeh-single 
python -m bokeh serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args -cpp --single

# [OK] cpp-bokeh-multi 
python -m bokeh serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args -cpp --multi

# [OK] py-bokeh-single 
python -m bokeh serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args --py --single

# [OK] py-bokeh-multi 
python -m bokeh serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args --py --multi

# NASA 200TB example
python -m bokeh serve "examples/dashboards/nasa.py"  --dev --address localhost --port 8888 --args -cpp --single

# [OK] jupyter-notebooks
set VISUS_BACKEND=cpp
python -m jupyter notebook ./examples/notebooks 

# [OK] py-jupyter notebooks
set VISUS_BACKEND=cpp
python -m jupyter notebook ./examples/notebooks 

Panel (cpp or py)

# [OK] cpp-panel-single 
python -m panel serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args -cpp --single

# [OK] cpp-panel-multi 
python -m panel serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args -cpp --multi

# [OK] py-panel-single 
python -m panel serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args --py --single

# [OK] py-panel-multi 
python -m panel serve "examples/dashboards/run.py"  --dev --address localhost --port 8888 --args --py --multi

# NASA 200TB example
python -m panel serve "examples/dashboards/nasa.py"  --dev --address localhost --port 8888 --args -cpp --single

# [OK] cpp-jupyter-notebooks
set VISUS_BACKEND=cpp
python -m jupyter notebook ./examples/notebooks 

# [OK] py-jupyter notebooks
set VISUS_BACKEND=py
python -m jupyter notebook ./examples/notebooks 

PyScript (py only)

Will work only with VISUS_BACKEND=py

# [OK] pyscript
python3 examples/server.py --directory ./

REMEMBER to resize the window, otherwise it will not work

JupyterLite (py only)

It seems that jupyter lite builds the output based on installed packages.

There should be other ways (by JSON file or command line) but for now creating a virtual env is good enough

ENV=/tmp/openvisuspy-lite-last
python3 -m venv ${ENV}
source ${ENV}/bin/activate

# you need to have exactly the same package version inside your jupyter notebook (see 12-jupyterlite.ipynb)
python3 -m pip install \
    jupyterlite==0.1.0b20 pyviz_comms numpy pandas requests xmltodict xyzservices pyodide-http colorcet \
    https://cdn.holoviz.org/panel/0.14.3/dist/wheels/bokeh-2.4.3-py3-none-any.whl \
    panel==0.14.2 \
    openvisuspy==0.0.20 \
    jupyter_server # this is needed to see the list of files

rm -Rf ${ENV}/_output && jupyter lite build --contents /mnt/c/projects/openvisuspy/examples/notebooks --output-dir ${ENV}/_output

# change port for avoiding caching
python3 -m http.server --directory ${ENV}/_output --bind localhost 14445
# jupyter lite serve --contents ./examples/notebooks --output-dir ${ENV}/_output --port 19722 

rsync -arv ${ENV}/_output/* scrgiorgio@shell.sci.utah.edu:www/demos/202303-1/jupyterlite/

# https://www.sci.utah.edu/~scrgiorgio/demos/202303-1/jupyterlite

Upload wheel

IMPORTANT: update PROJECT_VERSION in pyproject.toml

rm -f dist/*  
python3 -m build .
python3 -m twine upload --username "<your-username>"  --password "<your-password>" --skip-existing "dist/*.whl" 
# check on pyodide REPL `https://pyodide.org/en/stable/console.html` if you can import the pure python wheel

Useful/Inspiring links:

List:

Demos

scp examples/pyscript/* scrgiorgio@shell.sci.utah.edu:www/openvisuspy/examples/pyscript/

# https://www.sci.utah.edu/~scrgiorgio/openvisuspy/examples/pyscript/david_subsampled.html
# https://www.sci.utah.edu/~scrgiorgio/openvisuspy/examples/pyscript/2kbit1.html
# https://www.sci.utah.edu/~scrgiorgio/openvisuspy/examples/pyscript/chess_zip.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

openvisuspy-0.0.22-py3-none-any.whl (26.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page