forked from ppaquette/gym-super-mario
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Flavian Hautbois
committed
Feb 21, 2018
1 parent
f6a516e
commit 9d86380
Showing
14 changed files
with
53 additions
and
22 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
This file was deleted.
Oops, something went wrong.
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,21 +1,14 @@ | ||
from setuptools import setup, find_packages | ||
import sys, os | ||
from setuptools import setup | ||
|
||
# Don't import gym module here, since deps may not be installed | ||
for package in find_packages(): | ||
if '_gym_' in package: | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), package)) | ||
from package_info import USERNAME, VERSION | ||
|
||
setup(name='{}-{}'.format(USERNAME, 'gym-super-mario'), | ||
version=VERSION, | ||
setup(name='super-mario', | ||
version='1.0.0', | ||
description='Gym User Env - 32 levels of Super Mario Bros', | ||
url='https://github.com/ppaquette/gym_super_mario', | ||
url='https://github.com/sicara/gym_super_mario', | ||
author='Philip Paquette', | ||
author_email='[email protected]', | ||
license='MIT License', | ||
packages=[package for package in find_packages() if package.startswith(USERNAME)], | ||
package_data={ '{}_{}'.format(USERNAME, 'gym_super_mario'): ['lua/*.lua', 'roms/*.nes' ] }, | ||
packages=['super_mario'], | ||
package_data={ 'super_mario': ['lua/*.lua', 'roms/*.nes' ] }, | ||
zip_safe=False, | ||
install_requires=[ 'gym>=0.9.7' ], | ||
install_requires=['gym>=0.9.7'], | ||
) |
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.
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,38 @@ | ||
import time | ||
from functools import wraps | ||
|
||
_total_time_call_stack = [0] | ||
|
||
def _log(message): | ||
print('[BetterTimeTracker] {function_name} {total_time:.3f} {partial_time:.3f}'.format(**message)) | ||
|
||
|
||
def better_time_tracker(log_fun=_log): | ||
def _better_time_tracker(fn): | ||
@wraps(fn) | ||
def wrapped_fn(*args, **kwargs): | ||
global _total_time_call_stack | ||
_total_time_call_stack.append(0) | ||
|
||
start_time = time.time() | ||
|
||
try: | ||
result = fn(*args, **kwargs) | ||
finally: | ||
elapsed_time = time.time() - start_time | ||
inner_total_time = _total_time_call_stack.pop() | ||
partial_time = elapsed_time - inner_total_time | ||
|
||
_total_time_call_stack[-1] += elapsed_time | ||
|
||
# log the result | ||
log_fun({ | ||
'function_name': fn.__name__, | ||
'total_time': elapsed_time, | ||
'partial_time': partial_time, | ||
}) | ||
|
||
return result | ||
|
||
return wrapped_fn | ||
return _better_time_tracker |
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,3 @@ | ||
[flake8] | ||
ignore = D100 | ||
max-line-length = 160 |