Procedurally generated worlds.
Planetoids is a high level Python API for generating interactive, procedurally generated worlds from data in a pandas DataFrame. Currently, Planetoids is able to terraform a planet from two-dimensional data that has an optional cluster attribute. It's still very new and will be growing in capabilities, but for now the library can achieve the following when terraforming a new world:- generates somewhere in space to render your creation
- generates an ecology based on input data statistics
- generates land masses
- these land masses have
- topographic detail (contours)
- relief detail (gradients)
- these land masses have
- generates lighting effects in the form of a hillshade
Your terraformed world can be rendered using many different map projections for different effects.
I'm hoping to add in hydrological effects, atmospheric effects, bathometry, vegetation, civilizations, animations and a whole lot more. If you'd be interested in helping shape and grow this library to its full potential, take a look at the issues with a good first issue label or raise an issue with features you think the library could benefit from.
Creating a Planetoid is as simple asimport planetoids as pt
planet = pt.Planetoid(df, x="x_column", y="y_column", cluster_field="cluster_column").fit_terraform()
For full working examples, check out the interactive online demo notebooks.
Planetoids depends on:- pandas
- sklearn
- shapely
- pyproj
- plotly
- opencv
- and their related dependencies like numpy and scipy
PyPI:
pip install planetoids
Manual:
wget https://github.com/paulds8/planetoids/archive/master.zip
unzip master.zip
rm master.zip
cd planetoids
pip install -r requirements.txt
If you're on Windows and installing from PyPI or manually, you may need to install the following packages from the Windows binaries for your Python version here:
For use in JupyterLab:
In order to get planetoids rendering inline within JupyterLab you will need to ensure you have ipywidgets
installed as well as the following extensions:
# Avoid "JavaScript heap out of memory" errors during extension installation
# (OS X/Linux)
export NODE_OPTIONS=--max-old-space-size=4096
# (Windows)
set NODE_OPTIONS=--max-old-space-size=4096
# Jupyter widgets extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0 --no-build
# FigureWidget support
jupyter labextension install plotlywidget@1.1.1 --no-build
# and jupyterlab renderer support
jupyter labextension install jupyterlab-plotly@1.1.2 --no-build
# JupyterLab chart editor support (optional)
jupyter labextension install jupyterlab-chart-editor@1.2 --no-build
# Build extensions (must be done to activate extensions since --no-build is used above)
jupyter lab build
# Unset NODE_OPTIONS environment variable
# (OS X/Linux)
unset NODE_OPTIONS
# (Windows)
set NODE_OPTIONS=
This library is super new, so there's not a ton of documentation to come by just yet, but the public-facing API is fully documented here.