Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:minenetproject/minerl

  • Loading branch information...
MadcowD committed May 4, 2019
2 parents 1267be9 + 779c174 commit bcdd16c1f79d6215913003641f3348e126ff4a3a
1 .env
@@ -0,0 +1 @@
PYTHONPATH=.:$PYTHONPATH
@@ -1,5 +1,27 @@
.idea
minerl/env/Malmo
*/__pycache__/*
minerl.egg-info/*
minerl.egg-info/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

.idea/
Malmo/

This file was deleted.

This file was deleted.

@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python3"
}

This file was deleted.

This file was deleted.

Binary file not shown.
@@ -1,6 +1,7 @@
import os
import requests
import tqdm
import tarfile


def download(directory: os.path, resolution: str = 'low', texture_pack: int = 1, update_enviroment_variables=True) -> None:
@@ -22,14 +23,22 @@ def download(directory: os.path, resolution: str = 'low', texture_pack: int = 1,
else:
raise ValueError("Provided directory is None and $MINERL_DATA_ROOT is not defined")
elif update_enviroment_variables:
os.environ['MINERL_DATA_ROOT'] = directory
os.environ['MINERL_DATA_ROOT'] = os.path.normpath(directory)

# TODO pull JSON defining dataset URLS from webserver instead of hard-coding
url = "https://router.sneakywines.me/minerl/data_texture_{}_{}_res.tar.gz".format(texture_pack, resolution)
filename = "data_texture_{}_{}_res.tar.gz".format(texture_pack, resolution)
url = "https://router.sneakywines.me/minerl/" + filename

response = requests.get(url, stream=True)

with open(directory, "wb") as handle:
for data in tqdm(response.iter_content()):
if not os.path.exists(directory):
os.makedirs(directory)

with open(os.path.join(directory, filename), "wb") as handle:
for data in tqdm.tqdm(response.iter_content(chunk_size=1048576)):
handle.write(data)

tf = tarfile.open(os.path.join(directory, filename))
tf.extractall()

pass
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,9 @@
gym==0.12.1
opencv_python==4.1.0.25
setuptools==40.6.2
tqdm==4.31.1
numpy==1.16.2
requests==2.20.0
ipython==7.5.0
typing==3.6.6
gym>=0.12.1
opencv_python>=4.1.0.25
setuptools>=40.6.2
tqdm>=4.31.1
numpy>=1.16.2
requests>=2.20.0
ipython>=7.5.0
typing>=3.6.6
lxml
@@ -4,6 +4,7 @@
markdown = fh.read()
with open("requirements.txt", "r") as fh:
requirements = fh.read()

setuptools.setup(
name='minerl',
version='0.0.2',
@@ -10,13 +10,11 @@
import minerl
from minerl.env.bootstrap import MinecraftInstance
from minerl.env.core import MineRLEnv
import matplotlib.pyplot as plt

NUM_EPISODES=30
NUM_EPISODES=10

"""
1. Server observations are delayed and take a tick!
4. move watcher to java side :()
6. port binding failure.
"""

def main():
@@ -43,7 +41,9 @@ def main():


y = np.array(xposes)
from IPython import embed; embed()
plt.plot(y[:,:,0].T, y[:,:,2].T)
plt.show()
input()
print("Demo complete.")


0 comments on commit bcdd16c

Please sign in to comment.
You can’t perform that action at this time.