An open API service indexing awesome lists of open source software.

https://github.com/paulds8/planetoids

The Terraforming Python Package!
https://github.com/paulds8/planetoids

cartography data-science gis jupyterlab pandas planetoids plotly python terraform

Last synced: about 2 months ago
JSON representation

The Terraforming Python Package!

Awesome Lists containing this project

README

          





Planetoids

Procedurally generated worlds.

![Build Status](https://img.shields.io/travis/com/paulds8/planetoids)
![Coverage Status](https://img.shields.io/codecov/c/github/paulds8/planetoids)
![Codacy Status](https://img.shields.io/codacy/grade/77b39d19f4c54647820cc7b7d22e2f41)
![Version](https://img.shields.io/pypi/v/planetoids)
![Status](https://img.shields.io/pypi/status/planetoids)
![License](https://img.shields.io/pypi/l/planetoids)

What is it?


Planetoids is a high level Python API for generating interactive, procedurally generated worlds from data in a pandas DataFrame.

What does it do?


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)
+ generates lighting effects in the form of a hillshade

Your terraformed world can be rendered using many different map projections for different effects.

This is just the beginning

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](https://github.com/paulds8/planetoids/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label or raise an issue with features you think the library could benefit from.

How to create a Planetoid


Creating a Planetoid is as simple as

```python
import 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](https://nbviewer.jupyter.org/github/paulds8/planetoids/blob/master/examples).

Installing


Planetoids depends on:

+ pandas
+ sklearn
+ shapely
+ pyproj
+ plotly
+ opencv
+ and their related dependencies like numpy and scipy

Install Options

PyPI:

```python
pip install planetoids
```

Manual:

```bash
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:

+ [shapely](https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely)
+ [opencv](https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv)

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:

```bash
# 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=
```

Documentation

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](https://paulds8.github.io/planetoids/planetoids.m).