浏览代码

Add verified package info to table (#4889)

/MLA-1734-demo-provider
GitHub 4 年前
当前提交
b6ce74a9
共有 2 个文件被更改,包括 114 次插入58 次删除
  1. 26
      README.md
  2. 146
      utils/make_readme_table.py

26
README.md


- The **Documentation** links in the table below include installation and usage
instructions specific to each release. Remember to always use the
documentation that corresponds to the release version you're using.
| **Version** | **Release Date** | **Source** | **Documentation** | **Download** |
|:-------:|:------:|:-------------:|:-------:|:------------:|
| **master (unstable)** | -- | [source](https://github.com/Unity-Technologies/ml-agents/tree/master) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/master/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/master.zip) |
| **Release 12** | **December 22, 2020** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_12)** | **[docs](https://github.com/Unity-Technologies/ml-agents/tree/release_12_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_12.zip)** |
| **Release 11** | December 21, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_11) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_11_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_11.zip) |
| **Release 10** | November 18, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_10) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_10_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_10.zip) |
| **Release 9** | November 4, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_9) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_9_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_9.zip) |
| **Release 8** | October 14, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_8) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_8_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_8.zip) |
| **Release 7** | September 16, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_7) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_7_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_7.zip) |
| **Release 6** | August 12, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_6) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_6_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_6.zip) |
| **Release 5** | July 31, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_5) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_5_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_5.zip) |
- The `com.unity.ml-agents` package is [verified](https://docs.unity3d.com/2020.1/Documentation/Manual/pack-safe.html)
for Unity 2020.1 and later. Verified packages releases are numbered 1.0.x.
## Citation
| **Version** | **Release Date** | **Source** | **Documentation** | **Download** | **Python Package** | **Unity Package** |
|:-------:|:------:|:-------------:|:-------:|:------------:|:------------:|:------------:|
| **master (unstable)** | -- | [source](https://github.com/Unity-Technologies/ml-agents/tree/master) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/master/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/master.zip) | -- | -- |
| **Release 12** | **December 22, 2020** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_12)** | **[docs](https://github.com/Unity-Technologies/ml-agents/tree/release_12_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_12.zip)** | **[0.23.0](https://pypi.org/project/mlagents/0.23.0/)** | **[1.7.2](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.7/manual/index.html)** |
| **Release 11** | December 21, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_11) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_11_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_11.zip) | [0.23.0](https://pypi.org/project/mlagents/0.23.0/) | [1.7.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.7/manual/index.html) |
| **Release 10** | November 18, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_10) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_10_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_10.zip) | [0.22.0](https://pypi.org/project/mlagents/0.22.0/) | [1.6.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.6/manual/index.html) |
| **Verified Package 1.0.6** | **November 16, 2020** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/com.unity.ml-agents_1.0.6)** | **[docs](https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/.zip)** | **[0.16.1](https://pypi.org/project/mlagents/0.16.1/)** | **[1.0.6](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/manual/index.html)** |
| **Release 9** | November 4, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_9) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_9_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_9.zip) | [0.21.1](https://pypi.org/project/mlagents/0.21.1/) | [1.5.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.5/manual/index.html) |
| **Release 8** | October 14, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_8) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_8_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_8.zip) | [0.21.0](https://pypi.org/project/mlagents/0.21.0/) | [1.5.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.5/manual/index.html) |
| **Verified Package 1.0.5** | September 23, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/com.unity.ml-agents_1.0.5) | [docs](https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/.zip) | [0.16.1](https://pypi.org/project/mlagents/0.16.1/) | [1.0.5](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/manual/index.html) |
| **Release 7** | September 16, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_7) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_7_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_7.zip) | [0.20.0](https://pypi.org/project/mlagents/0.20.0/) | [1.4.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.4/manual/index.html) |
If you are a researcher interested in a discussion of Unity as an AI platform,
see a pre-print of our

146
utils/make_readme_table.py


Generate the "Releases" table on the main readme. Update the versions lists, run this script, and copy the output
into the markdown file.
"""
from distutils.version import LooseVersion
from distutils.version import LooseVersion, StrictVersion
from collections import Counter
MAX_DAYS = 150 # do not print releases older than this many days
def table_line(display_name, name, date, bold=False):
def table_line(version_info, bold=False):
# For release_X branches, docs are on a separate tag.
if name.startswith("release"):
docs_name = name + "_docs"
cells = [
f"**{version_info.display_name}**",
f"{bold_str}{version_info.release_date}{bold_str}",
f"{bold_str}[source]({version_info.source_link}){bold_str}",
f"{bold_str}[docs]({version_info.doc_link}){bold_str}",
f"{bold_str}[download]({version_info.download_link}){bold_str}",
]
if version_info.is_master:
cells.append("--") # python
cells.append("--") # Unity
docs_name = name
return f"| **{display_name}** | {bold_str}{date}{bold_str} | {bold_str}[source](https://github.com/Unity-Technologies/ml-agents/tree/{name}){bold_str} | {bold_str}[docs](https://github.com/Unity-Technologies/ml-agents/tree/{docs_name}/docs/Readme.md){bold_str} | {bold_str}[download](https://github.com/Unity-Technologies/ml-agents/archive/{name}.zip){bold_str} |" # noqa
cells.append(
f"{bold_str}[{version_info.python_verion}]({version_info.pypi_link}){bold_str}"
)
cells.append(
f"{bold_str}[{version_info.csharp_version}]({version_info.package_link}){bold_str}"
)
joined_cells = " | ".join(cells)
return f"| {joined_cells} |"
class ReleaseInfo(NamedTuple):

release_date: str
@staticmethod
def from_simple_tag(release_tag: str, release_date: str) -> "ReleaseInfo":
"""
Generate the ReleaseInfo for "old style" releases, where the tag and versions
were all the same.
"""
return ReleaseInfo(release_tag, release_tag, release_tag, release_date)
is_verified: bool = False
@property
def loose_version(self) -> LooseVersion:

def is_master(self) -> bool:
return self.release_tag == "master"
@property
def release_datetime(self) -> datetime:
if self.is_master:
return datetime.today()
return datetime.strptime(self.release_date, "%B %d, %Y")
@property
return (
datetime.today() - datetime.strptime(self.release_date, "%B %d, %Y")
).days
return (datetime.today() - self.release_datetime).days
@property
def display_name(self) -> str:

"""
return self.release_tag.replace("_", " ").title()
if self.is_verified:
return f"Verified Package {self.csharp_version}"
elif self.is_master:
return "master (unstable)"
else:
return self.release_tag.replace("_", " ").title()
@property
def source_link(self):
if self.is_verified:
return f"https://github.com/Unity-Technologies/ml-agents/tree/com.unity.ml-agents_{self.csharp_version}"
else:
return f"https://github.com/Unity-Technologies/ml-agents/tree/{self.release_tag}"
@property
def download_link(self):
return f"https://github.com/Unity-Technologies/ml-agents/archive/{self.release_tag}.zip"
@property
def doc_link(self):
if self.is_verified:
return "https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs/Readme.md"
# For release_X branches, docs are on a separate tag.
if self.release_tag.startswith("release"):
docs_name = self.release_tag + "_docs"
else:
docs_name = self.release_tag
return f"https://github.com/Unity-Technologies/ml-agents/tree/{docs_name}/docs/Readme.md"
@property
def package_link(self):
try:
v = StrictVersion(self.csharp_version).version
return f"https://docs.unity3d.com/Packages/com.unity.ml-agents@{v[0]}.{v[1]}/manual/index.html"
except ValueError:
return "--"
@property
def pypi_link(self):
return f"https://pypi.org/project/mlagents/{self.python_verion}/"
ReleaseInfo.from_simple_tag("0.10.0", "September 30, 2019"),
ReleaseInfo.from_simple_tag("0.10.1", "October 9, 2019"),
ReleaseInfo.from_simple_tag("0.11.0", "November 4, 2019"),
ReleaseInfo.from_simple_tag("0.12.0", "December 2, 2019"),
ReleaseInfo.from_simple_tag("0.12.1", "December 11, 2019"),
ReleaseInfo.from_simple_tag("0.13.0", "January 8, 2020"),
ReleaseInfo.from_simple_tag("0.13.1", "January 21, 2020"),
ReleaseInfo.from_simple_tag("0.14.0", "February 13, 2020"),
ReleaseInfo.from_simple_tag("0.14.1", "February 26, 2020"),
ReleaseInfo.from_simple_tag("0.15.0", "March 18, 2020"),
ReleaseInfo.from_simple_tag("0.15.1", "March 30, 2020"),
ReleaseInfo("master", "master", "master", "--"),
ReleaseInfo("release_1", "1.0.0", "0.16.0", "April 30, 2020"),
ReleaseInfo("release_2", "1.0.2", "0.16.1", "May 20, 2020"),
ReleaseInfo("release_3", "1.1.0", "0.17.0", "June 10, 2020"),

ReleaseInfo("release_10", "1.6.0", "0.22.0", "November 18, 2020"),
ReleaseInfo("release_11", "1.7.0", "0.23.0", "December 21, 2020"),
ReleaseInfo("release_12", "1.7.2", "0.23.0", "December 22, 2020"),
# Verified releases
ReleaseInfo("", "1.0.6", "0.16.1", "November 16, 2020", is_verified=True),
ReleaseInfo("", "1.0.5", "0.16.1", "September 23, 2020", is_verified=True),
ReleaseInfo("", "1.0.4", "0.16.1", "August 20, 2020", is_verified=True),
MAX_DAYS = 150 # do not print releases older than this many days
sorted_versions = sorted(
versions, key=lambda x: (x.loose_version, x.csharp_version), reverse=True
sorted_versions = sorted(versions, key=lambda x: x.release_datetime, reverse=True)
highlight_versions = set()
# Highlight the most recent verified version
highlight_versions.add([v for v in sorted_versions if v.is_verified][0])
# Highlight the most recent regular version
highlight_versions.add(
[v for v in sorted_versions if (not v.is_verified and not v.is_master)][0]
print(table_line("master (unstable)", "master", "--"))
highlight = True # whether to bold the line or not
count_by_verified = Counter()
if version_info.elapsed_days <= MAX_DAYS:
print(
table_line(
version_info.display_name,
version_info.release_tag,
version_info.release_date,
highlight,
)
)
highlight = False # only bold the first stable release
highlight = version_info in highlight_versions
if version_info.elapsed_days > MAX_DAYS:
# Make sure we always have at least regular and one verified entry
if count_by_verified[version_info.is_verified] > 0:
continue
print(table_line(version_info, highlight))
count_by_verified[version_info.is_verified] += 1
print("\n\n")
正在加载...
取消
保存