Skip to content

Commit 164d1ab

Browse files
author
Chris Elion
authored
Merge pull request #3010 from Unity-Technologies/release-0.12.0-to-master
Merge Release 0.12.0 to master
2 parents 8a08bc4 + 6a28088 commit 164d1ab

File tree

344 files changed

+5552
-15006
lines changed

Some content is hidden

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

344 files changed

+5552
-15006
lines changed

.circleci/config.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ jobs:
8686

8787

8888
markdown_link_check:
89+
parameters:
90+
precommit_command:
91+
type: string
92+
description: precommit hook to run
93+
default: markdown-link-check
8994
docker:
9095
- image: circleci/node:12.6.0
9196
working_directory: ~/repo
@@ -117,7 +122,7 @@ jobs:
117122
name: Run markdown-link-check via precommit
118123
command: |
119124
. venv/bin/activate
120-
pre-commit run --hook-stage manual markdown-link-check --all-files
125+
pre-commit run --hook-stage manual << parameters.precommit_command >> --all-files
121126
122127
protobuf_generation_check:
123128
docker:
@@ -223,7 +228,13 @@ workflows:
223228
executor: python373
224229
pyversion: 3.7.3
225230
# Test python 3.7 with the newest supported versions
226-
pip_constraints: test_constraints_max_version.txt
231+
pip_constraints: test_constraints_max_tf1_version.txt
232+
- build_python:
233+
name: python_3.7.3+tf2
234+
executor: python373
235+
pyversion: 3.7.3
236+
# Test python 3.7 with the newest supported versions
237+
pip_constraints: test_constraints_max_tf2_version.txt
227238
- markdown_link_check
228239
- protobuf_generation_check
229240
- deploy:
@@ -250,3 +261,15 @@ workflows:
250261
only: /[0-9]+(\.[0-9]+)*(\.dev[0-9]+)*/
251262
branches:
252263
ignore: /.*/
264+
nightly:
265+
triggers:
266+
- schedule:
267+
cron: "0 0 * * *"
268+
filters:
269+
branches:
270+
only:
271+
- develop
272+
jobs:
273+
- markdown_link_check:
274+
name: markdown-link-check full
275+
precommit_command: markdown-link-check-full

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/UnitySDK/[Bb]uild/
55
/UnitySDK/[Bb]uilds/
66
/UnitySDK/[Pp]ackages/
7-
/UnitySDK/[Uu]nity[Pp]ackage[Mm]anager/
87
/UnitySDK/Assets/AssetStoreTools*
98
/UnitySDK/Assets/Plugins*
109
/UnitySDK/Assets/Demonstrations*

.pre-commit-config.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
)$
1111
1212
- repo: https://github.com/pre-commit/mirrors-mypy
13-
rev: v0.720
13+
rev: v0.740
1414
hooks:
1515
- id: mypy
1616
name: mypy-ml-agents
@@ -28,7 +28,7 @@ repos:
2828
args: [--ignore-missing-imports, --disallow-incomplete-defs]
2929

3030
- repo: https://github.com/pre-commit/pre-commit-hooks
31-
rev: v2.2.3
31+
rev: v2.4.0
3232
hooks:
3333
- id: mixed-line-ending
3434
exclude: >
@@ -44,17 +44,33 @@ repos:
4444
.*_pb2.py|
4545
.*_pb2_grpc.py
4646
)$
47-
# temporarily pin flake8-comprehensions
48-
additional_dependencies: [flake8-comprehensions==3.0.1]
47+
# flake8-tidy-imports is used for banned-modules, not actually tidying
48+
additional_dependencies: [flake8-comprehensions, flake8-tidy-imports]
4949
- id: trailing-whitespace
5050
name: trailing-whitespace-markdown
5151
types: [markdown]
52+
- id: check-merge-conflict
53+
args: [--assume-in-merge]
5254

5355
- repo: https://github.com/pre-commit/pygrep-hooks
54-
rev: v1.4.1 # Use the ref you want to point at
56+
rev: v1.4.2
5557
hooks:
5658
- id: python-check-mock-methods
5759

60+
61+
62+
- repo: https://github.com/pre-commit/mirrors-pylint
63+
rev: v2.4.4
64+
hooks:
65+
- id: pylint
66+
exclude: >
67+
(?x)^(
68+
.*_pb2.py|
69+
.*_pb2_grpc.py|
70+
.*/tests/.*
71+
)$
72+
args: [--score=n]
73+
5874
# "Local" hooks, see https://pre-commit.com/#repository-local-hooks
5975
- repo: local
6076
hooks:
@@ -63,15 +79,22 @@ repos:
6379
# markdown-link-check doesn't support multiple files on the commandline, so this hacks around that.
6480
# Note that you must install the package separately via npm. For example:
6581
# brew install npm; npm install -g markdown-link-check
66-
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.config.json' --
82+
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.fast.json' --
6783
language: system
6884
types: [markdown]
6985
# Don't check localized files since their target might not be localized.
7086
exclude: ".*localized.*"
7187
# Only run manually, e.g. pre-commit run --hook-stage manual markdown-link-check
7288
stages: [manual]
89+
- id: markdown-link-check-full
90+
name: markdown-link-check-full
91+
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.full.json' --
92+
language: system
93+
types: [markdown]
94+
exclude: ".*localized.*"
95+
stages: [manual]
7396
- id: validate-versions
7497
name: validate library versions
7598
language: script
7699
entry: utils/validate_versions.py
77-
files: ".*/setup.py"
100+
files: ".*/__init__.py"

.pylintrc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[MASTER]
2+
# Add files or directories to the blacklist. They should be base names, not
3+
# paths.
4+
ignore=CVS
5+
6+
[MESSAGES CONTROL]
7+
#enable=
8+
9+
disable =
10+
# C0301: Line too long
11+
# C0330: Wrong hanging indentation before block
12+
# disabled because black handles this
13+
C0301,C0330,
14+
15+
# C0114: Missing module docstring
16+
# C0115: Missing class docstring
17+
# C0116: Missing function or method docstring
18+
C0114,C0115,C0116,
19+
20+
# All convention and refactor for now
21+
C,R,
22+
23+
# W1201: Specify string format arguments as logging function parameters
24+
# W1202: Use % formatting in logging functions and pass the % parameters as arguments
25+
W1201,W1202,
26+
27+
# W0612: Unused variable
28+
# W0613: Unused argument
29+
W0612, W0613,
30+
31+
# W0107: Unnecessary pass statement
32+
W0107,
33+
34+
# W0511 "TODO"
35+
W0511,
36+
37+
# W0703: Catching too general exception Exception
38+
W0703,
39+
40+
# E0401: Unable to import...
41+
# E0611: No name '...' in module '...'
42+
# need to look into these, probably namespace packages
43+
E0401, E0611

.yamato/csharp-tests.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@ test_mac_editmode_{{ editor.version }}:
88
name: Test Mac EditMode {{ editor.version }}
99
agent:
1010
type: Unity::VM::osx
11-
image: ml-agents/ml-agents-bokken-mac:release
11+
image: ml-agents/ml-agents-bokken-mac:v0.1.2-440635
1212
flavor: i1.small
1313
variables:
1414
UNITY_VERSION: {{ editor.version }}
1515
commands:
1616
- ./run-tests-editmode-osx-editor.sh
1717
triggers:
18-
branches:
19-
only:
20-
- "/develop-.*/"
21-
targets:
22-
only:
23-
- "develop"
2418
pull_requests:
2519
- targets:
2620
only:
21+
- "develop"
2722
- "master"
2823
- "/release-.*/"
2924
- "/hotfix-.*/"

.yamato/standalone-build-test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,18 @@ test_mac_standalone_{{ editor.version }}:
88
name: Test Mac Standalone {{ editor.version }}
99
agent:
1010
type: Unity::VM::osx
11-
image: ml-agents/ml-agents-bokken-mac:release
11+
image: ml-agents/ml-agents-bokken-mac:v0.1.2-440635
1212
flavor: i1.small
1313
variables:
1414
UNITY_VERSION: {{ editor.version }}
1515
commands:
1616
- ./run-standalone-build-osx.sh
1717
triggers:
18-
branches:
19-
only:
20-
- "/develop-.*/"
21-
targets:
22-
only:
23-
- "develop"
2418
pull_requests:
2519
- targets:
2620
only:
21+
- "develop"
2722
- "master"
2823
- "/release-.*/"
2924
- "/hotfix-.*/"
30-
{% endfor %}
25+
{% endfor %}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using UnityEngine;
22
using UnityEditor;
3-
using Barracuda;
43

54
namespace MLAgents
65
{

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using UnityEngine;
22
using UnityEditor;
33
using Barracuda;
4+
using MLAgents.Sensor;
45

56
namespace MLAgents
67
{
@@ -11,41 +12,41 @@ This code is meant to modify the behavior of the inspector on Agent Components.
1112
[CanEditMultipleObjects]
1213
public class BehaviorParametersEditor : Editor
1314
{
14-
private const float k_TimeBetweenModelReloads = 2f;
15+
const float k_TimeBetweenModelReloads = 2f;
1516
// Time since the last reload of the model
16-
private float m_TimeSinceModelReload;
17+
float m_TimeSinceModelReload;
1718
// Whether or not the model needs to be reloaded
18-
private bool m_RequireReload;
19+
bool m_RequireReload;
1920

2021
public override void OnInspectorGUI()
2122
{
22-
var serializedObject = base.serializedObject;
23-
serializedObject.Update();
23+
var so = serializedObject;
24+
so.Update();
2425

2526
// Drawing the Behavior Parameters
2627
EditorGUI.BeginChangeCheck();
2728
EditorGUI.indentLevel++;
28-
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_BehaviorName"));
29-
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_BrainParameters"), true);
30-
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Model"), true);
29+
EditorGUILayout.PropertyField(so.FindProperty("m_BehaviorName"));
30+
EditorGUILayout.PropertyField(so.FindProperty("m_BrainParameters"), true);
31+
EditorGUILayout.PropertyField(so.FindProperty("m_Model"), true);
3132
EditorGUI.indentLevel++;
32-
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_InferenceDevice"), true);
33+
EditorGUILayout.PropertyField(so.FindProperty("m_InferenceDevice"), true);
3334
EditorGUI.indentLevel--;
34-
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_UseHeuristic"));
35+
EditorGUILayout.PropertyField(so.FindProperty("m_BehaviorType"));
3536
// EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Heuristic"), true);
3637
EditorGUI.indentLevel--;
3738
if (EditorGUI.EndChangeCheck())
3839
{
3940
m_RequireReload = true;
4041
}
4142
DisplayFailedModelChecks();
42-
serializedObject.ApplyModifiedProperties();
43+
so.ApplyModifiedProperties();
4344
}
4445

4546
/// <summary>
4647
/// Must be called within OnEditorGUI()
4748
/// </summary>
48-
private void DisplayFailedModelChecks()
49+
void DisplayFailedModelChecks()
4950
{
5051
if (m_RequireReload && m_TimeSinceModelReload > k_TimeBetweenModelReloads)
5152
{
@@ -56,15 +57,17 @@ private void DisplayFailedModelChecks()
5657
D.logEnabled = false;
5758
Model barracudaModel = null;
5859
var model = (NNModel)serializedObject.FindProperty("m_Model").objectReferenceValue;
59-
var brainParameters = ((BehaviorParameters)target).brainParameters;
60+
var behaviorParameters = (BehaviorParameters)target;
61+
var sensorComponents = behaviorParameters.GetComponents<SensorComponent>();
62+
var brainParameters = behaviorParameters.brainParameters;
6063
if (model != null)
6164
{
6265
barracudaModel = ModelLoader.Load(model.Value);
6366
}
6467
if (brainParameters != null)
6568
{
6669
var failedChecks = InferenceBrain.BarracudaModelParamLoader.CheckModel(
67-
barracudaModel, brainParameters);
70+
barracudaModel, brainParameters, sensorComponents);
6871
foreach (var check in failedChecks)
6972
{
7073
if (check != null)

0 commit comments

Comments
 (0)