Commit Graph

481 Commits

Author SHA1 Message Date
Chris McCarthy
4ed31a52e5 Updated the What is PrimAITE? section in index.rst. Dropped the use of sphinx-code-tabs in the docs as building the docs in pdf (make latexpdf) is suddenly complaining about the tab buttons. 2023-08-03 16:04:23 +01:00
jamesshort1
efb230a5fc Update README.md 2023-07-31 09:17:48 +01:00
jamesshort1
da8f91c78c Update README.md 2023-07-31 09:16:24 +01:00
Chris McCarthy
3fae05d971 #1711 - Last minute docs changes 2023-07-28 14:41:39 +01:00
Chris McCarthy
10ce2923c7 #1711 - Removed the legacy bools from the RLlibAgent constructor in primaite_session.py 2023-07-28 14:02:17 +01:00
Chris McCarthy
cd7ba9986c #1711 - Fully Integrated the legacy training config and lay down config options into the CLI, run PrimaiteSession, and Agent classes. Made the ese test in test_full_legacy_config_session.py use this new integrated option to read the legacy file. 2023-07-28 13:49:26 +01:00
Chris McCarthy
1084be914b Merge remote-tracking branch 'github/dev' into github_dev 2023-07-28 12:54:58 +01:00
Chris McCarthy
f01825b180 #1711 - Added the ability to load legacy lay down config files. Added extensive unit testing and end-to-end testing. Also added the ability to set exactly how many num_train_steps, num_eval_steps, num_train_episodes, and num_eval_episode and used when converting a legacy training config. 2023-07-28 12:53:49 +01:00
jamesshort1
5bf9f7f4ea Update README.md 2023-07-28 09:41:29 +01:00
jamesshort1
f71b3480f0 Update README.md 2023-07-28 09:40:05 +01:00
jamesshort1
87741ba994 Update README.md 2023-07-28 09:39:05 +01:00
jamesshort1
0a1d17c9cc Update README.md 2023-07-27 14:57:08 +01:00
Chris McCarthy
b15be9796d Added GFX license conditions. Included LICENSE file in build. Fixed a few character issues in README.md 2023-07-27 11:40:29 +01:00
Chris McCarthy
b40fb09c1f Dropped MIT license until public release 2023-07-27 11:03:25 +01:00
jamesshort1
99ff8ca4e1 Update README.md 2023-07-27 08:59:43 +01:00
jamesshort1
ebb901c2b2 Update README.md 2023-07-27 08:59:24 +01:00
Chris McCarthy
1b8af0d862 Added run section with primaite session command in the README.md 2023-07-26 22:10:59 +01:00
Chris McCarthy
69b0ea4572 Added additional install instructions to the README.md 2023-07-26 21:49:36 +01:00
Chris McCarthy
a5fa613bea Added project urls to pyproject.toml and a setup.cfg file for PyPi to pickup author and url 2023-07-26 21:11:15 +01:00
Chris McCarthy
46699880ce Added a CONTRIBUTING.md and added a URL to the Yawning-Titan reference in index.rst 2023-07-26 20:17:29 +01:00
Chris McCarthy
22f72139e3 Dropped the ADF build files and updated the package name install step in python-package.yml. Added bug_report.md and feature_request.md files for GitHub 2023-07-26 20:05:44 +01:00
Chris McCarthy
eec1c25989 Updated the README.md with developer install specific instructions 2023-07-26 19:49:24 +01:00
Chris McCarthy
514f239cc6 Merge remote-tracking branch 'devops/main' into github_dev 2023-07-26 19:43:46 +01:00
Chris McCarthy
21931e991c Create python-package.yml CI pipeline 2023-07-26 19:38:28 +01:00
Christopher McCarthy
0c601d0383 Merged PR 142: v2.0.0
v2.0.0

Related work items: #901, #1523, #1574, #1594, #1595, #1597, #1623, #1626, #1629, #1631, #1632, #1635, #1637, #1638, #1639, #1640, #1641, #1647, #1648, #1650
2023-07-26 18:20:28 +00:00
Chris McCarthy
8e3a0a0afa Ran final v2.0.0 benchmark and dropped the release candidate benchmarks 2023-07-26 18:19:11 +01:00
Chris McCarthy
7fe5df7fc4 Bumped version to 2.0.0 2023-07-26 14:38:57 +01:00
Christopher McCarthy
8bf1440f9b Merged PR 139: Re-run the benchmarks for v2.0.0rc1 and v2.0.0rc2 using the same config file....
## Summary
Re-run the benchmarks for v2.0.0rc1 and v2.0.0rc2 using the same config file. As expected, the versions perform almost identically as there's no real logic changes that would affect the agent between the two release candidates

## Checklist
- [X] This PR is linked to a **work item**
- [X] I have performed **self-review** of the code
- [ ] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [X] I have run **pre-commit** checks for code style

Related work items: #1574
2023-07-25 09:33:32 +00:00
Chris McCarthy
e9b52a69b7 Merge remote-tracking branch 'origin/dev' into release/2.0.0rc1
# Conflicts:
#	.gitignore
#	benchmark/results/PrimAITE Versions Learning Benchmark.png
#	benchmark/results/v2.0.0rc1/PrimAITE v2.0.0rc1 Learning Benchmark.pdf
#	benchmark/results/v2.0.0rc1/PrimAITE v2.0.0rc1 Learning Benchmark.png
#	benchmark/results/v2.0.0rc1/v2.0.0rc1_benchmark_metadata.json
2023-07-24 22:50:34 +01:00
Chris McCarthy
4f16105b67 RE-ran the benchmarks for v2.0.0rc1 and v2.0.0rc2 using the same config file. As expected, the versions perform almost identically as there's no real logic changes that would affect the agent between the two release candidates 2023-07-24 22:43:22 +01:00
Christopher McCarthy
7e0f55cdb8 Merged PR 137: #1650 - Turned on the test. Also updated some references to the old primaite...
## Summary
- Turned on the test. Also updated some references to the old primaite paths. Finally, pushed the deployment status classifier to Development Status :: 5 - Production/Stable

## Test process
Yes, turned on the test.

## Checklist
- [ ] This PR is linked to a **work item**
- [ ] I have performed **self-review** of the code
- [ ] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [ ] I have run **pre-commit** checks for code style

#1650 - Turned on the test. Also updated some references to the old primaite paths. Finally, pushed the deployment status classifier to Development Status :: 5 - Production/Stable

Related work items: #1650
2023-07-24 11:11:17 +00:00
Chris McCarthy
31955c0c84 #1650 - Removed the commented out pytest.mark.skip statement now that the test does work. 2023-07-24 09:20:36 +01:00
Chris McCarthy
ef6585a298 #1650 - Turned on the test. Also updated some references to the old primaite paths. Finally, pushed the deployment status classifier to Development Status :: 5 - Production/Stable 2023-07-21 16:49:17 +01:00
Christopher McCarthy
5d9dd7a2d9 Merged PR 135: #1648 - Updated file headers
## Summary
 - Updated file header from 'Crown Owned Copyright (C) Dstl 2023. DEFCON 703. Shared in confidence.' to '© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK'

## Checklist
- [ ] This PR is linked to a **work item**
- [ ] I have performed **self-review** of the code
- [ ] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [ ] I have run **pre-commit** checks for code style

#1648 - Updated file header from 'Crown Owned Copyright (C) Dstl 2023. DEFCON 703. Shared in confidence.' to '© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK'

Related work items: #1648
2023-07-21 14:08:09 +00:00
Chris McCarthy
a39541623a #1648 - Reverted benchmark sessions and episodes numbers 2023-07-21 15:07:21 +01:00
Chris McCarthy
63297ef0ed #1648 - Added header to benchmark files 2023-07-21 15:06:05 +01:00
Chris McCarthy
4527b38aa6 #1648 - Reverted the benchmark files 2023-07-21 15:01:51 +01:00
Chris McCarthy
050ca68907 #1648 - Updated file header from 'Crown Owned Copyright (C) Dstl 2023. DEFCON 703. Shared in confidence.' to '© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK' 2023-07-21 14:54:09 +01:00
Christopher McCarthy
cda0a28c03 Merged PR 134: PrimAITE app and user dirs are version specific
## Summary
- Added _PrimaitePaths class that manages all the primaite locations using PlayformDirs. This class now creates new primaite locations for each version of primaite.
- Rolled the _PrimaitePaths class out throughout the code base.
- Updated the docs to reference the new version paths.
- Updated the author from qinetiq to dstl
- Bumped version number to 2.0.0rc2

## Test process
- Manual checks. Tough to test the install paths.

## Checklist
- [ ] This PR is linked to a **work item**
- [ ] I have performed **self-review** of the code
- [ ] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [ ] I have run **pre-commit** checks for code style

Related work items: #1647
2023-07-21 13:50:56 +00:00
Chris McCarthy
b8ca5f1dca Merge branch 'dev' into feature/1647_Append_version_number_to_the_primaite_root_dir 2023-07-21 14:01:45 +01:00
Chris McCarthy
196d8855c3 #1647 - Added _PrimaitePaths class that manages all the primaite locations using PlayformDirs. This class now creates new primaite locations for each version of primaite.
- Rolled the _PrimaitePaths class out throughout the code base.
- Updated the docs to reference the new version paths.
- Updated the author from qinetiq to dstl
- Bumped version number to 2.0.0rc2
2023-07-21 14:00:50 +01:00
Czar Echavez
e1a396981a Merged PR 130: #1595: load session double run
## Summary
- Fixed the bug where session gets run twice when loading a session via CLI
- Added a test for the CLI run - xskipped while the bugfix for load session acting odd is tbd
- Fixed a minor bug in PrimAITE session where session_path is overwritten

## Test process
Added a new test for CLI, but xskipped while a different bug is tbd

Ran it locally and no longer runs another session after the loaded session
```
(venv) PS D:\Projects\ARCD\PrimAITE\PrimAITE> primaite session --load [REDACTED for security]\primaite\sessions\2023-07-20\2023-07-20_15-01-11
2023-07-20 15:04:21,320: Using: AgentFramework.SB3, AgentIdentifier.PPO, ActionType.NODE, observation_space=NODE_LINK_TABLE, Training: 5 episodes @ 256 stepsEvaluation: 5 episodes @ 256 steps
2023-07-20 15:04:21,335: Environment configuration loaded
Environment configuration loaded
2023-07-20 15:04:21,775: Welcome to the Primary-level AI Training Environment (PrimAITE) (version: 2.0.0rc1)
2023-07-20 15:04:21,775: The output directory for this session is: C:\Users\czar.echavez\primaite\sessions\2023-07-20\2023-07-20_15-04-21
2023-07-20 15:04:21,779: Beginning learning for 10 episodes @ 256 time steps...
2023-07-20 15:04:22,379: Episode: 1, Average Reward: -0.0020839843750000003
2023-07-20 15:04:23,137: Episode: 2, Average Reward: -0.0021933593750000004
2023-07-20 15:04:23,831: Episode: 3, Average Reward: -0.0022617187500000003
2023-07-20 15:04:24,486: Episode: 4, Average Reward: -0.002373046874999999
2023-07-20 15:04:25,125: Episode: 5, Average Reward: -0.0018066406250000014
2023-07-20 15:04:25,791: Episode: 6, Average Reward: -0.0017597656250000013
2023-07-20 15:04:26,415: Episode: 7, Average Reward: -0.0018437500000000014
2023-07-20 15:04:27,053: Episode: 8, Average Reward: -0.0019101562500000015
2023-07-20 15:04:27,715: Episode: 9, Average Reward: -0.0016777343750000013
2023-07-20 15:04:28,359: Episode: 10, Average Reward: -0.0015976562500000012
2023-07-20 15:04:28,550: Finished learning
2023-07-20 15:04:30,851: Beginning deterministic evaluation for 5 episodes @ 256 time steps...
2023-07-20 15:04:31,243: Episode: 1, Average Reward: -0.0018515625000000014
2023-07-20 15:04:31,663: Episode: 2, Average Reward: -0.0018515625000000014
2023-07-20 15:04:32,112: Episode: 3, Average Reward: -0.0018515625000000014
2023-07-20 15:04:32,505: Episode: 4, Average Reward: -0.0018515625000000014
2023-07-20 15:04:32,904: Episode: 5, Average Reward: -0.0018515625000000014
2023-07-20 15:04:32,998: Finished evaluation

```

Also fixed the xskipped tests, since the double running seems to have caused the issue of rewards not matching.

Added a test that runs the PrimAITE in CLI

## Checklist
- [x] This PR is linked to a **work item**
- [x] I have performed **self-review** of the code
- [x] I have written **tests** for any new functionality added with this PR
- [x] I have updated the **documentation** if this PR changes or adds functionality
- [x] I have run **pre-commit** checks for code style

#1595:
- Fixed the...
2023-07-21 11:32:32 +00:00
Christopher McCarthy
10c8604159 Merged PR 132: #1594 - Managed to get the evaluation of rllib agents working. A test has bee...
## Summary
Managed to get the evaluation of rllib agents working. A test has been added to test_primaite_session.py that now tests the full RLlib agent from end-to-end. I've also updated the tests in here to check that the mean reward per episode plot is created for both too. This will need a bit of a re-design further down the line, but for now, it works. Added a custom exception for RLlib eval only error.

Is this a hack? Yes. Does it work? Yes. we'll make this better later.

## Test process
Both a SB3 and Ray RLlib agent is tested now in the test_primaite_session.py module.

## Checklist
- [X] This PR is linked to a **work item**
- [X] I have performed **self-review** of the code
- [X] I have written **tests** for any new functionality added with this PR
- [X] I have updated the **documentation** if this PR changes or adds functionality
- [X] I have run **pre-commit** checks for code style

Related work items: #1594
2023-07-21 10:26:31 +00:00
Chris McCarthy
722fe97c84 #1594 - Added docstrings and fixed training type. Added a clean-up of the unpacked agent in eval dir. 2023-07-21 10:33:22 +01:00
Christopher McCarthy
e62bee3052 Merged PR 131: #1639 - Added CHANGELOG.md and backfilled it with v1.1.0 and v1.1.1 release n...
## Summary
Added changelog and backfilled with v1.1.0 and v1.1.0 release notes.

Check what's written against notes in: https://nscuk.sharepoint.com/:f:/r/sites/SSE32-ARCDTrainingEnvironments/Shared%20Documents/General/01%20PrimAITE/01.01%20Releases/Release%20Notes?csf=1&web=1&e=uwPsyM

## Test process
N/A

## Checklist
- [ ] This PR is linked to a **work item**
- [ ] I have performed **self-review** of the code
- [ ] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [ ] I have run **pre-commit** checks for code style

#1639 - Added CHANGELOG.md and backfilled it with v1.1.0 and v1.1.1 release notes.

Related work items: #1639
2023-07-21 09:28:28 +00:00
Czar Echavez
7999eb56a5 #1595: refactor variable name 2023-07-21 09:31:37 +01:00
Czar Echavez
21598fd792 #1595: possibly fixed the tests by fixing the bug 2023-07-21 09:17:38 +01:00
Chris McCarthy
df52236a7d #1594 - Managed to get the evaluation of rllib agents working. A test has been added to test_primaite_session.py that now tests the full RLlib agent from end-to-end. I;ve also updated the tests in here to check that the mean reward per episode plot is created for both too. This will need a bit of a re-design further down the line, but for now, it works. Added a custom exception for RLlib eval only error. 2023-07-20 19:58:48 +01:00
Chris McCarthy
470f52f35e #1639 - Reinstalled pre-commit hook 2023-07-20 18:45:02 +01:00
Chris McCarthy
5475155686 #1639 - Added CHANGELOG.md and backfilled it with v1.1.0 and v1.1.1 release notes. 2023-07-20 17:24:55 +01:00