Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to package #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ In order to use the functions in this package, you will need the following pytho

## Installation

Place this directory in your PYTHONPATH. The various functions can then be imported as, e.g.:
It could be installable as:

```
pip install --user .
```
The various functions can then be imported as, e.g.:

```
from rotations import rotate_vector_collection
Expand All @@ -44,4 +49,4 @@ pytest


contact:
[email protected]
[email protected]
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Packages required for basic usage of `rotations` package
numpy
astropy

# Packages required for unit tests
nose
coverage
47 changes: 47 additions & 0 deletions rotations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Rotations

This package contains functions to rotate collections of 2D and 3D vectors.

Some of the functionality of this package is taken from the [Halotools](https://halotools.readthedocs.io/en/latest/) utilities sudmodule, reproduced here for convenience.


## Description

This package contains tools to perform:

* rotations of 3D vectors,
* rotations of 2D vectors,
* and monte carlo rotations of 2D and 3D vectors.


## Requirements

In order to use the functions in this package, you will need the following python packages installed:

* numpy
* astropy


## Installation

Place this directory in your PYTHONPATH. The various functions can then be imported as, e.g.:

```
from rotations import rotate_vector_collection
```

or for 2- and 3-D specific functions,

```
from rotations.rotations3d import rotation_matrices_from_vectors
```

You can run the testing suite for this package using the [pytest](https://docs.pytest.org/en/latest/) framework by executing the following command in the package directory:

```
pytest
```


contact:
[email protected]
File renamed without changes.
8 changes: 4 additions & 4 deletions mcrotations.py → rotations/mcrotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
unicode_literals)
import numpy as np
from astropy.utils.misc import NumpyRNGContext
from vector_utilities import *
from rotate_vector_collection import rotate_vector_collection
from rotations2d import rotation_matrices_from_angles as rotation_matrices_from_angles_2d
from rotations3d import rotation_matrices_from_angles as rotation_matrices_from_angles_3d
from .vector_utilities import *
from .rotate_vector_collection import rotate_vector_collection
from .rotations2d import rotation_matrices_from_angles as rotation_matrices_from_angles_2d
from .rotations3d import rotation_matrices_from_angles as rotation_matrices_from_angles_3d


__all__=['random_rotation_3d',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from setuptools import setup

setup(
name='rotations',
version='1.0.0',
packages=["rotations"],
install_requires=["numpy", "astropy"],
tests_require=["nose","coverage"],
)