-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly configure setup.py; Clean up main directory
- Loading branch information
1 parent
36fad44
commit 9d03dda
Showing
29 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# pymuscle | ||
|
||
VERSION = (0, 0, 1) | ||
|
||
__version__ = '.'.join(map(str, VERSION)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 :) | ||
|
@@ -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() | ||
|
||
|
||
|
@@ -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={ | ||
|
@@ -118,4 +118,4 @@ def run(self): | |
cmdclass={ | ||
'upload': UploadCommand, | ||
}, | ||
) | ||
) |