Skip to content

Commit

Permalink
Release 1 mm formatting (Unity-Technologies#3904)
Browse files Browse the repository at this point in the history
* Formatting lines.

* Fix changelogs
  • Loading branch information
Marwan Mattar authored Apr 30, 2020
1 parent ab0962e commit b31ba96
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 259 deletions.
6 changes: 4 additions & 2 deletions SURVEY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unity ML-Agents Toolkit Survey

Your opinion matters a great deal to us. Only by hearing your thoughts on the Unity ML-Agents Toolkit can we continue to improve and grow. Please take a few minutes to let us know about it.
Your opinion matters a great deal to us. Only by hearing your thoughts on the
Unity ML-Agents Toolkit can we continue to improve and grow. Please take a few
minutes to let us know about it.

[Fill out the survey](https://goo.gl/forms/qFMYSYr5TlINvG6f1)
[Fill out the survey](https://goo.gl/forms/qFMYSYr5TlINvG6f1)
75 changes: 48 additions & 27 deletions com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ and this project adheres to
## [1.0.0-preview] - 2020-05-06

### Major Changes

#### com.unity.ml-agents (C#)

- The `MLAgents` C# namespace was renamed to `Unity.MLAgents`, and other nested
namespaces were similarly renamed. (#3843)
- The offset logic was removed from DecisionRequester. (#3716)
Expand All @@ -23,26 +25,32 @@ and this project adheres to
`AgentAction` and `AgentReset` have been removed. (#3770)
- The SideChannel API has changed (#3833, #3660) :
- Introduced the `SideChannelManager` to register, unregister and access side
channels.
channels.
- `Academy.FloatProperties` was replaced by `Academy.EnvironmentParameters`.
See the [Migration Guide](../docs/Migrating.md) for more details on upgrading.
See the [Migration Guide](../docs/Migrating.md) for more details on
upgrading.
- `SideChannel.OnMessageReceived` is now a protected method (was public)
- SideChannel IncomingMessages methods now take an optional default argument,
which is used when trying to read more data than the message contains.
which is used when trying to read more data than the message contains.
- Added a feature to allow sending stats from C# environments to TensorBoard
(and other python StatsWriters). To do this from your code, use
`Academy.Instance.StatsRecorder.Add(key, value)`. (#3660)
- `CameraSensorComponent.m_Grayscale` and `RenderTextureSensorComponent.m_Grayscale`
were changed from `public` to `private`. These can still be accessed via their
corresponding properties. (#3808)
(and other python StatsWriters). To do this from your code, use
`Academy.Instance.StatsRecorder.Add(key, value)`. (#3660)
- `CameraSensorComponent.m_Grayscale` and
`RenderTextureSensorComponent.m_Grayscale` were changed from `public` to
`private`. These can still be accessed via their corresponding properties.
(#3808)
- Public fields and properties on several classes were renamed to follow Unity's
C# style conventions. All public fields and properties now use "PascalCase"
instead of "camelCase"; for example, `Agent.maxStep` was renamed to
`Agent.MaxStep`. For a full list of changes, see the pull request. (#3828)
- `WriteAdapter` was renamed to `ObservationWriter`. If you have a custom `ISensor` implementation,
you will need to change the signature of its `Write()` method. (#3834)
- Updated to Barracuda 0.7.0-preivew which has breaking namespace and assembly name changes. (#3875)
- `WriteAdapter` was renamed to `ObservationWriter`. If you have a custom
`ISensor` implementation, you will need to change the signature of its
`Write()` method. (#3834)
- Updated to Barracuda 0.7.0-preivew which has breaking namespace and assembly
name changes. (#3875)

#### ml-agents / ml-agents-envs / gym-unity (Python)

- The `--load` and `--train` command-line flags have been deprecated. Training
now happens by default, and use `--resume` to resume training instead. (#3705)
- The Jupyter notebooks have been removed from the repository. (#3704)
Expand All @@ -57,26 +65,32 @@ and this project adheres to
- The GhostTrainer has been extended to support asymmetric games and the
asymmetric example environment Strikers Vs. Goalie has been added. (#3653)
- The `UnityEnv` class from the `gym-unity` package was renamed
`UnityToGymWrapper` and no longer creates the `UnityEnvironment`.
Instead, the `UnityEnvironment` must be passed as input to the
constructor of `UnityToGymWrapper` (#3812)
`UnityToGymWrapper` and no longer creates the `UnityEnvironment`. Instead, the
`UnityEnvironment` must be passed as input to the constructor of
`UnityToGymWrapper` (#3812)

### Minor Changes

#### com.unity.ml-agents (C#)

- Added new 3-joint Worm ragdoll environment. (#3798)
- `StackingSensor` was changed from `internal` visibility to `public`. (#3701)
- The internal event `Academy.AgentSetStatus` was renamed to
`Academy.AgentPreStep` and made public. (#3716)
- Academy.InferenceSeed property was added. This is used to initialize the
random number generator in ModelRunner, and is incremented for each ModelRunner. (#3823)
- Added `Agent.GetObservations(), which returns a read-only view of the observations
added in `CollectObservations()`. (#3825)
- `UnityRLCapabilities` was added to help inform users when RL features are mismatched between C# and Python packages. (#3831)
random number generator in ModelRunner, and is incremented for each
ModelRunner. (#3823)
- Added `Agent.GetObservations()`, which returns a read-only view of the
observations added in `CollectObservations()`. (#3825)
- `UnityRLCapabilities` was added to help inform users when RL features are
mismatched between C# and Python packages. (#3831)

#### ml-agents / ml-agents-envs / gym-unity (Python)

- Format of console output has changed slightly and now matches the name of the
model/summary directory. (#3630, #3616)
- Renamed 'Generalization' feature to 'Environment Parameter Randomization'. (#3646)
- Renamed 'Generalization' feature to 'Environment Parameter Randomization'.
(#3646)
- Timer files now contain a dictionary of metadata, including things like the
package version numbers. (#3758)
- The way that UnityEnvironment decides the port was changed. If no port is
Expand All @@ -85,23 +99,30 @@ and this project adheres to
environment port) will be used. (#3673)
- Running `mlagents-learn` with the same `--run-id` twice will no longer
overwrite the existing files. (#3705)
- Model updates can now happen asynchronously with environment steps for better performance. (#3690)
- `num_updates` and `train_interval` for SAC were replaced with `steps_per_update`. (#3690)
- The maximum compatible version of tensorflow was changed to allow tensorflow 2.1 and 2.2. This
will allow use with python 3.8 using tensorflow 2.2.0rc3. (#3830)
- `mlagents-learn` will no longer set the width and height of the executable window to 84x84
when no width nor height arguments are given. (#3867)
- Model updates can now happen asynchronously with environment steps for better
performance. (#3690)
- `num_updates` and `train_interval` for SAC were replaced with
`steps_per_update`. (#3690)
- The maximum compatible version of tensorflow was changed to allow tensorflow
2.1 and 2.2. This will allow use with python 3.8 using tensorflow 2.2.0rc3.
(#3830)
- `mlagents-learn` will no longer set the width and height of the executable
window to 84x84 when no width nor height arguments are given. (#3867)

### Bug Fixes

#### com.unity.ml-agents (C#)

- Fixed a display bug when viewing Demonstration files in the inspector. The
shapes of the observations in the file now display correctly. (#3771)

#### ml-agents / ml-agents-envs / gym-unity (Python)

- Fixed an issue where exceptions from environments provided a returncode of 0.
(#3680)
- Self-Play team changes will now trigger a full environment reset. This prevents trajectories
in progress during a team change from getting into the buffer. (#3870)
- Self-Play team changes will now trigger a full environment reset. This
prevents trajectories in progress during a team change from getting into the
buffer. (#3870)

## [0.15.1-preview] - 2020-03-30

Expand Down
76 changes: 49 additions & 27 deletions com.unity.ml-agents/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,80 @@ of guidelines to ensure that your extensions can be easily integrated.

## Communication

First, please read through our [code of conduct](https://github.com/Unity-Technologies/ml-agents/blob/master/CODE_OF_CONDUCT.md), as we
expect all our contributors to follow it.
First, please read through our
[code of conduct](https://github.com/Unity-Technologies/ml-agents/blob/master/CODE_OF_CONDUCT.md),
as we expect all our contributors to follow it.

Second, before starting on a project that you intend to contribute to the
ML-Agents Toolkit (whether environments or modifications to the codebase), we
**strongly** recommend posting on our
[Issues page](https://github.com/Unity-Technologies/ml-agents/issues)
and briefly outlining the changes you plan to make. This will enable us to
provide some context that may be helpful for you. This could range from advice
and feedback on how to optimally perform your changes or reasons for not doing
it.
[Issues page](https://github.com/Unity-Technologies/ml-agents/issues) and
briefly outlining the changes you plan to make. This will enable us to provide
some context that may be helpful for you. This could range from advice and
feedback on how to optimally perform your changes or reasons for not doing it.

Lastly, if you're looking for input on what to contribute, feel free to
reach out to us directly at [email protected] and/or browse the GitHub
issues with the `contributions welcome` label.
Lastly, if you're looking for input on what to contribute, feel free to reach
out to us directly at [email protected] and/or browse the GitHub issues with
the `contributions welcome` label.

## Git Branches
The master branch corresponds to the most recent version of the project.
Note that this may be newer that the [latest release](https://github.com/Unity-Technologies/ml-agents/releases/tag/latest_release).

When contributing to the project, please make sure that your Pull Request (PR) contains the following:
The master branch corresponds to the most recent version of the project. Note
that this may be newer that the
[latest release](https://github.com/Unity-Technologies/ml-agents/releases/tag/latest_release).

* Detailed description of the changes performed
* Corresponding changes to documentation, unit tests and sample environments (if
When contributing to the project, please make sure that your Pull Request (PR)
contains the following:

- Detailed description of the changes performed
- Corresponding changes to documentation, unit tests and sample environments (if
applicable)
* Summary of the tests performed to validate your changes
* Issue numbers that the PR resolves (if any)
- Summary of the tests performed to validate your changes
- Issue numbers that the PR resolves (if any)

## Environments

We are also actively open to adding community contributed environments as
examples, as long as they are small, simple, demonstrate a unique feature of
the platform, and provide a unique non-trivial challenge to modern
machine learning algorithms. Feel free to submit these environments with a
PR explaining the nature of the environment and task.
examples, as long as they are small, simple, demonstrate a unique feature of the
platform, and provide a unique non-trivial challenge to modern machine learning
algorithms. Feel free to submit these environments with a PR explaining the
nature of the environment and task.

## Continuous Integration (CI)

We run CircleCI on all PRs; all tests must be passing before the PR is merged.

Several static checks are run on the codebase using the [pre-commit framework](https://pre-commit.com/) during CI. To execute the same checks locally, install `pre-commit` and run `pre-commit run --all-files`. Some hooks (for example, `black`) will output the corrected version of the code; others (like `mypy`) may require more effort to fix.
Several static checks are run on the codebase using the
[pre-commit framework](https://pre-commit.com/) during CI. To execute the same
checks locally, install `pre-commit` and run `pre-commit run --all-files`. Some
hooks (for example, `black`) will output the corrected version of the code;
others (like `mypy`) may require more effort to fix.

### Code style
All python code should be formatted with [`black`](https://github.com/ambv/black). Style and formatting for C# may be enforced later.

All python code should be formatted with
[`black`](https://github.com/ambv/black). Style and formatting for C# may be
enforced later.

### Python type annotations
We use [`mypy`](http://mypy-lang.org/) to perform static type checking on python code. Currently not all code is annotated but we will increase coverage over time. If you are adding or refactoring code, please

We use [`mypy`](http://mypy-lang.org/) to perform static type checking on python
code. Currently not all code is annotated but we will increase coverage over
time. If you are adding or refactoring code, please

1. Add type annotations to the new or refactored code.
2. Make sure that code calling or called by the modified code also has type annotations.
2. Make sure that code calling or called by the modified code also has type
annotations.

The [type hint cheat sheet](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html) provides a good introduction to adding type hints.
The
[type hint cheat sheet](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html)
provides a good introduction to adding type hints.

## Contributor License Agreements

When you open a pull request, you will be asked to acknolwedge our Contributor License Agreement. We allow both individual contributions and contributions made on behalf of companies. We use an open source tool called CLA assistant. If you have any questions on our CLA, please [submit an issue](https://github.com/Unity-Technologies/ml-agents/issues) or email us at [email protected].
When you open a pull request, you will be asked to acknolwedge our Contributor
License Agreement. We allow both individual contributions and contributions made
on behalf of companies. We use an open source tool called CLA assistant. If you
have any questions on our CLA, please
[submit an issue](https://github.com/Unity-Technologies/ml-agents/issues) or
email us at [email protected].
4 changes: 2 additions & 2 deletions docs/API-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Our developer-facing C# classes have been documented to be compatible with
Doxygen for auto-generating HTML documentation.

To generate the API reference, download Doxygen
and run the following command within the `docs/` directory:
To generate the API reference, download Doxygen and run the following command
within the `docs/` directory:

```sh
doxygen dox-ml-agents.conf
Expand Down
12 changes: 6 additions & 6 deletions docs/Migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ double-check that the versions are in the same. The versions can be found in
source of error where users would return arrays of the wrong size.
- The SideChannel API has changed (#3833, #3660) :
- Introduced the `SideChannelManager` to register, unregister and access side
channels.
- `EnvironmentParameters` replaces the default `FloatProperties`.
You can access the `EnvironmentParameters` with
`Academy.Instance.EnvironmentParameters` on C#. If you were previously creating
a `UnityEnvironment` in python and passing it a `FloatPropertiesChannel`,
create an `EnvironmentParametersChannel` instead.
channels.
- `EnvironmentParameters` replaces the default `FloatProperties`. You can
access the `EnvironmentParameters` with
`Academy.Instance.EnvironmentParameters` on C#. If you were previously
creating a `UnityEnvironment` in python and passing it a
`FloatPropertiesChannel`, create an `EnvironmentParametersChannel` instead.
- `SideChannel.OnMessageReceived` is now a protected method (was public)
- SideChannel IncomingMessages methods now take an optional default argument,
which is used when trying to read more data than the message contains.
Expand Down
Loading

0 comments on commit b31ba96

Please sign in to comment.