Skip to content

Commit

Permalink
Version 2.0.0 (#4)
Browse files Browse the repository at this point in the history
* travis and optimal sets and reps

* removed the most complicated stuff

* removed repellent generator

* added tests, decorator-based API

* added first notebook example

* jupyter conversion

* ran black

* less variation on reps

* removed min reps consistency setting

* fixed travis file

* removed backslash

* bash in travis fix

* added sudo

* added underscore to name

* cleaned up travis

* chmod

* bash

* test for notebooks

* parameterized notebook tests

* replaced scalers with functions

* using pytest in all files

* deploy script and two notebooks

* bash in travis

* python 3.5 support?

* ran black

* condition black on python version

* removed f strings

* many python versions

* updated templates. python 35+ working
  • Loading branch information
tommyod authored Aug 17, 2019
1 parent 3d3616d commit a18b517
Show file tree
Hide file tree
Showing 18 changed files with 2,763 additions and 723 deletions.
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
language: python

notifications:
email: false

language: python
python:
- "3.5"
- "3.6"
- "3.7"

# The Travis CI job lifecycle specifies the order of the commands below phases.
# https://docs.travis-ci.com/user/job-lifecycle/#the-job-lifecycle

# -------------------- install: install any dependencies required -------------
before_install:
- uname --all # Print system information
- python --version # Print python information

# -------------------- script: run the build script ---------------------------
before_script:
- pip install jupyter matplotlib pytest
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip install black; fi
- pip install . # Install the package
- pip show streprogen # Show information about the package

script:
# Check that code is formatted correctly w.r.t. black (not avaiable on Py35)
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then black . --check; fi
- pytest streprogen --verbose --doctest-modules --color=yes # Run all tests
- pytest examples --verbose --doctest-modules --color=yes # Run the notebooks

# -------------------- deploy: deploy to PyPI ---------
deploy:
provider: script
script: bash deploy.sh
on:
branch: master
133 changes: 70 additions & 63 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,49 @@ Streprogen - the Python strength program generator.
.. image:: https://badge.fury.io/py/streprogen.svg
:target: https://pypi.org/project/streprogen/
:alt: PyPi


.. image:: https://readthedocs.org/projects/streprogen/badge/?version=latest
:target: http://streprogen.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


.. image:: https://travis-ci.com/tommyod/streprogen.svg?branch=master
:target: https://travis-ci.com/tommyod/streprogen
:alt: Test Status

To install the Python package locally, run `pip install streprogen`.
To run the code without installing Python, run these notebooks:

Install by running ``pip install streprogen``. Remember to read the documentation_.

.. _documentation: http://streprogen.readthedocs.io/en/latest/
* AA
* BB


Project summary
-----------------
---------------

Streprogen (short for **stre**\ ngth **pro**\ gram **gen**\ erator) is a
Python_
Python_ 3.5+
package which allows the user to easily create dynamic, flexible
strength training programs. The main features are:

* **Sensible defaults**\ : The software comes with sensible default values for all input parameters,
* **Sensible defaults**\ : We aim for sensible default values for all input parameters,
giving the novice strength athlete some guidance on parameter selection.
The software will raise warnings if the input parameters are unreasonable, but will still run.
The software will raise warnings for unreasonable input parameters, but will still run.
* **High level of customization**\ : Every important parameter can be changed by the user.
It is possible to create long-term training programs with several layers of periodization
if the user wishes to do so.
* **Simple object oriented interface**\ : The software is essentially built
on four classes ``StaticExercise``, ``DynamicExercise``, ``Day`` and
``Program``. In addition to these classes, a set of utility functions is
provided for advanced usage.
* **Pretty output**\ : The training programs are easily
saved as ``.txt``, ``.html`` or ``.tex`` files. From there you
can print it and bring it to the gym.
for advanced planning.
* **Simple interface**\ : The software should be usable even by people with little Python knowledge.
* **Pretty output**\ : Training programs may be saved as ``.txt``, ``.html`` or ``.tex`` files.
Print it and bring it to the gym.


TODO: Image here.


Installation
-----------------
------------

Here's the layman guide to installation.

(1) Download Anaconda_ distribution of Python_ 3.x from the Anaconda_ Website.
Expand All @@ -64,21 +71,20 @@ Sample code

.. code-block:: python
from streprogen import Program, Day, DynamicExercise, StaticExercise
# Create a 4-week program
program = Program('My first program!', duration = 4)
# Create some dynamic and static exercises
bench = DynamicExercise('Bench press',
start_weight = 60, final_weight = 80)
squats = DynamicExercise('Squats',
start_weight = 80, final_weight = 95)
curls = StaticExercise('Curls', '3 x 12')
day = Day(exercises = [bench, squats, curls])
# Add day(s) to program and render it
program.add_days(day)
from streprogen import Program
# Create a 4-week program, rounding every exercise to nearest unit og 5kg
program = Program("My first program!", duration=8, units="kg", round_to=5)
with program.Day("Day A"):
program.DynamicExercise("Bench press", start_weight=80, min_reps=3, max_reps=8)
program.DynamicExercise("Squats", start_weight=100, min_reps=3, max_reps=8)
with program.Day("Day B"):
program.DynamicExercise("Deadlifts", start_weight=100, percent_inc_per_week=2, min_reps=2, max_reps=7)
program.StaticExercise("Curls", "3 x 10 @ 18kg")
# Render the program, then print it
program.render()
print(program)
Expand All @@ -87,44 +93,45 @@ Sample code
----------------------------------------------------------------
Program: My first program!
Program parameters
duration: 4
duration: 8
reps_per_exercise: 25
avg_intensity: 75
reps_scalers: 1.2, 1, 0.8, 1
intensity_scalers: 0.9, 1, 1, 1
intensity: 80
reps_scalers:
intensity_scalers:
units: kg
----------------------------------------------------------------
Exercise information
Day 1
Bench press 60kg -> 80kg reps: [3, 8] weekly inc.: 7.5%
Squats 80kg -> 95kg reps: [3, 8] weekly inc.: 4.4%
Curls 3 x 12
Day A
Bench press 80kg -> 89.6kg
reps: [3, 8] weekly inc.: 1.5%
Squats 100kg -> 112.0kg
reps: [3, 8] weekly inc.: 1.5%
Day B
Deadlifts 100kg -> 116.0kg
reps: [2, 7] weekly inc.: 2.0%
Curls 3 x 10 @ 18kg
----------------------------------------------------------------
Program
Week 1
Day 1
Bench press 6 x 45kg 7 x 42.5kg 7 x 42.5kg 7 x 42.5kg
Squats 6 x 60kg 7 x 57.5kg 8 x 52.5kg 8 x 52.5kg
Curls 3 x 12
Day A
Bench press 7 x 60kg 6 x 65kg 5 x 65kg 4 x 70kg 3 x 70kg
Squats 7 x 75kg 6 x 80kg 5 x 80kg 4 x 85kg 3 x 90kg
Day B
Deadlifts 6 x 80kg 6 x 80kg 5 x 80kg 4 x 85kg
Curls 3 x 10 @ 18kg
Week 2
Day 1
Bench press 4 x 55kg 5 x 52.5kg 5 x 52.5kg 5 x 52.5kg 6 x 50kg
Squats 4 x 70kg 4 x 70kg 5 x 65kg 6 x 62.5kg 7 x 57.5kg
Curls 3 x 12
Day A
Bench press 7 x 60kg 7 x 60kg 7 x 60kg 6 x 65kg 5 x 65kg 4 x 70kg
Squats 7 x 75kg 7 x 75kg 7 x 75kg 6 x 80kg 5 x 85kg 4 x 90kg
Day B
Deadlifts 6 x 80kg 6 x 80kg 6 x 80kg 6 x 80kg
Curls 3 x 10 @ 18kg
Week 3
Day 1
Bench press 6 x 55kg 6 x 55kg 6 x 55kg
Squats 6 x 67.5kg 6 x 67.5kg 6 x 67.5kg
Curls 3 x 12
Week 4
Day 1
Bench press 5 x 62.5kg 6 x 60kg 6 x 60kg 7 x 57.5kg
Squats 5 x 75kg 6 x 70kg 6 x 70kg 7 x 67.5kg
Curls 3 x 12
----------------------------------------------------------------
...
...
5 changes: 5 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
pip install twine
python setup.py sdist
twine check dist/*
python -m twine upload dist/* --username tommyod --password $TWINE --skip-existing
Loading

0 comments on commit a18b517

Please sign in to comment.