Skip to content

Commit

Permalink
Merge pull request #37 from tmcclintock/docs/gh-36
Browse files Browse the repository at this point in the history
fix: README with poetry and ignore updates
  • Loading branch information
tmcclintock authored Nov 27, 2022
2 parents 22d16ac + 77c0988 commit b618cfe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 79 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# VS code stuff

.vscode*

# stuff I'm getting rid of
DEP*

Expand Down
94 changes: 15 additions & 79 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ Documentation for ``FrisPy`` package can be `found here on RTD

This repository contains a physical model for a flying disc. Using this code,
one can simulate trajectories of discs with varying initial conditions, while
also changing the underlying physical modlel. This is useful for analyzing
also changing the underlying physical model. This is useful for analyzing
the mechanics of a disc in terms of its design, as well as creating simulated
throws for things like disc launchers or other helpful tools.

This is a pure Python rebuild of the old FrisPy code, which included a version
of the integrator written in C for speed. To obtain a fast version of the
modeling code, either roll back to an old version or check out the
of the integrator written in C for speed. Find the fast C simulation in the
`Frisbee_Simulator <https://github.com/tmcclintock/Frisbee_Simulator>`_
repository.

Expand All @@ -39,57 +38,30 @@ be viewed `here <https://pypi.org/project/frispy/>`_.
pip install frispy
To install from source, there are other steps involved.
First, you must obtain the code from Github. If you have
`git <https://git-scm.com/>`_ installed you can clone the repository from
the command line:
.. code-block:: bash
git clone https://github.com/tmcclintock/FrisPy.git
or with the GitHub Desktop application. Once you have the code, change
into the directory and proceed.
For developers
--------------

Note, the only hard requirements for this package are ``python>=3.6``,
``numpy``, ``scipy``, and ``matplotlib`` (plotting only). Note that this package
uses the relatively recent
`scipy.integrate.solve_ivp
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html#scipy.integrate.solve_ivp>`_
method, which may not exist in older versions of ``scipy``. If you have these
three packages, you can install this package with the ``setup.py`` file without
worrying about creating an environment.

From an Anaconda environment
----------------------------

The preferred method of installation is with
`anaconda
<https://docs.conda.io/projects/conda/en/latest/index.html>`_
You can install all the requirements into a compatible environment called
``frispy`` by running the following command:
Development should be performed using `poetry <https://python-poetry.org/>`_ to handle
the development environment. Once poetry is installed, you can install the environment,
which will include ``frispy``:

.. code-block:: bash
conda env create -f environment.yml
poetry install
You can then install the package the usual way
All proceeding instructions assume you entered your virtual environment using ``poetry shell``,
otherwise prepend ``poetry run`` to all instructions.

.. code-block:: bash
python setup.py install
You can also use ``pip`` to install the requirements from the
``requirements.txt`` file by running:
If you intend to open a pull request, please make sure ``pre-commit`` is installed
before committing to your branch:

.. code-block:: bash
pip install -r requirements.txt
Then follow this by using the ``setup.py`` file to install.
pre-commit install
Testing
-------
This will ensure that the code you submit is PEP8 compliant. Otherwise, CI checks will
fail before merging can be completed.

Verify your installation by running:

Expand All @@ -99,39 +71,3 @@ Verify your installation by running:
Please report any problems you encounter on the `issues page
<https://github.com/tmcclintock/FrisPy/issues>`_. Thank you!

Running
-------

Check out ``example.py`` to see how to run and view results.
In words, you create a disc and compute its trajectory.

.. code-block:: python
from frispy import Disc
disc = Disc()
result = disc.compute_trajectory()
times = result.times
x, y, z = result.x, result.y, result.z
Once you have a trajectory, you can use that to create visualizations. For
instance, to plot the height of the disc against one of its horizontal
coordintes (``x``), you can run:

.. code-block:: python
import matplotlib.pyplot as plt
plt.plot(x, z)
plt.show()
Soon
----

There are some big upgrades on the horizon! Stay tuned for:

- animated trajectories
- documentation
- example Jupyter notebooks
- plotting routines

0 comments on commit b618cfe

Please sign in to comment.