Commit Graph

1589 Commits

Author SHA1 Message Date
Charlie Crane
efdc979495 #2464 Changing pyproject.toml to allow the use of python 3.11 and tweaking the pipeline to use python 3.11. Seeing what happens... 2024-05-01 14:33:38 +01:00
Charlie Crane
8d9ffab514 #2464 - Correcting Python versioning pre-req range on README.md as we do not currently support Python3.11 2024-05-01 12:04:11 +01:00
Christopher McCarthy
4763344835 Merged PR 358: #2519 - refactored all air-space usage to that a new instance of AirSpace is...
## Summary
- Refactored all air-space usage to that a new instance of `AirSpace` is created for each instance of Network. This 1:1 relationship between network and airspace will allow parallelization.

## Test process
- Original test remains the same. TDD, init.
- Added additional `WirelessRouter` test that tests wireless connectivity from config file too.
``` text
C:\Users\ChristopherMcCarthy\source\azure_devops\ma-dev-uk\PrimAITE\venv\Scripts\python.exe "C:/Program Files/JetBrains/PyCharm 2023.3.5/plugins/python/helpers/pycharm/_jb_pytest_runner.py" --path C:\Users\ChristopherMcCarthy\source\azure_devops\ma-dev-uk\PrimAITE\tests\integration_tests\network\test_wireless_router.py
Testing started at 15:33 ...
Launching pytest with arguments C:\Users\ChristopherMcCarthy\source\azure_devops\ma-dev-uk\PrimAITE\tests\integration_tests\network\test_wireless_router.py --no-header --no-summary -q in C:\Users\ChristopherMcCarthy\source\azure_devops\ma-dev-uk\PrimAITE\tests\integration_tests\network

============================= test session starts =============================
collecting ... collected 2 items

test_wireless_router.py::test_cross_wireless_wan_connectivity
test_wireless_router.py::test_cross_wireless_wan_connectivity_from_yaml

======================== 2 passed, 1 warning in 0.14s =========================
+----------------+-------------------+-------------+---------------+--------------+---------+
| Connected Node |    MAC Address    |  IP Address |  Subnet Mask  |  Frequency   |  Status |
+----------------+-------------------+-------------+---------------+--------------+---------+
|    router_1    | da:9a:08:17:80:a4 | 192.168.1.1 | 255.255.255.0 | WiFi 2.4 GHz | Enabled |
|    router_2    | 0d:67:76:5e:c2:fb | 192.168.1.2 | 255.255.255.0 | WiFi 2.4 GHz | Enabled |
+----------------+-------------------+-------------+---------------+--------------+---------+
PASSED     [ 50%]+----------------+-------------------+-------------+---------------+--------------+---------+
| Connected Node |    MAC Address    |  IP Address |  Subnet Mask  |  Frequency   |  Status |
+----------------+-------------------+-------------+---------------+--------------+---------+
|    router_1    | 1a:46:f6:cb:8c:15 | 192.168.1.1 | 255.255.255.0 | WiFi 2.4 GHz | Enabled |
|    router_2    | 7a:9f:d8:2b:4b:90 | 192.168.1.2 | 255.255.255.0 | WiFi 2.4 GHz | Enabled |
+----------------+-------------------+-------------+---------------+--------------+---------+
PASSED [100%]
Process finished with exit code 0
```

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] atte...
2024-05-01 10:12:28 +00:00
Chris McCarthy
7552872430 #2519 - Fixed the broked multi-lan network topology diagrams while I was in doing a PR too 2024-05-01 10:28:54 +01:00
Chris McCarthy
d72622f3f7 Merge branch 'dev' into feature/2519_Make-airspace-an-attribute-of-Simulation
# Conflicts:
#	CHANGELOG.md
2024-05-01 10:22:44 +01:00
Charlie Crane
13cabf8e21 Merged PR 360: 2523 - Logging Rewards updates.
## Summary
This PR updates `PrimaiteGymEnv` and `PrimaiteRayMARLEnv` within `environment.py` to log reward values per step and per episode.
Corrects an import statement within `io.py` - removing the use of `src`.
Fixes an error within notebooks that saw them failing following a rename of `game_config` to `env_config`.

## Test process
 - Tests all continue to pass, and notebooks now run without error. This PR does not change any functionality, just adds some logging.
 - Searched for the catch-22 that would trip me up as part of this ticket. A 3 line change felt like too simple an implementation...

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [X] attended to any **TO-DOs** left in the code

Related work items: #2523
2024-04-30 17:13:50 +00:00
Charlie Crane
9c89fe4143 #2523 - Typo corrections within notebooks that stopped them from running 2024-04-30 16:14:34 +01:00
Chris McCarthy
04eb33e28a #2519 - Dropped failed unit test in test_wireless_router.py as it didn't actually test any functionality and simply just tested the config parser, which we now do in the integration test. 2024-04-30 16:07:38 +01:00
Charlie Crane
bb99e46651 #2523 - Updating CHANGELOG.md 2024-04-30 16:03:31 +01:00
Chris McCarthy
bc573dfed0 #2519 - refactored all air-space usage to that a new instance of AirSpace is created for each instance of Network. This 1:1 relationship between network and airspace will allow parallelization. Added additional WirelessRouter test that tests wireless connectivity from config file too. 2024-04-30 15:46:16 +01:00
Charlie Crane
9b3699389a #2523 - Adding in some additional logging for other agent classes. This currently prints total_reward instead of average reward 2024-04-30 15:36:59 +01:00
Christopher McCarthy
a82ee2b8e1 Merged PR 354: Network focussed dev config documentation
## Summary
Built three networks, one is the minimal network, one is a basic LAN, and another is a nice beefy multi-LAN setup with ISP and DNS along with applications, services. Documented the process when building the config files. Included the config files as example configs for use.

## Test process
Tested the shit out of the big multi-lan network.

## Checklist
- [ ] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [ ] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [ ] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2266
2024-04-30 13:53:28 +00:00
Charlie Crane
b8c46a92e9 #2523 - Minor typos/corrections to make things run locally. Added one logging line to record Blue agent reward per step in environment.py 2024-04-30 14:16:29 +01:00
Chris McCarthy
a141c8d212 #2266 - fixed typos from PR suggestions 2024-04-30 14:08:12 +01:00
Nick Todd
137f2a9648 Merged PR 306: Fix issues with check_hash function.
## Summary
The current implementation of check_hash() as triggered by NODE_FILE_CHECKHASH and NODE_FOLDER_CHECKHASH is incorrect. However, a correct implementation is a future task so the code is disabled and a deprecation warning has been added.

## Test process
Disabled tests that exercise check_hash() functionality. Added tests to show that deprecation warning is present.

## Checklist
- [X ] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

2299: Remove calls to corrupt.

Related work items: #2299
2024-04-30 12:08:19 +00:00
Nick Todd
3d0ebe1aba #2299: Correct possible mis-merge. 2024-04-30 10:39:33 +01:00
Nick Todd
9906ba20ae Merge branch 'dev' into bugfix/2299-check_hash_function_corrupts_files_and_folders 2024-04-30 09:17:40 +01:00
Marek Wolan
8a97d197b9 Merged PR 355: Document request success
## Summary
Add a doc page and a notebook to go over the request manager.

## Test process
Notebook runs.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [na] written **tests** for any new functionality added with this PR
- [x] updated the **documentation** if this PR changes or adds functionality
- [x] written/updated **design docs** if this PR implements new functionality
- [na] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

Related work items: #2514
2024-04-29 17:36:29 +00:00
Nick Todd
5b03013e3f Merge branch 'dev' into bugfix/2299-check_hash_function_corrupts_files_and_folders 2024-04-29 15:44:06 +01:00
Nick Todd
e667223a98 #2299: Remove debug cell from notebook. 2024-04-29 15:34:23 +01:00
Nick Todd
e7db5c7f58 #2299: Review comments 2024-04-29 15:30:24 +01:00
Marek Wolan
68d4751f73 Apply suggestions from code review 2024-04-29 11:56:40 +00:00
Marek Wolan
27d1cd460b #2514 Provide more friendly messages on validation failure 2024-04-29 11:13:32 +01:00
Marek Wolan
3c046b838b #2514 Document request response. 2024-04-29 11:11:51 +01:00
Nick Todd
75f404416c #2299: Update CHANGELOG.md 2024-04-29 10:30:47 +01:00
Marek Wolan
32a0542b73 Merged PR 353: Episode Schedule
## Summary
* Made It Possible™ to vary the layout and agents between episodes.
* Standardised the environments to all use `env_config` as the __init__ parameter name, previously PrimaiteGymEnv was using `game_config`
* Added a notebook that demonstrates how to use the variable episodes.

## Test process
Checked that existing pytests run. Added more tests. Checked that notebooks run.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [x] written **tests** for any new functionality added with this PR
- [x] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [x] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

Related work items: #2269, #2334, #2336, #2475, #2476
2024-04-29 09:08:37 +00:00
Chris McCarthy
81d4006240 #2266 - Finalised the tests and fleshed out the documentation more. 2024-04-26 23:18:09 +01:00
Marek Wolan
394e76048f Merge remote-tracking branch 'origin/dev' into feature/2476-training-schedules-mockup 2024-04-26 16:23:41 +01:00
Marek Wolan
30cc04411d #2476 apply pr comments 2024-04-26 16:23:02 +01:00
Chris McCarthy
0ccd53e907 Merge branch 'dev' into feature/2266_network-focussed-dev-documentation 2024-04-26 16:19:33 +01:00
Charlie Crane
5ee23dcb17 Merged PR 348: #2462 - Refactor of DatabaseClient and DatabaseServer
## Summary
Refactor of `DatabaseClient` and `DatabaseService` to update how connection IDs are generated. These are now provided by DatabaseService when establishing a connection.
Creation of `DatabaseClientConnection` class. This is used by `DatabaseClient` to hold a dictionary of active db connections.

## Test process
Tests have been updated to reflect the changes and all pass

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [X] attended to any **TO-DOs** left in the code

Related work items: #2462
2024-04-26 14:52:21 +00:00
Chris McCarthy
058ca3987f #2266 - Added more docs. Now need to test 2024-04-26 14:32:54 +01:00
Nick Todd
ec8b46f3bc #2299: Add tests to check for 'not implemented' warning message. 2024-04-25 17:56:55 +01:00
Nick Todd
0c375ebe4d #2299: Disable tests using CHECKHASH functionality 2024-04-25 17:08:03 +01:00
Nick Todd
0fa9fa32bc #2299: Add not implemented warning message. 2024-04-25 16:20:57 +01:00
Marek Wolan
be5cf0b877 Merge remote-tracking branch 'origin/dev' into feature/2476-training-schedules-mockup 2024-04-25 15:17:08 +01:00
Chris McCarthy
0fff7d2240 Merge branch 'dev' into feature/2266_network-focussed-dev-documentation 2024-04-25 15:16:28 +01:00
Marek Wolan
37945c0065 #2476 Remove temporary testing file 2024-04-25 15:16:20 +01:00
Chris McCarthy
c93c432bf1 #2266 - Added final complex network to the examples. Just need to finalise the building the config section 2024-04-25 15:14:40 +01:00
Czar Echavez
e1ac6255ad Merged PR 352: #2447: added mode to primaite cli + printing session to current working direc...
## Summary
- Added the mode command in PrimAITE CLI
- command allows users to switch between developer mode and production mode
- developer mode changes where the simulation_output is written
  - dev mode writes simulation output where the current working directory is

## Test process
CLI:
![primaite mode.gif](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/352/attachments/primaite%20mode.gif)

Running prod mode:
![primaite mode prod.gif](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/352/attachments/primaite%20mode%20prod.gif)

Running dev mode:
![primaite mode dev.gif](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/352/attachments/primaite%20mode%20dev.gif)

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

#2447: added mode to primaite cli + printing session to current working directory if in dev mode

Related work items: #2447
2024-04-25 14:13:55 +00:00
Marek Wolan
736408f8b4 Reference the episode schedule notebook in docs 2024-04-25 15:12:46 +01:00
Marek Wolan
66f31e8ed1 #2476 Add test for episode scheduler 2024-04-25 15:09:46 +01:00
Marek Wolan
42ce264e73 #2476 Fix string formatting 2024-04-25 13:54:05 +01:00
Czar Echavez
0fff29ef27 #2447: changelog + documentation 2024-04-25 13:50:41 +01:00
Marek Wolan
e3f9162a77 Merge remote-tracking branch 'origin/dev' into feature/2476-training-schedules-mockup 2024-04-25 13:50:11 +01:00
Czar Echavez
96b6fb81da #2447: added mode to primaite cli + printing session to current working directory if in dev mode 2024-04-25 13:32:57 +01:00
Marek Wolan
a92898d001 #2476 Finalise explanation notebook for episode schedule 2024-04-25 13:25:26 +01:00
Nick Todd
228a8099a3 #2299: Revert changes to disable check_hash() 2024-04-24 17:27:27 +01:00
Chris McCarthy
081ff0647f Merge branch 'dev' into feature/2266_network-focussed-dev-documentation
# Conflicts:
#	src/primaite/game/agent/observations/observations.py
2024-04-24 16:04:46 +01:00
Czar Echavez
f01c30864d Merged PR 347: Implementing log levels
## Summary
- Implementation of log levels
- log levels can be set via io_settings.log_level in the yaml config file

## Test process
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/347?_a=files&path=/tests/unit_tests/_primaite/_simulator/_system/core/test_sys_log.py

set up a test where the test checks the contents of the terminal so make sure that specific log level messages appear (or not) depending on the log level

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [X] attended to any **TO-DOs** left in the code

Related work items: #2470
2024-04-24 11:09:48 +00:00