diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b0e49cad..542766f0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,29 +1,30 @@ ## Description Closes #XXX -Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. - -How should this pull request be reviewed? -- [ ] By commit -- [ ] All changes at once - -## Type of change +Please include a summary, motivation, and context of the changes and the related issue. +### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +### How should this pull request be reviewed? +- [ ] By commit +- [ ] All changes at once + ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. +### Passes Tests - [ ] __Unit tests__ (General Environment only) `pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/unittest` - [ ] __Integrated tests__ (General Environment only) `pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/integration` +- [ ] __Examples__ (General Environment only) `pytest tests/examples` ### Test Configuration - - Python: [e.g. 3.10.1] -- Basilisk: [e.g. 2.2.0] - - Platform: [e.g. Ubuntu 22.08] +- Python: +- Basilisk: +- Platform: # Checklist: @@ -34,4 +35,3 @@ Please describe the tests that you ran to verify your changes. - [ ] Commit messages are atomic, are in the form `Issue #XXX: Message` and have a useful message - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes diff --git a/examples/general_satellite_tasking/multisat_aeos.py b/examples/general_satellite_tasking/multisat_aeos.py index 39428181..15b81f2f 100644 --- a/examples/general_satellite_tasking/multisat_aeos.py +++ b/examples/general_satellite_tasking/multisat_aeos.py @@ -14,7 +14,7 @@ # Data environment contains 5000 targets located near random cities, which are # randomized on reset() -env_features = CityTargets(n_targets=5000, location_offset=10e3) +env_features = CityTargets(n_targets=500, location_offset=10e3) # Data manager records and rewards uniquely imaged targets data_manager = data.UniqueImagingManager(env_features) @@ -54,7 +54,7 @@ # Instantiate the satellite object. Arguments to the satellite class are set here. satellite = sat_type( - "EO" + str(i + 1), sat_args, n_ahead_observe=30, n_ahead_act=15 + "EO" + str(i + 1), sat_args, n_ahead_observe=15, n_ahead_act=15 ) satellites.append(satellite) @@ -82,7 +82,7 @@ # current task is finished max_step_duration=600.0, # Set 3-orbit long episodes - time_limit=95 * 60 * 3, + time_limit=95 * 60, log_level="INFO", ) diff --git a/examples/general_satellite_tasking/satellite_customization.py b/examples/general_satellite_tasking/satellite_customization.py index 1ffb961a..b0f42e4b 100644 --- a/examples/general_satellite_tasking/satellite_customization.py +++ b/examples/general_satellite_tasking/satellite_customization.py @@ -161,7 +161,7 @@ class CustomDynModel(dynamics.ImagingDynModel, dynamics.LOSCommDynModel): # Configure the environent -env_features = CityTargets(n_targets=5000) +env_features = CityTargets(n_targets=1000) data_manager = data.UniqueImagingManager(env_features) # Use the CustomSat type sat_type = CustomSatComposed @@ -189,7 +189,7 @@ class CustomDynModel(dynamics.ImagingDynModel, dynamics.LOSCommDynModel): data_manager=data_manager, sim_rate=0.5, max_step_duration=600.0, - time_limit=95 * 60 * 3, + time_limit=95 * 60, log_level="INFO", ) diff --git a/examples/general_satellite_tasking/single_sat.py b/examples/general_satellite_tasking/single_sat.py index 79d21379..926e414f 100644 --- a/examples/general_satellite_tasking/single_sat.py +++ b/examples/general_satellite_tasking/single_sat.py @@ -12,7 +12,7 @@ # satellite. # Data environment contains 5000 targets randomly distributed -env_features = StaticTargets(n_targets=5000) +env_features = StaticTargets(n_targets=1000) # Data manager records and rewards uniquely imaged targets data_manager = data.UniqueImagingManager(env_features) @@ -59,7 +59,7 @@ # current task is finished max_step_duration=600.0, # Set 3-orbit long episodes - time_limit=95 * 60 * 3, + time_limit=95 * 60, # Send the terminated signal in addition to the truncated signal at the end of the # episode. Needed for some RL algorithms to work correctly. terminate_on_time_limit=True, diff --git a/tests/examples/test_general_satellite_tasking.py b/tests/examples/test_general_satellite_tasking.py new file mode 100644 index 00000000..d3151b54 --- /dev/null +++ b/tests/examples/test_general_satellite_tasking.py @@ -0,0 +1,19 @@ +import pathlib +import runpy + +import pytest + +examples_path = ( + pathlib.Path(__file__).parent + / ".." + / ".." + / "examples" + / "general_satellite_tasking" +) +scripts = examples_path.resolve().glob("*.py") +script_names = {script.name: script for script in scripts} + + +@pytest.mark.parametrize("script", script_names) +def test_example_script(script): + runpy.run_path(script_names[script]) diff --git a/tests/integration/envs/general_satellite_tasking/test_int_full_environments.py b/tests/integration/envs/general_satellite_tasking/test_int_full_environments.py index da45492e..f1c9db10 100644 --- a/tests/integration/envs/general_satellite_tasking/test_int_full_environments.py +++ b/tests/integration/envs/general_satellite_tasking/test_int_full_environments.py @@ -98,7 +98,7 @@ def test_parallel_api(): try: parallel_api_test(parallel_env) except AssertionError as e: - if str(e) == "agent cannot be revived once dead": - warn("'{e}' is a known issue (#59)") + if "agent cannot be revived once dead" in str(e): + warn(f"'{e}' is a known issue (#59)") else: raise (e)