Skip to content

Commit

Permalink
added notebook + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
holchtim committed Feb 27, 2019
1 parent 5fecd30 commit 5b163e2
Show file tree
Hide file tree
Showing 10 changed files with 4,502 additions and 388 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,30 @@ HexagDLy provides convolution and pooling methods for hexagonally sampled data w

## Getting Started

HexagDLy requires a working installation of [PyTorch](https://github.com/pytorch/pytorch). Please visit the PyTorch website http://pytorch.org/ or github page https://github.com/pytorch/pytorch and follow the installation instructions.
If you have downloaded HexagDLy, just add the directory `hexagdly/src` to your system's `$PYTHONPATH`, e.g. by adding the following line to your `.bashrc` or `.bash_profile` (or wherever your paths can be set)
There are different ways to get HexagDLy up and running on your system as shown below. Basic examples for the application of HexagDLy are given as [notebooks](notebooks). Additionally unit tests are provided in [tests](tests).

### Pip Installation

The suggested way to install HexagDLy is to set up a clean virtual python environment (e.g. with conda, see [https://www.anaconda.com/](https://www.anaconda.com/)) and use the provided pip installer. To install basic functionalities only use:

```
export PYTHONPATH='/path/to/hexagdly/src':$PYTHONPATH
pip install hexagdly
```

Basic examples for the application of HexagDLy are given as [notebooks](notebooks). Additionally unit tests are provided in [tests](tests). To run the notebooks and tests, additional packages are required as listed in [hexagdly_conda_prereqs.txt](hexagdly_conda_prereqs.txt).
To get all necessary dependencies to run the provided [unit tests](tests) and [notebooks](notebooks), add the ```dev``` option:

To set up a new conda environment (see [https://www.anaconda.com/](https://www.anaconda.com/)) on a Linux system, in which all provided code should be working, execute
```
pip install hexagdly[dev]
```


### Manual Installation

HexagDLy requires a working installation of [PyTorch](https://github.com/pytorch/pytorch). Please visit the PyTorch website http://pytorch.org/ or github page https://github.com/pytorch/pytorch and follow the installation instructions.
If you have downloaded HexagDLy, just add the directory `hexagdly/src` to your system's `$PYTHONPATH`, e.g. by adding the following line to your `.bashrc` or `.bash_profile` (or wherever your paths can be set)

```
conda create --name hexagdly --file /path/to/hexagdly/hexagdly_conda_prereqs.txt
export PYTHONPATH='/path/to/hexagdly/src':$PYTHONPATH
```

## How to use HexagDLy
Expand Down
116 changes: 0 additions & 116 deletions hexagdly_conda_prereqs.txt

This file was deleted.

2 changes: 0 additions & 2 deletions notebooks/addressing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import matplotlib.colors as mcolors
from matplotlib.patches import RegularPolygon
from matplotlib.collections import PatchCollection
import seaborn as sns

class Detector:
def __init__(self):
Expand Down Expand Up @@ -68,7 +67,6 @@ def plot(ax,x,y,grid=False,hexagons=False,lines=False):
collection.set_array(np.array(colors))
ax.add_collection(collection)
ax.scatter(x, y, color='k')
cmap = sns.cubehelix_palette(len(x), rot=-1, gamma=1, dark=.1, light=.7, hue=1, as_cmap=True)
c = mcolors.ColorConverter().to_rgb
rvb = make_colormap([c('red'), c('violet'), 0.33, c('violet'), c('blue'), 0.66, c('blue')])
ax.scatter(x, y, c=x, cmap=rvb)
Expand Down
Loading

0 comments on commit 5b163e2

Please sign in to comment.