Skip to content

Commit

Permalink
Merge pull request #2157 from Unity-Technologies/release-v0.8.2
Browse files Browse the repository at this point in the history
Release v0.8.2
  • Loading branch information
xiaomaogy committed Jun 24, 2019
2 parents 37d139a + 863af27 commit 2befe58
Show file tree
Hide file tree
Showing 173 changed files with 14,208 additions and 10,341 deletions.
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.1
version: 2.0

jobs:
build:
Expand All @@ -20,16 +20,18 @@ jobs:
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
cd ml-agents-envs && pip install -e .
cd ../ml-agents && pip install -e .
pip install pytest-cov==2.6.1 codacy-coverage==1.3.11
pip install black pytest-cov==2.6.1 codacy-coverage==1.3.11
cd ../gym-unity && pip install -e .
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "ml-agents/setup.py" }}

- run:
name: Run Tests for ml-agents and gym_unity
command: |
Expand All @@ -38,6 +40,21 @@ jobs:
pytest --cov=mlagents --cov-report xml --junitxml=test-reports/junit.xml -p no:warnings
python-codacy-coverage -r coverage.xml
- run:
name: Check Code Style for ml-agents and gym_unity using black
command: |
. venv/bin/activate
black --check ml-agents
black --check ml-agents-envs
black --check gym-unity
- run:
name: Verify there are no hidden/missing metafiles.
# Renaming files or deleting files can leave metafiles behind that makes Unity very unhappy.
command: |
. venv/bin/activate
python utils/validate_meta_files.py
- store_test_results:
path: test-reports

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
/UnitySDK/[Uu]nity[Pp]ackage[Mm]anager/
/UnitySDK/Assets/AssetStoreTools*
/UnitySDK/Assets/Plugins*
/UnitySDK/Assets/Gizmos*
/UnitySDK/Assets/Demonstrations*

# Tensorflow Model Info
Expand Down Expand Up @@ -72,6 +71,7 @@
*.pyc
*.idea/misc.xml
*.idea/modules.xml
*.idea/
*.iml
*.cache
*/build/
Expand All @@ -97,3 +97,6 @@ ml-agents-protobuf/Grpc*
# Ignore PyPi build files.
dist/
build/

# Python virtual environment
venv/
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,4 @@ PR explaining the nature of the environment and task.

## Style Guide

When performing changes to the codebase, ensure that you follow the style guide
of the file you're modifying. For Python, we follow
[PEP 8](https://www.python.org/dev/peps/pep-0008/).
For C#, we will soon be adding a formal style guide for our repository.
When performing changes to the codebase, please ensure that all python code is reformatted using the [black](https://github.com/ambv/black) formatter. For C#, we will soon be requirements for style and formatting.
8 changes: 8 additions & 0 deletions UnitySDK/Assets/Gizmos.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions UnitySDK/Assets/ML-Agents/Editor/Builder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#if UNITY_CLOUD_BUILD

namespace MLAgents
{
public static class Builder
{
public static void PreExport()
{
BuilderUtils.SwitchAllLearningBrainToControlMode();
}
}
}

#endif
3 changes: 3 additions & 0 deletions UnitySDK/Assets/ML-Agents/Editor/Builder.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions UnitySDK/Assets/ML-Agents/Editor/BuilderUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#if UNITY_CLOUD_BUILD

using System.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using System.IO;

namespace MLAgents
{
public static class BuilderUtils
{
public static void SwitchAllLearningBrainToControlMode()
{
Debug.Log("The Switching to control mode function is triggered");
string[] scenePaths = Directory.GetFiles("Assets/ML-Agents/Examples/", "*.unity", SearchOption.AllDirectories);
foreach (string scenePath in scenePaths)
{
var curScene = EditorSceneManager.OpenScene(scenePath);
var aca = SceneAsset.FindObjectOfType<Academy>();
if (aca != null)
{
var learningBrains = aca.broadcastHub.broadcastingBrains.Where(
x => x != null && x is LearningBrain);
foreach (Brain brain in learningBrains)
{
if (!aca.broadcastHub.IsControlled(brain))
{
Debug.Log("Switched brain in scene " + scenePath);
aca.broadcastHub.SetControlled(brain, true);
}
}
EditorSceneManager.SaveScene(curScene);
}
else
{
Debug.Log("scene " + scenePath + " doesn't have a Academy in it");
}
}
}
}
}

#endif
3 changes: 3 additions & 0 deletions UnitySDK/Assets/ML-Agents/Editor/BuilderUtils.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static void CheckIsDecision(HeuristicBrain brain)
{
Debug.LogError(
"Instance of " + brain.decisionScript.name + " couldn't be created. " +
"The the script class needs to derive from Decision.");
"The script class needs to derive from Decision.");
brain.decisionScript = null;
}
}
Expand Down
29 changes: 0 additions & 29 deletions UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs

This file was deleted.

4 changes: 2 additions & 2 deletions UnitySDK/Assets/ML-Agents/Editor/Tests/DemonstrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public class DemonstrationTests : MonoBehaviour
[Test]
public void TestSanitization()
{
const string dirtyString = "abc123&!@";
const string dirtyString = "abc1234567&!@";
const string knownCleanString = "abc123";
var cleanString = DemonstrationRecorder.SanitizeName(dirtyString);
var cleanString = DemonstrationRecorder.SanitizeName(dirtyString, 6);
Assert.AreNotEqual(dirtyString, cleanString);
Assert.AreEqual(cleanString, knownCleanString);
}
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
Expand All @@ -74,3 +78,4 @@ Material:
m_Colors:
- _Color: {r: 0.10980392, g: 0.6039216, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
Expand All @@ -74,3 +78,4 @@ Material:
m_Colors:
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions UnitySDK/Assets/ML-Agents/Examples/Startup.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2befe58

Please sign in to comment.