Skip to content

Commit 2befe58

Browse files
authored
Merge pull request #2157 from Unity-Technologies/release-v0.8.2
Release v0.8.2
2 parents 37d139a + 863af27 commit 2befe58

File tree

173 files changed

+14208
-10341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+14208
-10341
lines changed

.circleci/config.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.1
1+
version: 2.0
22

33
jobs:
44
build:
@@ -20,16 +20,18 @@ jobs:
2020
command: |
2121
python3 -m venv venv
2222
. venv/bin/activate
23+
pip install --upgrade pip
24+
pip install --upgrade setuptools
2325
cd ml-agents-envs && pip install -e .
2426
cd ../ml-agents && pip install -e .
25-
pip install pytest-cov==2.6.1 codacy-coverage==1.3.11
27+
pip install black pytest-cov==2.6.1 codacy-coverage==1.3.11
2628
cd ../gym-unity && pip install -e .
2729
2830
- save_cache:
2931
paths:
3032
- ./venv
3133
key: v1-dependencies-{{ checksum "ml-agents/setup.py" }}
32-
34+
3335
- run:
3436
name: Run Tests for ml-agents and gym_unity
3537
command: |
@@ -38,6 +40,21 @@ jobs:
3840
pytest --cov=mlagents --cov-report xml --junitxml=test-reports/junit.xml -p no:warnings
3941
python-codacy-coverage -r coverage.xml
4042
43+
- run:
44+
name: Check Code Style for ml-agents and gym_unity using black
45+
command: |
46+
. venv/bin/activate
47+
black --check ml-agents
48+
black --check ml-agents-envs
49+
black --check gym-unity
50+
51+
- run:
52+
name: Verify there are no hidden/missing metafiles.
53+
# Renaming files or deleting files can leave metafiles behind that makes Unity very unhappy.
54+
command: |
55+
. venv/bin/activate
56+
python utils/validate_meta_files.py
57+
4158
- store_test_results:
4259
path: test-reports
4360

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/UnitySDK/[Uu]nity[Pp]ackage[Mm]anager/
88
/UnitySDK/Assets/AssetStoreTools*
99
/UnitySDK/Assets/Plugins*
10-
/UnitySDK/Assets/Gizmos*
1110
/UnitySDK/Assets/Demonstrations*
1211

1312
# Tensorflow Model Info
@@ -72,6 +71,7 @@
7271
*.pyc
7372
*.idea/misc.xml
7473
*.idea/modules.xml
74+
*.idea/
7575
*.iml
7676
*.cache
7777
*/build/
@@ -97,3 +97,6 @@ ml-agents-protobuf/Grpc*
9797
# Ignore PyPi build files.
9898
dist/
9999
build/
100+
101+
# Python virtual environment
102+
venv/

CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions

UnitySDK/Assets/Gizmos.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#if UNITY_CLOUD_BUILD
2+
3+
namespace MLAgents
4+
{
5+
public static class Builder
6+
{
7+
public static void PreExport()
8+
{
9+
BuilderUtils.SwitchAllLearningBrainToControlMode();
10+
}
11+
}
12+
}
13+
14+
#endif

UnitySDK/Assets/ML-Agents/Editor/Builder.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#if UNITY_CLOUD_BUILD
2+
3+
using System.Linq;
4+
using UnityEditor;
5+
using UnityEditor.SceneManagement;
6+
using UnityEngine;
7+
using System.IO;
8+
9+
namespace MLAgents
10+
{
11+
public static class BuilderUtils
12+
{
13+
public static void SwitchAllLearningBrainToControlMode()
14+
{
15+
Debug.Log("The Switching to control mode function is triggered");
16+
string[] scenePaths = Directory.GetFiles("Assets/ML-Agents/Examples/", "*.unity", SearchOption.AllDirectories);
17+
foreach (string scenePath in scenePaths)
18+
{
19+
var curScene = EditorSceneManager.OpenScene(scenePath);
20+
var aca = SceneAsset.FindObjectOfType<Academy>();
21+
if (aca != null)
22+
{
23+
var learningBrains = aca.broadcastHub.broadcastingBrains.Where(
24+
x => x != null && x is LearningBrain);
25+
foreach (Brain brain in learningBrains)
26+
{
27+
if (!aca.broadcastHub.IsControlled(brain))
28+
{
29+
Debug.Log("Switched brain in scene " + scenePath);
30+
aca.broadcastHub.SetControlled(brain, true);
31+
}
32+
}
33+
EditorSceneManager.SaveScene(curScene);
34+
}
35+
else
36+
{
37+
Debug.Log("scene " + scenePath + " doesn't have a Academy in it");
38+
}
39+
}
40+
}
41+
}
42+
}
43+
44+
#endif

UnitySDK/Assets/ML-Agents/Editor/BuilderUtils.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitySDK/Assets/ML-Agents/Editor/HeuristicBrainEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static void CheckIsDecision(HeuristicBrain brain)
4747
{
4848
Debug.LogError(
4949
"Instance of " + brain.decisionScript.name + " couldn't be created. " +
50-
"The the script class needs to derive from Decision.");
50+
"The script class needs to derive from Decision.");
5151
brain.decisionScript = null;
5252
}
5353
}

UnitySDK/Assets/ML-Agents/Editor/NNModelImporter.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)