Skip to content

Commit

Permalink
Properly configure setup.py; Clean up main directory
Browse files Browse the repository at this point in the history
  • Loading branch information
iandanforth committed Jul 2, 2018
1 parent 36fad44 commit 9d03dda
Show file tree
Hide file tree
Showing 29 changed files with 57 additions and 11 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.md LICENSE
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions notes/gen_debug_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

# Motor Neuron Pool Charts
if True:
if False:

# Recruitment Thresholds
if True:
Expand Down Expand Up @@ -161,7 +161,7 @@
plot(fig, filename='nominal-fatigabilities')

# Force Charts
if False:
if True:
xs = np.arange(0.0, 70.0, 0.1)
forces = []
all_forces_by_excitation = []
Expand Down
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions notes/target_force_sims.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import sys
import os
import numpy as np
import plotly.graph_objs as go
from plotly.offline import plot

sys.path.insert(0, os.path.abspath('..'))
from pymuscle import PotvinMuscleFibers
from pymuscle import PotvinMotorNeuronPool

motor_unit_count = 120
motor_unit_indices = np.arange(1, motor_unit_count + 1)

# Motor Neuron Pool
pool = PotvinMotorNeuronPool(motor_unit_count)

# Fibers
fibers = PotvinMuscleFibers(motor_unit_count)

# Target Force - 20% MVC
max_force = 2234.0
target_percent = 40
target_force = max_force * (target_percent / 100)
excitations = np.full(motor_unit_count, 1.0)
e_inc = 0.01
total_force = 0
sim_time = 0.0
sim_duration = 200.0
time_inc = 0.1
while sim_time < sim_duration:
while total_force < target_force:
firing_rates = pool.step(excitations)
normalized_firing_rates = fibers._normalize_firing_rates(firing_rates)
normalized_forcFaImes = fibers._calc_normalized_forces(normalized_firing_rates)
inst_forces = fibers._calc_inst_forces(normalized_forces)
total_force = fibers._calc_total_inst_force(inst_forces)
excitations += e_inc
sim_time += time_inc

print(excitations[0])
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions pymuscle/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pymuscle

VERSION = (0, 0, 1)

__version__ = '.'.join(map(str, VERSION))
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written by Kenneth Reitz: https://github.com/kennethreitz/setup.py

# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
Expand All @@ -14,16 +13,16 @@

# Package meta-data.
NAME = 'pymuscle'
DESCRIPTION = 'Simulated muscles for virtual agents'
DESCRIPTION = 'A motor unit based model of skeletal muscle and fatigue'
URL = 'https://github.com/iandanforth/pymuscle'
EMAIL = '[email protected]'
AUTHOR = 'Ian Danforth'
REQUIRES_PYTHON = '>=3.6.0'
VERSION = '0.0.1'
VERSION = None

# What packages are required for this module to be executed?
REQUIRED = [
# 'requests', 'maya', 'records',
'numpy',
]

# The rest you shouldn't have to touch too much :)
Expand Down Expand Up @@ -77,10 +76,10 @@ def run(self):
self.status('Uploading the package to PyPi via Twine…')
os.system('twine upload dist/*')

self.status('Pushing git tags…')
os.system('git tag v{0}'.format(about['__version__']))
os.system('git push --tags')
# self.status('Pushing git tags…')
# os.system('git tag v{0}'.format(about['__version__']))
# os.system('git push --tags')

sys.exit()


Expand All @@ -96,6 +95,7 @@ def run(self):
python_requires=REQUIRES_PYTHON,
url=URL,
# packages=find_packages(exclude=('tests',)),
# If your package is a single module, use this instead of 'packages':
py_modules=[NAME],

# entry_points={
Expand All @@ -118,4 +118,4 @@ def run(self):
cmdclass={
'upload': UploadCommand,
},
)
)

0 comments on commit 9d03dda

Please sign in to comment.