Skip to content

Feature/model modularity#323

Merged
Mark2000 merged 8 commits intodevelopfrom
feature/model-modularity
Jan 2, 2026
Merged

Feature/model modularity#323
Mark2000 merged 8 commits intodevelopfrom
feature/model-modularity

Conversation

@Mark2000
Copy link
Contributor

@Mark2000 Mark2000 commented Nov 4, 2025

Description

Part of #156

See copilot summary.

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 how tests have been updated to verify your changes.

Future Work

What future tasks are needed, if any?

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@Mark2000 Mark2000 force-pushed the feature/model-modularity branch 15 times, most recently from 3d6dafa to 239b9ee Compare November 5, 2025 05:19
@Mark2000 Mark2000 marked this pull request as ready for review November 5, 2025 05:42
Copilot AI review requested due to automatic review settings November 5, 2025 05:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the inheritance structure of the dynamics and flight software models to support flexible composition through multiple inheritance. Users can now specify dyn_type and fsw_type as tuples of classes rather than manually creating new classes.

Key Changes:

  • Introduced base classes BaseDynamicsModel, BaseFSWModel, BaseWorldModel with minimal functionality, allowing more granular composition
  • Added compose_types() utility to handle dynamic type composition with MRO resolution
  • Removed world_type parameter requirement from test cases (now auto-inferred)
  • Updated world model setup to use more modular inheritance with EclipseWorldModel and AtmosphereWorldModel

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/bsk_rl/utils/functional.py Added type composition utilities (compose_types, remove_duplicate_bases, etc.) and imported MagicMock
src/bsk_rl/sats/satellite.py Added get_dyn_type() and get_fsw_type() methods to compose types from tuples
src/bsk_rl/sim/dyn/base.py Split BasicDynamicsModel into BaseDynamicsModel (minimal) and BasicDynamicsModel (full-featured)
src/bsk_rl/sim/fsw/base.py Moved Task class definition before FSWModel and created BaseFSWModel
src/bsk_rl/sim/world.py Renamed BasicWorldModel to BaseWorldModel and split into modular components
src/bsk_rl/gym.py Updated _minimum_world_model() to use compose_types()
tests/unittest/*.py Removed world_type=MagicMock() from test instantiations
examples/*.ipynb Replaced types.new_class() with tuple syntax for type composition
Comments suppressed due to low confidence (2)

src/bsk_rl/sim/dyn/base.py:1

  • A new attribute min_orbital_radius is being set in the test, but this attribute is now a parameter in setup_spacecraft_hub() with a default value. The test should verify that this attribute is properly set during initialization rather than manually setting it, or document why manual setting is necessary for this test.
"""Basic dynamics model for BSK-RL."""

tests/unittest/sats/test_satellite.py:1

  • The new line adds dyn_type=MagicMock() to the Satellite patch decorator, but this is immediately overwritten by sats.Satellite.dyn_type = MockDynType on line 45. This creates confusion about which value is actually used. Either remove the duplicate assignment or add a comment explaining why both are needed.
from functools import partial

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mark2000 Mark2000 force-pushed the feature/model-modularity branch 3 times, most recently from ad895e3 to df698a3 Compare November 5, 2025 07:20
@Mark2000
Copy link
Contributor Author

Mark2000 commented Nov 5, 2025

TODO: Should document dynamics and fsw selection more explicitly somewhere

@Mark2000 Mark2000 force-pushed the feature/model-modularity branch 4 times, most recently from fee7375 to 866a8c9 Compare November 5, 2025 16:41
@Mark2000
Copy link
Contributor Author

TypeError: Can't instantiate abstract class MRPControlTask without an implementation for abstract method '_create_module_data'

TODO: make _create_module_data not abstract

@Mark2000 Mark2000 force-pushed the feature/model-modularity branch from 866a8c9 to e981945 Compare November 18, 2025 22:52
@Mark2000 Mark2000 force-pushed the feature/model-modularity branch from 12d772c to d3b5539 Compare November 20, 2025 21:33
@Mark2000 Mark2000 force-pushed the feature/model-modularity branch from d3b5539 to c9bdaa2 Compare December 2, 2025 20:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mark2000 Mark2000 merged commit 0f45dc7 into develop Jan 2, 2026
13 checks passed
@Mark2000 Mark2000 deleted the feature/model-modularity branch January 2, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant